diff getan/backend.py @ 135:ce707fbb9666

Change coding style of if clauses
author Björn Ricks <bjoern.ricks@intevation.de>
date Wed, 31 Oct 2012 14:21:44 +0100
parents 99639833968d
children 9f4da22fb1f1
line wrap: on
line diff
--- a/getan/backend.py	Wed Oct 31 09:57:20 2012 +0100
+++ b/getan/backend.py	Wed Oct 31 14:21:44 2012 +0100
@@ -130,8 +130,9 @@
             while True:
                 row = cur.fetchone()
 
-                if not row: break
-                proj          = Project(*row)
+                if not row:
+                    break
+                proj = Project(*row)
                 proj.entries = self.load_entries(proj.id)
                 projects.append(proj)
 
@@ -155,7 +156,8 @@
                 try:
                     row = cur.fetchone()
 
-                    if not row: break
+                    if not row:
+                        break
                     entries.append(Entry(*row))
                 except:
                     logger.warn("found invalid entry.")
@@ -168,7 +170,8 @@
 
 
     def insert_project_entry(self, project, stop_time, desc):
-        if project is None: return
+        if project is None:
+            return
         cur = None
         try:
             cur = self.con.cursor()
@@ -195,7 +198,8 @@
             close(cur)
 
     def delete_entries(self, entries):
-        if entries is None: return
+        if entries is None:
+            return
 
         cur = None
         try:
@@ -209,7 +213,8 @@
 
 
     def move_entries(self, entries, new_project_id):
-        if entries is None or new_project_id is None: return
+        if entries is None or new_project_id is None:
+            return
 
         cur = None
         try:
@@ -238,7 +243,8 @@
 def close(cur):
     """ This function closes a database cursor if it is existing """
     if cur:
-        try: cur.close()
+        try:
+            cur.close()
         except:
             logger.warn("could not close database cursor.")
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)