Mercurial > traipse_dev
comparison orpg/dirpath/__init__.py @ 14:0b8b7e3ed78d traipse_dev
Adding fixes from OpenRPG 1.8.0
Includes GUI patch for Linux users, init2 plugin, cherrypy XML refrence
Completely removes approot from the startup process and creates a software
cleanup process as well.
author | sirebral |
---|---|
date | Mon, 20 Jul 2009 21:25:13 -0500 |
parents | 4385a7d0efd1 |
children | bf799efe7a8a |
comparison
equal
deleted
inserted
replaced
13:3add6bbc3a56 | 14:0b8b7e3ed78d |
---|---|
9 # CHANGE LOG | 9 # CHANGE LOG |
10 # ----------------------------- | 10 # ----------------------------- |
11 # * Reworked path verification process to attempt to fall back on the | 11 # * Reworked path verification process to attempt to fall back on the |
12 # current working directory if approot fails to verify before | 12 # current working directory if approot fails to verify before |
13 # asking the user to locate the root directory -- Snowdog 12-20-05 | 13 # asking the user to locate the root directory -- Snowdog 12-20-05 |
14 # ----------------------------- | |
15 # * Removed reference to approot. It was a superflous creation that carried an object | |
16 # that dirpath_tools already creates. It wasted system resources by creating a files | |
17 # and by referencing a file to fill an object that was already created. -- SirEbral 07-19-09 | |
14 | 18 |
15 import sys | 19 import sys |
16 import os | 20 import os |
17 from dirpath_tools import * | 21 from dirpath_tools import * |
18 | 22 |
19 root_dir = None | 23 root_dir = None |
20 | 24 |
21 try: | 25 t = __file__.split(os.sep) |
22 import approot | 26 if len(t) > 2: |
23 root_dir = approot.basedir | 27 root_dir = os.sep.join(t[:-3]) |
24 except: | 28 else: |
25 #attempt to load default path | 29 root_dir = os.getcwd() #default ORPG root dir |
26 t = __file__.split(os.sep) | |
27 if len(t) > 2: | |
28 root_dir = os.sep.join(t[:-3]) | |
29 else: | |
30 root_dir = os.getcwd() #default ORPG root dir | |
31 | 30 |
32 dir_struct = {} | 31 dir_struct = {} |
33 | 32 |
34 if not verify_home_path(root_dir): | 33 if not verify_home_path(root_dir): |
35 root_dir = os.getcwd() | 34 root_dir = os.getcwd() |