Bela Hausmann avatar Bela Hausmann committed 5ff88c6

Some cosmetic changes (incl. PEP8)

Comments (0)

Files changed (10)

 Bela Hausmann
-Jannis Leidel
+Jannis Leidel
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 recursive-include licenses/fixtures *
 recursive-include licenses/templates *.html
-

licenses/admin.py

+# -*- coding: utf-8 -*-
 from django.contrib.admin import ModelAdmin, site, HORIZONTAL
 from django.utils.translation import ugettext_lazy as _
 from licenses.models import Organization, License

licenses/fields.py

+# -*- coding: utf-8 -*-
 from django.db.models import ForeignKey
 from django.utils.translation import ugettext_lazy as _
 

licenses/models.py

+# -*- coding: utf-8 -*-
 from django.db.models import Model, CharField, SlugField, URLField, TextField, ForeignKey, BooleanField
 from django.utils.translation import ugettext_lazy as _
 
         return self.website
     url = property(url)
 
+
 class License(Model):
     '''
         A license.

licenses/templates/licenses/link.html

-<a rel="license" href="{{ url }}">{{ name }}</a>
+<a href="{{ url }}" rel="license">{{ name }}</a>

licenses/templates/licenses/logo.html

-<a rel="license" href="{{ url }}"><img src="{{ img }}" title="{{ name }}" alt="{{ name }}" /></a>
+<a href="{{ url }}" rel="license"><img src="{{ img }}" title="{{ name }}" alt="{{ name }}" /></a>

licenses/templatetags/licensing.py

         Generic node to get one license, the tag defines the search paramter.
     '''
 
-    #@classmethod
     def handle_token(cls, parser, token, field):
         tokens = token.split_contents()
         if len(tokens) == 4:
                 raise template.TemplateSyntaxError("Second argument in %s must be 'as'" % tokens[0])
             lookup = tokens[1]
             # trim quotation marks
-            if (lookup[0]=='"' and lookup[-1]=='"') or (lookup[0]=="'" and lookup[-1]=="'"): lookup = lookup[1:-1]
+            if (lookup[0]=='"' and lookup[-1]=='"') or (lookup[0]=="'" and lookup[-1]=="'"):
+                lookup = lookup[1:-1]
             return cls(lookup=lookup, varname=tokens[3], field=field)
         else:
             raise template.TemplateSyntaxError("%r tag requires 3 arguments" % tokens[0])
         return ''
 
 
-#@register.tag
 def get_license_by_abbr(parser, token):
     '''
         Usage: {% get_license_by_abbr "short_name" as varname %}
     return GetLicenseNode.handle_token(parser, token, field='abbreviation')
 get_license_by_abbr = register.tag(get_license_by_abbr)
 
-#@register.tag
+
 def get_license_by_slug(parser, token):
     '''
         Usage: {% get_license_by_slug "slug" as varname %}
     return GetLicenseNode.handle_token(parser, token, field='slug')
 get_license_by_slug = register.tag(get_license_by_slug)
 
-#@register.filter
+
 def license_link(license):
     '''
         Usage {{ license|license_link }}
     })
 register.filter(license_link)
 
-#@register.filter
+
 def license_logo(license):
     '''
         Usage {{ license|license_logo }}
+# -*- coding: utf-8 -*-
 from distutils.core import setup
 
 setup(
-    name='django-licenses',
-    version='0.2',
-    description='A Django application that provides the ability to publish content under different licenses.',
-    author='Bela Hausmann',
-    author_email='and@stuffit.at',
-    maintainer='Jannis Leidel',
-    maintainer_email='jannis@leidel.info',
-    url='http://bitbucket.org/jezdez/django-licenses/',
-    packages= [
+    name = 'django-licenses',
+    version = '0.2',
+    description = 'A Django application that provides the ability to publish content under different licenses.',
+    author = 'Bela Hausmann',
+    author_email = 'post@belahausmann.name',
+    maintainer = 'Jannis Leidel',
+    maintainer_email = 'jannis@leidel.info',
+    url = 'http://bitbucket.org/jezdez/django-licenses/',
+    packages = [
         'licenses',
         'licenses.templatetags',
     ],
-    zip_safe=False,
-    classifiers=[
+    zip_safe = False,
+    classifiers = [
         'Development Status :: 4 - Beta',
         'Environment :: Web Environment',
         'Intended Audience :: Developers',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.