summaryrefslogtreecommitdiffabout
path: root/dicoweb/templatetags
authorWojciech Polak <polak@gnu.org>2013-03-08 19:21:32 (GMT)
committer Wojciech Polak <polak@gnu.org>2013-03-08 19:42:56 (GMT)
commit8f61a0bf3cd35445dc5cb5c18faf69d3a1d32680 (patch) (side-by-side diff)
tree2c4f046ee1a2c82c400b47ad9ace60c73aac3f9c /dicoweb/templatetags
parent9d08cdfd73267b2fcd84b968258536cbdfad9af2 (diff)
downloaddico-8f61a0bf3cd35445dc5cb5c18faf69d3a1d32680.tar.gz
dico-8f61a0bf3cd35445dc5cb5c18faf69d3a1d32680.tar.bz2
PEP8 code formatting changes.
Update Dicoweb for Django 1.4+ Add requirements.txt file for PIP.
Diffstat (limited to 'dicoweb/templatetags') (more/less context) (ignore whitespace changes)
-rw-r--r--dicoweb/templatetags/dictlookup.py11
-rw-r--r--dicoweb/templatetags/media.py9
2 files changed, 11 insertions, 9 deletions
diff --git a/dicoweb/templatetags/dictlookup.py b/dicoweb/templatetags/dictlookup.py
index e9ea334..870e806 100644
--- a/dicoweb/templatetags/dictlookup.py
+++ b/dicoweb/templatetags/dictlookup.py
@@ -1,5 +1,5 @@
# This file is part of GNU Dico.
-# Copyright (C) 2008-2009, 2012 Wojciech Polak
+# Copyright (C) 2008-2009, 2012, 2013 Wojciech Polak
#
# GNU Dico is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,12 +16,13 @@
from django.template import Library
-register = Library ()
+register = Library()
-def dictlookup (dict, key):
+
+def dictlookup(dict, key):
try:
- return dict.get (key, '')
+ return dict.get(key, '')
except KeyError:
return ''
-register.filter (dictlookup)
+register.filter(dictlookup)
diff --git a/dicoweb/templatetags/media.py b/dicoweb/templatetags/media.py
index 961194e..498e1a4 100644
--- a/dicoweb/templatetags/media.py
+++ b/dicoweb/templatetags/media.py
@@ -1,5 +1,5 @@
# This file is part of GNU Dico.
-# Copyright (C) 2008-2009, 2012 Wojciech Polak
+# Copyright (C) 2008-2009, 2012, 2013 Wojciech Polak
#
# GNU Dico is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,9 +16,10 @@
from django.template import Library
-register = Library ()
+register = Library()
-def media_prefix ():
+
+def media_prefix():
"""Return the string contained in the setting MEDIA_URL."""
try:
from django.conf import settings
@@ -26,4 +27,4 @@ def media_prefix ():
return ''
return settings.MEDIA_URL
-media_prefix = register.simple_tag (media_prefix)
+media_prefix = register.simple_tag(media_prefix)

Return to:

Send suggestions and report system problems to the System administrator.