Mercurial > skaapsteker
annotate 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 |
rev | line source |
---|---|
0 | 1 #!/usr/bin/env python |
2 | |
29 | 3 import os.path |
4 import sys | |
580
b7c432ce1b80
Project against absences of __file__.
Simon Cross <hodgestar@gmail.com>
parents:
31
diff
changeset
|
5 |
b7c432ce1b80
Project against absences of __file__.
Simon Cross <hodgestar@gmail.com>
parents:
31
diff
changeset
|
6 if '__file__' in globals(): |
b7c432ce1b80
Project against absences of __file__.
Simon Cross <hodgestar@gmail.com>
parents:
31
diff
changeset
|
7 # protect against missing __file__ in Windows executable scripts |
b7c432ce1b80
Project against absences of __file__.
Simon Cross <hodgestar@gmail.com>
parents:
31
diff
changeset
|
8 # (in these cases, assume skaapsteker is already on the path) |
b7c432ce1b80
Project against absences of __file__.
Simon Cross <hodgestar@gmail.com>
parents:
31
diff
changeset
|
9 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) |
29 | 10 |
0 | 11 import skaapsteker.__main__ |
12 if __name__ == "__main__": | |
13 skaapsteker.__main__.main() | |
14 |