comparison scripts/skaapsteker @ 580:b7c432ce1b80

Project against absences of __file__.
author Simon Cross <hodgestar@gmail.com>
date Sun, 10 Apr 2011 15:06:50 +0200
parents 6f1e43d2fda8
children
comparison
equal deleted inserted replaced
579:e4242abff401 580:b7c432ce1b80
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import os.path 3 import os.path
4 import sys 4 import sys
5 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) 5
6 if '__file__' in globals():
7 # protect against missing __file__ in Windows executable scripts
8 # (in these cases, assume skaapsteker is already on the path)
9 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
6 10
7 import skaapsteker.__main__ 11 import skaapsteker.__main__
8 if __name__ == "__main__": 12 if __name__ == "__main__":
9 skaapsteker.__main__.main() 13 skaapsteker.__main__.main()
10 14