Mercurial > sypikslang
changeset 160:7eead0d85497
Improve launcher script
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 11 May 2012 22:26:39 +0200 |
parents | f1efd252e8b0 |
children | 6fdc985429a7 |
files | scripts/sypikslang |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/sypikslang Fri May 11 22:14:02 2012 +0200 +++ b/scripts/sypikslang Fri May 11 22:26:39 2012 +0200 @@ -1,4 +1,14 @@ #! /usr/bin/env python +import sys +import os.path + + +if '__file__' in globals(): + # Add ourselves to the path. + # We protect against missing __file__ in Windows executable scripts + # (in these cases, assume we are already on the path) + sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) + from gamelib import main main.main()