trying on production (my real dir :-))
[pauldeden-misc.git] / mindmaps
blob87a778e87ed06af811577dc9d59a5b8029349e31
1 #!/usr/bin/python
2 #
3 # Author: Paul D. Eden <paul@benchline.org>
4 # Distributed under the terms of the Gnu public license version 2
5 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6 #
7 # Simple script to keep track of my mindmaps
8 # stores to a local git repo and syncs with Amazon S3
10 import os
11 import sys
12 import subprocess
14 HOME = os.environ["HOME"]
16 def run(cmd):
17 subprocess.check_call(cmd, shell=True)
19 def runbool(cmd):
20 ret = subprocess.call(cmd, shell=True)
21 return ret == 0
23 def pull_mindmaps():
24 os.chdir("%s/Desktop/mm" % HOME)
25 run("s3git pull")
27 def push_mindmaps(sync_w_s3=True):
28 os.chdir("%s/Desktop/mm" % HOME)
29 run("s3git push")
31 if __name__ == "__main__":
32 if len(sys.argv) > 1:
33 if sys.argv[1] == "pull":
34 pull_mindmaps()
35 sys.exit(0)
36 push_mindmaps()