[chronojump/chronojump-importer: 48/66] Fixes Pylint warnings.



commit 4a1f9ca14a7da2c894e3fc21674df543f67b9d4a
Author: Carles Pina i Estany <carles pina cat>
Date:   Sat Sep 17 17:14:48 2016 +0100

    Fixes Pylint warnings.

 src/chronojump-importer/chronojump_importer.py     |    8 +++++---
 .../chronojump_importer_test.py                    |    4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/chronojump-importer/chronojump_importer.py b/src/chronojump-importer/chronojump_importer.py
index f0b7756..1cea81f 100755
--- a/src/chronojump-importer/chronojump_importer.py
+++ b/src/chronojump-importer/chronojump_importer.py
@@ -57,11 +57,12 @@ class Row:
         return self._row.keys()
 
     def __eq__(self, other):
+        # noinspection PyProtectedMember
         return self._row == other._row
 
 
 class Table:
-    """ This class has Table operations: insert rows, remove duplicates, pudate sessionIDs, etc. """
+    """ This class has Table operations: inserts rows, removes duplicates, updates sessionIDs, etc. """
 
     def __init__(self, table_name):
         self._table_data = []
@@ -71,7 +72,7 @@ class Table:
         self._table_data.append(row)
 
     def concatenate_table(self, other):
-        """ Concatenates other in this table. It doens't change the table names """
+        """ Concatenates other in this table. It doesn't change the table names """
         self._table_data += other
 
     def remove_duplicates(self):
@@ -121,6 +122,7 @@ class Table:
     def __getitem__(self, index):
         return self._table_data[index]
 
+
 class Database:
     """ A database represents the database and read/writes tables. """
 
@@ -375,7 +377,7 @@ def import_database(source_path, destination_path, source_session):
     session = source_db.read(table_name="Session",
                              where_condition="Session.uniqueID={}".format(source_session))
 
-    number_of_matching_sessions = len(session._table_data)
+    number_of_matching_sessions = len(session)
 
     if number_of_matching_sessions == 0:
         print("Trying to import {session} from {source_file} and it doesn't exist. Cancelling...".format(
diff --git a/src/chronojump-importer/chronojump_importer_test.py 
b/src/chronojump-importer/chronojump_importer_test.py
index e14fa05..37fd1ea 100755
--- a/src/chronojump-importer/chronojump_importer_test.py
+++ b/src/chronojump-importer/chronojump_importer_test.py
@@ -185,9 +185,9 @@ class TestTable(unittest.TestCase):
 
         self.assertEqual(len(table_to_update._table_data), 3)
 
-        def verify_exists(table, name, personId):
+        def verify_exists(table, name, person_id):
             for row in table._table_data:
-                if row.get('name') == name and row.get('personId') == personId:
+                if row.get('name') == name and row.get('personId') == person_id:
                     return True
 
             return False


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