Gamaliel Espinoza 8 лет назад
Родитель
Сommit
d7c950c5d0
2 измененных файлов с 18 добавлено и 1 удалено
  1. 1 1
      tools/fourier/__init__.py
  2. 17 0
      tools/fourier/cli.py

+ 1 - 1
tools/fourier/__init__.py

@@ -1 +1 @@
-__version__ = '1.0.10'
+__version__ = '1.0.11'

+ 17 - 0
tools/fourier/cli.py

@@ -268,6 +268,23 @@ def main():
             
             conn.commit()
 
+        elif action == 'align-dates':
+            conn = sqlite3.connect(dbpath)
+            cursor = conn.cursor()
+            query = ('select hash, filename, timestamp '
+                     'from "file"')
+            cursor.execute(query)
+
+            for row in cursor:
+                fn = os.path.basename(row['filename'])
+                ts = datetime.fromtimestamp(row['timestamp'])
+                fl = datetime.strptime(fn[:19], '%Y-%m-%dT%H-%M-%S')
+
+                if fl != ts:
+                    print('{}\t{}\t{}'.format(row['hash'],
+                                              row['timestamp'],
+                                              row['filename']
+                                              ))
 
     elif args.entity == 'station':
         if action == 'list':