add main
This commit is contained in:
parent
e8b18b6a74
commit
29e70967f9
1 changed files with 22 additions and 15 deletions
|
@ -1,25 +1,32 @@
|
||||||
import logging
|
import logging
|
||||||
|
# TODO eh?
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
from kython.klogging import setup_logzero
|
from kython.klogging import setup_logzero
|
||||||
|
|
||||||
from photos import get_photos, iter_photos, get_logger
|
from photos import get_photos, iter_photos, get_logger
|
||||||
|
|
||||||
setup_logzero(get_logger(), level=logging.DEBUG)
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
cmd = sys.argv[1]
|
def main():
|
||||||
if cmd == "update_cache":
|
setup_logzero(get_logger(), level=logging.DEBUG)
|
||||||
from photos import update_cache, get_photos
|
|
||||||
update_cache()
|
if len(sys.argv) > 1:
|
||||||
get_photos(cached=True)
|
cmd = sys.argv[1]
|
||||||
|
if cmd == "update_cache":
|
||||||
|
from photos import update_cache, get_photos
|
||||||
|
update_cache()
|
||||||
|
get_photos(cached=True)
|
||||||
|
else:
|
||||||
|
raise RuntimeError(f"Unknown command {cmd}")
|
||||||
else:
|
else:
|
||||||
raise RuntimeError(f"Unknown command {cmd}")
|
for p in iter_photos():
|
||||||
else:
|
print(f"{p.dt} {p.path} {p.tags}")
|
||||||
for p in iter_photos():
|
pass
|
||||||
print(f"{p.dt} {p.path} {p.tags}")
|
# TODO need datetime!
|
||||||
pass
|
# print(p)
|
||||||
# TODO need datetime!
|
|
||||||
# print(p)
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue