From: Digital X. <dig...@us...> - 2007-04-04 01:15:20
|
Update of /cvsroot/openrpg/openrpg1/orpg/dirpath In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9279/orpg/dirpath Modified Files: Tag: BRANCH-1-7-1 dirpath_tools.py Log Message: Made it so the dirpath_tools did not require wxPython Index: dirpath_tools.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/dirpath/dirpath_tools.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** dirpath_tools.py 18 Oct 2006 21:50:11 -0000 1.13 --- dirpath_tools.py 4 Apr 2007 01:15:20 -0000 1.13.2.1 *************** *** 4,10 **** from orpg.orpg_wx import * ! class tmpApp(wx.App): ! def OnInit(self): ! return True --- 4,11 ---- from orpg.orpg_wx import * ! if WXLOADED: ! class tmpApp(wx.App): ! def OnInit(self): ! return True *************** *** 70,84 **** #Check and temporarily add one if needed if (path[(len(path)-len(os.sep)):] != os.sep): ! path=path+os.sep # These files should always exist at the root orpg dir ! check_files=["start.py","platform.py","pyver.py"] for n in range(len(check_files)): ! if not verify_file(path+check_files[n]): return 0 - # These directories should always exist at the root orpg dir - check_dirs=["orpg","data","images"] - for n in range(len(check_dirs)): - if not verify_file(path+check_dirs[n]): return 0 except: # an error occured while verifying the directory structure --- 71,81 ---- #Check and temporarily add one if needed if (path[(len(path)-len(os.sep)):] != os.sep): ! path = path + os.sep # These files should always exist at the root orpg dir ! check_files = ["start.py","platform.py","pyver.py", "orpg","data","images"] for n in range(len(check_files)): ! if not verify_file(path + check_files[n]): return 0 except: # an error occured while verifying the directory structure *************** *** 115,139 **** and show directory selection dialog """ ! app = tmpApp(0) ! app.MainLoop() ! dir = None ! try: ! msg = "OpenRPG cannot locate critical files.\nPlease locate the openrpg1 directory in the following window" ! alert= wx.MessageDialog(None,msg,"Warning",wx.OK|wx.ICON_ERROR) ! alert.Show() ! if alert.ShowModal() == wx.OK: ! alert.Destroy() ! dlg = wx.DirDialog(None, "Locate the openrpg1 directory:",style=wx.DD_DEFAULT_STYLE) ! if dlg.ShowModal() == wx.ID_OK: ! dir = dlg.GetPath() ! dlg.Destroy() ! app.Destroy() return dir - except Exception, e: - print e - print "OpenRPG encountered a problem while attempting to load file dialog to locate the OpenRPG root directory." - print "please delete the files ./openrpg/orpg/dirpath/aproot.py and ./openrpg/orpg/dirpath/aproot.pyc and try again." --- 112,140 ---- and show directory selection dialog """ ! if WXLOADED: ! app = tmpApp(0) ! app.MainLoop() ! dir = None ! try: ! msg = "OpenRPG cannot locate critical files.\nPlease locate the openrpg1 directory in the following window" ! alert= wx.MessageDialog(None,msg,"Warning",wx.OK|wx.ICON_ERROR) ! alert.Show() ! if alert.ShowModal() == wx.OK: ! alert.Destroy() ! dlg = wx.DirDialog(None, "Locate the openrpg1 directory:",style=wx.DD_DEFAULT_STYLE) ! if dlg.ShowModal() == wx.ID_OK: ! dir = dlg.GetPath() ! dlg.Destroy() ! app.Destroy() ! return dir ! except Exception, e: ! print e ! print "OpenRPG encountered a problem while attempting to load file dialog to locate the OpenRPG root directory." ! print "please delete the files ./openrpg/orpg/dirpath/aproot.py and ./openrpg/orpg/dirpath/aproot.pyc and try again." ! else: ! dir = raw_input("Enter the full path to your openrpg folder: ") return dir *************** *** 149,156 **** if (orpg_root_path[(len(orpg_root_path)-len(os.sep)):] == os.sep): orpg_root_path = orpg_root_path[:(len(orpg_root_path)-len(os.sep))] ! fn = orpg_root_path+os.sep+"orpg"+os.sep+"dirpath"+os.sep+"approot.py" ! f = open( fn, "w") #trim off the appended os.sep character(s) to avoid duplicating them on re-loading of path ! code="basedir = \""+orpg_root_path+"\"\n" #fix path string for windows boxes that lamely use an escape character for a path separator code = str.replace(code,'\\','\\\\') --- 150,157 ---- if (orpg_root_path[(len(orpg_root_path)-len(os.sep)):] == os.sep): orpg_root_path = orpg_root_path[:(len(orpg_root_path)-len(os.sep))] ! fn = orpg_root_path + os.sep + "orpg" + os.sep + "dirpath" + os.sep + "approot.py" ! f = open(fn, "w") #trim off the appended os.sep character(s) to avoid duplicating them on re-loading of path ! code = 'basedir = "' + orpg_root_path + '"' + "\n" #fix path string for windows boxes that lamely use an escape character for a path separator code = str.replace(code,'\\','\\\\') |