Anonymous avatar Anonymous committed 59860f5

Changed Conditional Expressions

Comments (0)

Files changed (2)

sphinx/util/osutil.py

         return path
 
 def find_catalog(docname, compaction):
-    return docname.split(SEP, 1)[0] if compaction else docname
+    if compaction:
+        ret = docname.split(SEP, 1)[0]
+    else:
+        ret = docname
+
+    return ret

sphinx/websupport/storage/sqlalchemy_db.py

         comments = []
         list_stack = [comments]
         for r in results:
-            comment, vote = r if username else (r, 0)
+            if username:
+                comment, vote = r
+            else:
+                comment, vote = (r, 0)
 
             inheritance_chain = comment.path.split('.')[1:]
 
 
         path = self.path.split('.')
         node = path[0]
-        parent = path[-2] if len(path) > 2 else None
+        if len(path) > 2:
+            parent = path[-2]
+        else:
+            parent = None
 
         return {'text': self.text,
                 'username': self.username or 'Anonymous',
         minutes = seconds / 60
 
         if days == 0:
-            dt = (minutes, 'minute') if hours == 0 else (hours, 'hour')
+            if hours == 0:
+                dt = (minutes, 'minute')
+            else:
+                dt = (hours, 'hour')
         else:
             dt = (days, 'day')
 
-        return '%s %s ago' % dt if dt[0] == 1 else '%s %ss ago' % dt
+        if dt[0] == 1:
+            ret = '%s %s ago' % dt
+        else:
+            ret = '%s %ss ago' % dt
+
+        return ret
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.