Commit a9deba91 authored by Romain Bignon's avatar Romain Bignon

weboob script: add command 'update'

parent fa2b1159
......@@ -43,6 +43,14 @@ class Weboob(ConsoleApplication):
capApplicationDict = self.init_CapApplicationDict()
if len(sys.argv) >= 2:
try:
cmd = getattr(self, 'cmd_%s' % sys.argv[1])
except AttributeError:
pass
else:
cmd()
return
cap = sys.argv.pop(1)
if cap not in capApplicationDict:
print('Unknown capability, please choose one in the following list')
......@@ -55,6 +63,9 @@ class Weboob(ConsoleApplication):
application = applications[0] if len(applications) == 1 else self.choose_application(applications)
application.run()
def cmd_update(self):
self.weboob.update()
def update(self):
for repository in self.weboob.repositories.repositories:
update_date = datetime.strptime(str(repository.update), '%Y%m%d%H%M')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment