about summary refs log tree commit diff
path: root/zachwalk.py
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-02-06 23:40:43 -0500
committerZach DeCook <zachdecook@librem.one>2021-02-06 23:40:43 -0500
commita77672feb90517865f0c2bf9a85482176881635c (patch)
tree553c024d7531ef77f3c3b6a200f98914d7d56114 /zachwalk.py
parentfb1a7fc2b547f5736166e431f63cd95692fe2eb6 (diff)
downloadzachwalk-a77672feb90517865f0c2bf9a85482176881635c.tar.gz
zachwalk: separate main function
Diffstat (limited to 'zachwalk.py')
-rwxr-xr-xzachwalk.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/zachwalk.py b/zachwalk.py
index ad16746..9584cef 100755
--- a/zachwalk.py
+++ b/zachwalk.py
@@ -32,7 +32,8 @@ def getnewestdate(url):
         pass
     return '1970-01-01'
 
-with open(sys.argv[1]) as f:
+def main(argv):
+  with open(argv[1]) as f:
     for line in f:
         if line[0:2] == '=>':
             # plz don't use multiple spaces.
@@ -40,3 +41,6 @@ with open(sys.argv[1]) as f:
             desc = line[3+len(url):].strip()
             newestdate = getnewestdate(url)
             print(f'=> {url} {newestdate} - {desc}')
+
+if __name__ == '__main__':
+  main(sys.argv)