updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / tiddlywiki / tiddlywiki.py
blobdc92b82df85bf80eaa4087c0f1e733ea4354f430
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # Alexander Rødseth <rodseth@gmail.com>
4 # BSD license
5 # 24032009
6 # 28022011
8 from sys import argv
9 from os.path import join, exists
10 from os import mkdir, system, environ
12 def main():
13 arguments = argv[1:]
14 if arguments:
15 where = arguments[0]
16 else:
17 where = join(environ['HOME'], '.tiddlywiki')
18 goal = join(where, 'index.html')
19 if not exists(where):
20 mkdir(where)
21 system('cp /usr/share/tiddlywiki/empty.html %s' % (goal))
22 if environ['BROWSER']:
23 system(environ['BROWSER'] + " " + goal)
24 else:
25 system("/usr/bin/gnome-open " + goal)
27 if __name__ == "__main__":
28 main()