comparison orpg/dirpath/__init__.py @ 10:5df1340bda13 grumpy-goblin

Big patch! Linux GUI, Fetching Dict., Init2, Streaming lining.
author sirebral
date Tue, 21 Jul 2009 17:19:53 -0500
parents 4385a7d0efd1
children ff154cf3350c
comparison
equal deleted inserted replaced
9:80ab434efc87 10:5df1340bda13
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()