From e23276266bff6567e096b11f09a3512c6e61616a Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Thu, 12 Mar 2020 21:24:39 +0000 Subject: [PATCH] move photos provider inside --- {photos => my/photos}/__init__.py | 5 +++++ {photos => my/photos}/__main__.py | 0 requirements.txt | 5 ----- run | 3 --- update_cache | 7 ------- 5 files changed, 5 insertions(+), 15 deletions(-) rename {photos => my/photos}/__init__.py (98%) rename {photos => my/photos}/__main__.py (100%) delete mode 100644 requirements.txt delete mode 100755 run delete mode 100755 update_cache diff --git a/photos/__init__.py b/my/photos/__init__.py similarity index 98% rename from photos/__init__.py rename to my/photos/__init__.py index 65ccee3..e33d256 100644 --- a/photos/__init__.py +++ b/my/photos/__init__.py @@ -1,3 +1,6 @@ + +# pip install geopy magic + from datetime import datetime import itertools import os @@ -270,6 +273,7 @@ def iter_photos() -> Iterator[Photo]: geos.pop() def get_photos(cached: bool=False) -> List[Photo]: + # TODO get rid of it, use cachew.. import dill # type: ignore if cached: with open(CACHE_PATH, 'rb') as fo: @@ -278,6 +282,7 @@ def get_photos(cached: bool=False) -> List[Photo]: else: return list(iter_photos()) +# TODO python3 -m photos update_cache def update_cache(): import dill # type: ignore photos = get_photos(cached=False) diff --git a/photos/__main__.py b/my/photos/__main__.py similarity index 100% rename from photos/__main__.py rename to my/photos/__main__.py diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index dc87a9e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -geopy -magic - -# optional if you want caching -dill diff --git a/run b/run deleted file mode 100755 index e3c3878..0000000 --- a/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -eu -python3 -m photos diff --git a/update_cache b/update_cache deleted file mode 100755 index 6daf62c..0000000 --- a/update_cache +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -eu - -cd "$(dirname "$0")" - -python3 -m photos update_cache -