1. Peter Suter
  2. trac-1942

Source

trac-1942 / MinorStyleCleanup.patch

# HG changeset patch
# Parent 326669ef4fe13ecfcaa11d75d0ca33268f4916f8
Minor style cleanups

diff -r 326669ef4fe1 trac/ticket/templates/ticket.html
--- a/trac/ticket/templates/ticket.html	Mon Jan 30 07:14:54 2012 +0000
+++ b/trac/ticket/templates/ticket.html	Sat Feb 04 19:39:49 2012 +0100
@@ -270,18 +270,18 @@
                             <span py:when="field.cc_entry"><!--! Special case for Cc: field -->
                               <em>${field.cc_entry}</em>
                               <input type="checkbox" id="field-cc" name="cc_update"
-                                title="This checkbox allows you to add or remove yourself from the CC list."
-                                checked="${field.cc_update}" />
+                                     title="This checkbox allows you to add or remove yourself from the CC list."
+                                     checked="${field.cc_update}" />
                             </span>
                             <!--! Cc: when TICKET_EDIT_CC is allowed -->
                             <span py:when="field.name == 'cc'">
-                              <input  type="text" id="field-${field.name}"
-                                title="Space or comma delimited email addresses and usernames are accepted."
-                                name="field_${field.name}" value="${value}" />
+                              <input type="text" id="field-${field.name}"
+                                     title="Space or comma delimited email addresses and usernames are accepted."
+                                     name="field_${field.name}" value="${value}" />
                             </span>
                             <!--! All the other text input fields -->
                             <input py:otherwise="" type="text" id="field-${field.name}"
-                              name="field_${field.name}" value="${value}" />
+                                   name="field_${field.name}" value="${value}" />
                           </py:choose>
                         </py:otherwise>
                       </py:choose>
diff -r 326669ef4fe1 trac/ticket/web_ui.py
--- a/trac/ticket/web_ui.py	Mon Jan 30 07:14:54 2012 +0000
+++ b/trac/ticket/web_ui.py	Sat Feb 04 19:39:49 2012 +0100
@@ -1449,7 +1449,7 @@
             fields.remove(owner_field)
             fields.append(owner_field)
         return fields
-        
+
     def _insert_ticket_data(self, req, ticket, data, author_id, field_changes):
         """Insert ticket data into the template `data`"""
         replyto = req.args.get('replyto')
diff -r 326669ef4fe1 trac/util/datefmt.py
--- a/trac/util/datefmt.py	Mon Jan 30 07:14:54 2012 +0000
+++ b/trac/util/datefmt.py	Sat Feb 04 19:39:49 2012 +0100
@@ -545,7 +545,7 @@
     month=lambda now: now.replace(microsecond=0, second=0, minute=0, hour=0,
                                   day=1),
     year=lambda now: now.replace(microsecond=0, second=0, minute=0, hour=0,
-                                  day=1, month=1),
+                                 day=1, month=1),
 )
 
 def _parse_relative_time(text, tzinfo):
@@ -559,11 +559,11 @@
                - timedelta(days=1)
     match = _REL_TIME_RE.match(text)
     if match:
-        (value, interval) = match.groups()
+        value, interval = match.groups()
         return now - _time_intervals[interval](float(value))
     match = _TIME_START_RE.match(text)
     if match:
-        (which, start) = match.groups()
+        which, start = match.groups()
         dt = _time_starts[start](now)
         if which == 'last':
             if start == 'month':
@@ -574,7 +574,6 @@
             else:
                 dt -= _time_intervals[start](1)
         return dt
-    return None
 
 # -- formatting/parsing helper functions