Moved sql_add_nmea5 as a private function
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Thu, 12 Aug 2010 10:43:23 +0000 (10:43 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Thu, 12 Aug 2010 10:43:23 +0000 (10:43 +0000)
bin/common.py

index c65dcba373f0ba9c806e2eb602ac5dc6a162d0d3..afa34d355a15a9d5a0947f4f5cc82a6db738b561 100755 (executable)
@@ -13,7 +13,6 @@ __all__ = [
     #'_hash3_pathfilename',
     'db_bydate_addrecord',
     'db_lastinfo_setrecord_ifnewer',
-    #'sql_add_nmea5',
     #'aivdm_record123_format',
     #'aivdm_record123_length',
     #'aivdm_record5_format',
@@ -566,7 +565,7 @@ def db_lastinfo_setrecord_ifnewer(basefilename, record, timestamp):
     return updated
 
 
-def sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
+def _sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
     dim_bow, dim_stern, dim_port, dim_starboard, \
     eta_M, eta_D, eta_h, eta_m, draught, destination, source):
     ''' Don't call directly '''
@@ -643,7 +642,7 @@ def add_nmea5_full(strmmsi, timestamp, imo, name, callsign, type, \
     db_bydate_addrecord(filename, record, timestamp)
     updated = db_lastinfo_setrecord_ifnewer(filename, record, timestamp)
     if updated:
-        sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
+        _sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
                       dim_bow, dim_stern, dim_port, dim_starboard, \
                       eta_M, eta_D, eta_h, eta_m, draught, destination, source)
     return updated
@@ -772,7 +771,7 @@ def add_nmea5_partial(strmmsi, timestamp, imo, name, callsign, type, \
                 f.write(record)
     # keep the file locked during SQL updates
     if updated:
-        sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
+        _sql_add_nmea5(strmmsi, timestamp, imo, name, callsign, type, \
                       dim_bow, dim_stern, dim_port, dim_starboard, \
                       eta_M, eta_D, eta_h, eta_m, draught, destination, source)
     f.close()