diff orpg/dirpath/dirpath_tools.py @ 65:4840657c23c5 ornery-dev

Traipse Dev 'OpenRPG' {090817-02} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: Update to Settings Menu. When user changes font or font size the chat window will now update without needing a restart. Change to dirpath/dir_struct file. No longer creates OPENRPG_BASE environment key.
author sirebral
date Mon, 17 Aug 2009 06:56:31 -0500
parents 0b8b7e3ed78d
children bf799efe7a8a
line wrap: on
line diff
--- a/orpg/dirpath/dirpath_tools.py	Mon Aug 17 04:49:17 2009 -0500
+++ b/orpg/dirpath/dirpath_tools.py	Mon Aug 17 06:56:31 2009 -0500
@@ -8,7 +8,6 @@
         def OnInit(self):
             return True
 
-
 #-------------------------------------------------------
 # void load_paths( dir_struct_reference )
 # moved structure loading from dirpath.py by Snowdog 3-8-05
@@ -27,10 +26,8 @@
     dir_struct["nodes"] = dir_struct["template"] + "nodes" + os.sep
     dir_struct["rollers"] = dir_struct["core"] + "dieroller" + os.sep + "rollers" + os.sep
 
-
-    _userbase_dir = _userbase_dir = os.environ['OPENRPG_BASE']
-    _user_dir = _userbase_dir + os.sep + "myfiles" + os.sep
-
+    _userbase_dir = dir_struct["home"]
+    _user_dir = dir_struct["home"] + "myfiles" + os.sep
 
     try:
         os.makedirs(_user_dir)
@@ -38,15 +35,11 @@
         os.makedirs(_user_dir + "logs" + os.sep);
         os.makedirs(_user_dir + "webfiles" + os.sep);
     except OSError, e:
-        if e.errno != errno.EEXIST:
-            raise
+        if e.errno != errno.EEXIST: raise
 
     dir_struct["user"] = _user_dir
-
     dir_struct["logs"] = dir_struct["user"] + "logs" + os.sep
 
-
-
 #-------------------------------------------------------
 # int verify_home_path( directory_name )
 # added by Snowdog 3-8-05
@@ -55,21 +48,18 @@
 def verify_home_path( path ):
     """checks for key ORPG files in the openrpg tree
        and askes for user intervention if their is a problem"""
-
     try:
         #verify that the root dir (as supplied) exists
         if not verify_file(path): return 0
-
+
         #These checks require that 'path' have a separator at the end.
         #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 = ["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
         # bail out with error signal
@@ -78,8 +68,6 @@
     #all files and directories exist.
     return 1
 
-
-
 #-------------------------------------------------------
 # int verify_file( absolute_path )
 # added by Snowdog 3-8-05
@@ -98,7 +86,8 @@
 # pathname get_user_help()
 # added by Snowdog 3-8-05
 # bug fix (SF #1242456) and updated with bailout code. Snowdog 7-25-05
-#-------------------------------------------------------
+#-------------------------------------------------------
+## This can be removed in the future. TaS '09
 def get_user_located_root():
     """Notify the user of directory problems
     and show directory selection dialog """
@@ -106,16 +95,15 @@
     if WXLOADED:
         app = tmpApp(0)
         app.MainLoop()
-
+
         dir = None
-
         try:
             msg = "OpenRPG cannot locate critical files.\nPlease locate the /System/ 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)
+            dlg = wx.DirDialog(None, "Locate the System directory:",style=wx.DD_DEFAULT_STYLE)
             if dlg.ShowModal() == wx.ID_OK:
                 dir = dlg.GetPath()
             dlg.Destroy()