Mercurial > fife-parpg
annotate clients/editor/run.py @ 374:1115f7cae9a3
Editor:
* The editor will now force filenames to be lowercase, as VFS does not like uppercase path names.
* If a map filename does not have a .xml extension on save, it will be automatically added.
* Log modules set to "all" by default. Only new users will be affected by this without having to modify or remove their configuration file.
* Log level set to LOGLEVEL_WARN
author | cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 21 Nov 2009 13:11:56 +0000 |
parents | 8b125ec749d7 |
children |
rev | line source |
---|---|
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
1 #!/usr/bin/env python |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
2 # -*- coding: utf-8 -*- |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
3 |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
4 # #################################################################### |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
5 # Copyright (C) 2005-2009 by the FIFE team |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
6 # http://www.fifengine.de |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
7 # This file is part of FIFE. |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
8 # |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
9 # FIFE is free software; you can redistribute it and/or |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
10 # modify it under the terms of the GNU Lesser General Public |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
11 # License as published by the Free Software Foundation; either |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
12 # version 2.1 of the License, or (at your option) any later version. |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
13 # |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
14 # This library is distributed in the hope that it will be useful, |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
17 # Lesser General Public License for more details. |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
18 # |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
19 # You should have received a copy of the GNU Lesser General Public |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
20 # License along with this library; if not, write to the |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
21 # Free Software Foundation, Inc., |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
23 # #################################################################### |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
24 |
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
25 import sys, os, re |
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
26 |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
27 # Additional directories for module search path |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
28 _paths = ('.', '../../engine/swigwrappers/python', '../../engine/extensions') |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
29 |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
30 def _joinPath(path): |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
31 """ Insert correct separators """ |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
32 return os.sep.join(path.split('/')) |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
33 |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
34 def _setupPaths(): |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
35 """ Add _paths to module search path """ |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
36 for p in _paths: |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
37 if p not in sys.path: |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
38 sys.path.append(_joinPath(p)) |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
39 |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
40 #--- Main function ---# |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
41 if __name__ == '__main__': |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
42 _setupPaths() |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
43 |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
44 # Get command line arguments |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
45 params = None |
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
46 if len(sys.argv) > 1: |
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
47 params = sys.argv[1] |
355
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
48 |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
49 # Start editor |
8b125ec749d7
Started cleaning up the editor source code:
cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
255
diff
changeset
|
50 from scripts.editor import Editor |
0
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
51 app = Editor(params) |
4a0efb7baf70
* Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
52 app.run() |