Merge branch 'master' of git.swftools.org:/home/git/swftools-internal
[swftools.git] / wx / gpdf2swf.py
blob44628845cfda852227bdd1497e0c2d6242541986
1 #!/usr/bin/env python
2 # -*- coding: UTF-8 -*-
4 # gpdf2swf.py
5 # graphical user interface for pdf2swf
7 # Part of the swftools package.
8 #
9 # Copyright (c) 2008,2009 Matthias Kramm <kramm@quiss.org>
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
25 from __future__ import division
26 import __builtin__
27 import os
28 import sys
29 #import imp
31 #def main_is_frozen():
32 # return (hasattr(sys, "frozen") or # new py2exe
33 # hasattr(sys, "importers") # old py2exe
34 # or imp.is_frozen("__main__")) # tools/freeze
36 ##if not main_is_frozen():
37 ## try:
38 ## import wxversion
39 ## wxversion.select("2.6")
40 ## except:
41 ## wxversion.select("2.8")
43 #def get_main_dir():
44 # if main_is_frozen():
45 # return os.path.dirname(sys.executable)
46 # return os.path.dirname(os.path.abspath(__file__))
47 #__builtin__.get_main_dir = get_main_dir
48 #__builtin__.GPDF2SWF_BASEDIR = get_main_dir()
50 #pyver = "".join(map(str, sys.version_info[0:2]))
51 ##print >>sys.stderr, pyver
52 #if main_is_frozen():
53 # sys.path.insert(0, os.path.join("..", "python%s" % pyver))
54 #else:
55 # sys.path.insert(0, os.path.join("..", "lib", "python"))
56 # sys.path.insert(1, os.path.join("..", "python%s" % pyver))
58 import wx
59 #print >>sys.stderr, wx.VERSION
60 from lib.app import Pdf2Swf
62 __builtin__.GPDF2SWF_BASEDIR = os.path.dirname(os.path.abspath(sys.argv[0]))
64 if __name__ == "__main__":
65 #print "sys.argv[0]", sys.argv[0]
66 #print "abspath sys.argv[0]",
67 #print "sys.executable", sys.executable
68 #print "abspath sys.executable", os.path.abspath(sys.executable)
69 #print "GPDF2SWF_BASEDIR", GPDF2SWF_BASEDIR
70 app = wx.App(False)
71 app.SetAppName(u"gpdf2swf")
72 Pdf2Swf()
73 app.MainLoop()