diff options
author | Paweł Jastrzębski <pawelj@iosphe.re> | 2015-10-02 20:01:21 +0200 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@iosphe.re> | 2015-10-02 20:01:21 +0200 |
commit | f93ced8939ba88d91e0974d1f30374fc88c4973a (patch) | |
tree | af66f6509381383e209bf94275908de52705a246 /kcc.py | |
parent | Binary blob cleanup (diff) | |
download | kcc-f93ced8939ba88d91e0974d1f30374fc88c4973a.tar.gz kcc-f93ced8939ba88d91e0974d1f30374fc88c4973a.tar.bz2 kcc-f93ced8939ba88d91e0974d1f30374fc88c4973a.zip |
Migrated to PyInstaller
Diffstat (limited to 'kcc.py')
-rwxr-xr-x | kcc.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/kcc.py b/kcc.py index d5238b0..220f5db 100755 --- a/kcc.py +++ b/kcc.py @@ -26,24 +26,16 @@ if sys.version_info[0] != 3: # OS specific PATH variable workarounds import os if sys.platform.startswith('darwin'): - if 'RESOURCEPATH' not in os.environ: - os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/osx/:' + os.environ['PATH'] - else: - os.environ['PATH'] = './../Resources:/usr/local/bin:/usr/bin:/bin' + if getattr(sys, 'frozen', False): + os.environ['PATH'] = os.path.dirname(os.path.abspath(sys.executable)) + \ + '/../Resources:/usr/local/bin:/usr/bin:/bin' os.system('defaults write com.kindlecomicconverter.KindleComicConverter ApplePersistenceIgnoreState YES') + os.system('defaults write com.kindlecomicconverter.KindleComicConverter NSInitialToolTipDelay -int 1000') + else: + os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/osx/:' + os.environ['PATH'] elif sys.platform.startswith('win'): if getattr(sys, 'frozen', False): os.chdir(os.path.dirname(os.path.abspath(sys.executable))) - - # Implementing dummy stdout and stderr for frozen Windows release - class FakeSTD(object): - def write(self, string): - pass - - def flush(self): - pass - sys.stdout = FakeSTD() - sys.stderr = FakeSTD() else: os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/windows/;' + os.environ['PATH'] os.chdir(os.path.dirname(os.path.abspath(__file__))) |