Anonymous avatar Anonymous committed 1a1e6e1

[svn] whitespace

Comments (0)

Files changed (7)

webhelpers/rails/asset_tag.py

     title = ''
     if type.lower() in ('rss', 'atom'):
         title = type.upper()
-        type='application/%s+xml' % type.lower()
+        type = 'application/%s+xml' % type.lower()
 
     tag_args = dict(rel='alternate', type=type, title=title,
                     href=compute_public_path(source))

webhelpers/rails/form_options.py

 
 from webhelpers.util import html_escape
 
-def options_for_select(container, selected = None):
+def options_for_select(container, selected=None):
     """
     Creates select options from a container (list, tuple, dict)
     
     if hasattr(container, 'values'):
         container = container.items()
     
-    if not isinstance(selected, (list,tuple)):
+    if not isinstance(selected, (list, tuple)):
         selected = (selected,)
     
     options = []
             options.append('<option value="%s">%s</option>' % (v, n))
     return "\n".join(options)
 
-def options_for_select_from_objects(container, name_attr, value_attr = None, selected = None):
+def options_for_select_from_objects(container, name_attr, value_attr=None, selected=None):
     """
     Create select options from objects in a container
     
     
     return options_for_select([make_elem(x) for x in container], selected)
 
-def options_for_select_from_dicts(container, name_key, value_key = None, selected = None):
+def options_for_select_from_dicts(container, name_key, value_key=None, selected=None):
     """
     Create select options from dicts in a container
     

webhelpers/rails/number.py

     formstr = '%01.' + str(precision) + 'f'
     return formstr % number
 
-__all__ = ['number_to_phone', 'number_to_currency', 'number_to_percentage','number_with_delimiter', 
-           'number_with_precision', 'number_to_human_size', 'human_size']
+__all__ = ['number_to_phone', 'number_to_currency', 'number_to_percentage',
+           'number_with_delimiter', 'number_with_precision', 'number_to_human_size',
+           'human_size']

webhelpers/rails/prototype.py

 from tags import tag, camelize
 from urls import get_url
 
-CALLBACKS = frozenset(['uninitialized','loading','loaded',
-                       'interactive','complete','failure','success'] + [str(x) for x in range(100,599)])
-AJAX_OPTIONS = frozenset(['before','after','condition','url',
-                          'asynchronous','method','insertion','position',
-                          'form','with','with_', 'update','script'] + list(CALLBACKS))
+CALLBACKS = frozenset(['uninitialized', 'loading', 'loaded',
+                       'interactive', 'complete', 'failure', 'success'] + \
+                          [str(x) for x in range(100,599)])
+AJAX_OPTIONS = frozenset(['before', 'after', 'condition', 'url',
+                          'asynchronous', 'method', 'insertion', 'position',
+                          'form', 'with', 'with_', 'update', 'script'] + \
+                             list(CALLBACKS))
 
 def link_to_remote(name, options={}, **html_options):
     """

webhelpers/rails/scriptaculous.py

     """
     element = (element_id and json.dumps(element_id)) or "element"
     if isinstance(js_options.get('queue'), dict):
-        js_options['queue'] = '{%s}' % ','.join(["%s:%s" % (k,(k == 'limit' and v) or "'%s'" % v) for k,v in js_options['queue'].iteritems()])
+        js_options['queue'] = '{%s}' % \
+            ','.join(["%s:%s" % (k, (k == 'limit' and v) or "'%s'" % v) \
+                          for k,v in js_options['queue'].iteritems()])
     elif js_options.has_key('queue'):
         js_options['queue'] = "'%s'" % js_options['queue']
     

webhelpers/rails/tags.py

     return name
 
 def strip_unders(options):
-    for x,y in options.iteritems():
+    for x, y in options.iteritems():
         if x.endswith('_'):
             options[x[:-1]] = y
             del options[x]
 
 def tag_options(**options):
     strip_unders(options)
-    cleaned_options = convert_booleans(dict([(x, y) for x,y in options.iteritems() if y is not None]))
-    optionlist = ['%s="%s"' % (x, escape_once(y)) for x,y in cleaned_options.iteritems()]
+    cleaned_options = convert_booleans(dict([(x, y) for x, y in options.iteritems() if y is not None]))
+    optionlist = ['%s="%s"' % (x, escape_once(y)) for x, y in cleaned_options.iteritems()]
     optionlist.sort()
     if optionlist:
         return ' ' + ' '.join(optionlist)

webhelpers/rails/urls.py

     _parsed = cgi.parse_qsl(source, keep_blank_values=True,
         strict_parsing=False)
     parsed = []
-    for k,v in _parsed:
+    for k, v in _parsed:
         parsed.append((k, v.decode('utf-8')))
     return parsed
 
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.