[chronojump/chronojump-importer] Add comments, improves code.



commit f3cbe94be61290ff4e0a08639b2f1d0f4072baa6
Author: Carles Pina i Estany <carles pina cat>
Date:   Wed Sep 7 17:07:43 2016 +0100

    Add comments, improves code.

 src/chronojump-importer/chronojump_importer.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index a27a16f..1acfe27 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -239,7 +239,7 @@ def remove_duplicates_list(l):
 def increment_suffix(value):
     suffix = re.match("(.*) \(([0-9]+)\)", value)
 
-    if suffix == None:
+    if suffix is None:
         return "{} (1)".format(value)
     else:
         base_name = suffix.group(1)
@@ -272,6 +272,8 @@ def avoids_column_duplicate(cursor, table_name, column_name, data_row):
 
 
 def update_ids_from_table(table_to_update, column_to_update, referenced_table, old_referenced_column, 
new_referenced_column):
+    """From table_to_update: updates column_to_update if there is referenced_table old_referenced_column 
with the same
+    value and assigned new_new_referenced_column value."""
     result = copy.deepcopy(table_to_update)
 
     for row_to_update in result:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]