-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinfo.py
175 lines (144 loc) · 6.24 KB
/
info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import os,sys
PLATFORM = sys.platform
WIN = PLATFORM.startswith('win')
DARWIN = PLATFORM.startswith('darwin')
LINUX = not (WIN or DARWIN)
if WIN:
windowsVer = sys.getwindowsversion()
if (windowsVer[3] == 1 ):
WIN98 = True
else:
WIN98 = False
else:
WIN98 = False
PYTHON_EXEC = sys.executable
if WIN:
if PYTHON_EXEC.endswith('w.exe'):
PYTHON_EXEC = PYTHON_EXEC[:-5] + '.exe'
try:
import win32api
PYTHON_EXEC = win32api.GetShortPathName(PYTHON_EXEC)
PYTHON_COM = True
except ImportError:
PYTHON_EXEC = (r'%s'%PYTHON_EXEC).replace('Program Files','progra~1')
PYTHON_COM = False
if ' ' in PYTHON_EXEC:
PYTHON_EXEC = '"%s"'%PYTHON_EXEC
elif DARWIN:
pythonw = PYTHON_EXEC.replace('ython','ythonw')
if os.path.exists(pythonw):
PYTHON_EXEC = pythonw
PYTHON_COM = False
else:
PYTHON_COM = False
PATH = os.path.dirname(__file__)
_PATH = os.path.dirname(PATH)
def path(p):
if (WIN or LINUX) and ' ' in p:
return '"%s"'%p
else:
return p
#---Append sm
if PATH not in sys.path:
sys.path.insert(0,PATH)
if _PATH not in sys.path:
sys.path.insert(0,_PATH)
import sm.osx
INFO={
'author' : "www.stani.be",
'author_email' : '[email protected]',
'blenderVersion' : "2.35",
'date' : "27-10-2005",
'donate' : "If you enjoy SPE, consider a (small) donation.",
'doc' : "%(titleFull)s\n\n%(description)s\n\n%(links)s\n\n%(requirements)s\n\n%(copyright)s",
'forums' : '',
'license' : 'GPL',
'location' : PATH,
'pyVersion' : "2.3",
'pyVersionC' : sys.version.split(' ')[0],
'scripts' : ['spe','spe_wininst.py'],
'skinLocation' : os.path.join(PATH,'skins','default'),
'smLocation' : os.path.join(PATH,'sm'),
'title' : "SPE",
'url' : 'http://pythonide.stani.be',
'userPath' : sm.osx.userPath('.spe'),
'version' : "0.8.4.i",
'wxVersion' : "2.6.1.0.",
}
INFO['defaults'] = os.path.join(INFO['location'],'defaults.cfg')
INFO['defaultsUser'] = os.path.join(INFO['userPath'],'defaults.cfg')
INFO['defaultWorkspace'] = os.path.join(INFO['userPath'],'defaults.sws')
INFO['titleFull'] = "%(title)s %(version)s"%INFO
if DARWIN:
INFO['python'] = 'pythonw'
else:
INFO['python'] = 'python'
INFO['links'] =\
"""Homepage : %s
Donwloads: http://www.stani.be/python/spe/page_blender
Forum : http://www.stani.be/python/spe/page_forum
Lists : http://www.stani.be/python/spe/page_mailman"""%INFO['url']
INFO['description'] =\
"""Stani's Python Editor
Spe is a python IDE with auto-indentation, auto completion, call tips, syntax
coloring, syntax highlighting, class explorer, source index, auto todo list,
sticky notes, integrated pycrust shell, python file browser, recent file
browser, drag&drop, context help, ... Special is its blender support with a
blender 3d object browser and its ability to run interactively inside blender.
Spe is extensible with boa.
Wanted: wxpython programmers to extend spe's features, feel free to do a proposal.
For more information, see spe/doc/manual.html"""%INFO
INFO['requirements'] =\
"""Python v%(pyVersion)s required
wxPython v%(wxVersion)s required
Blender v%(blenderVersion)s optional"""%INFO
INFO['copyright'] =\
"""Copyright (C)%(author)s (%(date)s)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""%INFO
INFO['contribute'] = """There are different ways to contribute:
- %s (or convince your boss)
- Let your company sponsor SPE (see manual)
- SPE needs documentation writers and screenshot takers for manual
- Contribute code (eg wxPython panels) & patches
- Promote SPE in newsgroups, press, blogs, ...
- Subscribe to mailing lists
- Translate manual
- Report bugs in the bug tracker"""%INFO['donate']
WILDCARD = "Python (*.py;*.pyw;*.tpy)|*.py;*.pyw;*.tpy|Backup files (*.bak)|*.bak|All files (*)|*"
WORKSPACE_WILDCARD = "SPE Workspace (*.sws)|*.sws|All files (*)|*"
WILDCARD_EXTENDED = WILDCARD+'|Python All(*.py;*.pyw;*.tpy;*.pyc;*.pyd;*.pyo)|*.py;*.pyw;*.tpy;*.pyc;*.pyd;*.pyo|Text (*.txt;*.rtf;*.htm;*.html;*.pdf;*.cfg)|*.txt;*.rtf;*.htm;*.html;*.pdf;*.cfg|Bitmap (*.jpg;*.jpeg;*.bmp;*.tif;*.tiff;*.png;*.pic)|*.jpg;*.jpeg;*.bmp;*.tif;*.tiff;*.png;*.pic|Vector (*.dxf;*.dwg;*.svg;*.swf;*.vrml;*.wrl)|*.dxf;*.dwg;*.svg;*.swf;*.vrml;*.wrl'
__doc__=INFO['doc']%INFO
def copy():
return INFO.copy()
def dirname(fileName):
fileName = os.path.dirname(fileName)
if PYTHON_COM:
return win32api.GetShortPathName(fileName)
else:
return fileName
def imageFile(fileName):
return os.path.join(INFO['skinLocation'],fileName)
#---wx
try:
import wx
INFO['wxVersionC'] = wx.VERSION_STRING
## if INFO['wxVersionC']!=INFO['wxVersion']:
## print '\nSpe Warning: Spe was developped on wxPython v%s, but v%s was found.'%(INFO['wxVersion'],INFO['wxVersionC'])
## print 'If you experience any problems please install wxPython v%s\n'%INFO['wxVersion']
INFO['encoding'] = wx.GetDefaultPyEncoding()
WX_ERROR = False
except ImportError, message:
print "Spe Error: Please install the right version of wxPython: %s"%INFO['wxVersion']
print message
WX_ERROR = True