changeset 11:292e064396e4 traipse_dev

Cleans up the two handlers and removes old code. Should be prod. level now. Build Number.
author sirebral
date Fri, 17 Jul 2009 08:34:18 -0500
parents 73d9286c22cf
children c056e967907a
files orpg/mapper/background_handler.py orpg/mapper/miniatures_handler.py orpg/orpg_version.py
diffstat 3 files changed, 20 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/mapper/background_handler.py	Fri Jul 17 08:13:50 2009 -0500
+++ b/orpg/mapper/background_handler.py	Fri Jul 17 08:34:18 2009 -0500
@@ -32,7 +32,7 @@
 from background import *
 from base_handler import *
 import mimetypes
-
+import os
 from base import *
 
 class background_handler(base_layer_handler):
@@ -83,14 +83,18 @@
                     min_url = open_rpg.get_component("cherrypy") + filename
                 except:
                     return
-                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Textures' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Textures': url = self.settings.get_setting('LocalImageBaseURL') + 'Textures/'
-                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Maps' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Maps': url = self.settings.get_setting('LocalImageBaseURL') + 'Maps/'
-                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Miniatures' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Miniatures': url = self.settings.get_setting('LocalImageBaseURL') + 'Miniatures/'
-                path = url + filename
+                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Textures': 
+                    min_url = open_rpg.get_component("cherrypy") + 'Textures/' + filename
+                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Maps': 
+                    min_url = open_rpg.get_component("cherrypy") + 'Maps/' + filename
+                if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Miniatures': 
+                    min_url = open_rpg.get_component("cherrypy") + 'Miniatures/' + filename
+                print min_url
+
                 if self.bg_type.GetStringSelection() == 'Texture':
-                    self.canvas.layers['bg'].set_texture(path)
+                    self.canvas.layers['bg'].set_texture(str(min_url))
                 elif self.bg_type.GetStringSelection() == 'Image':
-                    self.size = self.canvas.layers['bg'].set_image(path,1)
+                    self.size = self.canvas.layers['bg'].set_image(str(min_url),1)
                 self.update_info()
                 self.canvas.send_map_data()
                 self.canvas.Refresh(False)
--- a/orpg/mapper/miniatures_handler.py	Fri Jul 17 08:13:50 2009 -0500
+++ b/orpg/mapper/miniatures_handler.py	Fri Jul 17 08:34:18 2009 -0500
@@ -38,6 +38,7 @@
 from grid import GRID_RECTANGLE
 from grid import GRID_HEXAGON
 from grid import GRID_ISOMETRIC
+import os
 
 LABEL_TOOL = wx.NewId()
 LAYER_TOOL = wx.NewId()
@@ -164,9 +165,13 @@
                 min_url = open_rpg.get_component("cherrypy") + filename
             except:
                 return
-            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Textures' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Textures': min_url = self.settings.get_setting('LocalImageBaseURL') + 'Textures/' + filename
-            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Maps' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Maps': min_url = self.settings.get_setting('ImageServerBaseURL') + 'Maps/' + filename
-            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles/Miniatures' or dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles\Miniatures': min_url = self.settings.get_setting('LocalImageBaseURL') + 'Miniatures/' + filename
+            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep +' Textures': 
+                min_url = open_rpg.get_component("cherrypy") + 'Textures/' + filename
+            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Maps': 
+                min_url = open_rpg.get_component("cherrypy") + 'Maps/' + filename
+            if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Miniatures': 
+                min_url = open_rpg.get_component("cherrypy") + 'Miniatures/' + filename
+
             # build url
             if min_url == "" or min_url == "http://":
                 return
--- a/orpg/orpg_version.py	Fri Jul 17 08:13:50 2009 -0500
+++ b/orpg/orpg_version.py	Fri Jul 17 08:34:18 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Dev"
 DIS_VER = "Grumpy Goblin"
-BUILD = "090717-00"
+BUILD = "090717-02"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"