diff orpg/mapper/miniatures_handler.py @ 10:73d9286c22cf traipse_dev

Adds some superb CherryPy features! Components can be deleted now too!
author sirebral
date Fri, 17 Jul 2009 08:13:50 -0500
parents 2b9e766f9dee
children 292e064396e4
line wrap: on
line diff
--- a/orpg/mapper/miniatures_handler.py	Fri Jul 17 01:27:26 2009 -0500
+++ b/orpg/mapper/miniatures_handler.py	Fri Jul 17 08:13:50 2009 -0500
@@ -38,6 +38,7 @@
 from grid import GRID_RECTANGLE
 from grid import GRID_HEXAGON
 from grid import GRID_ISOMETRIC
+
 LABEL_TOOL = wx.NewId()
 LAYER_TOOL = wx.NewId()
 MIN_LIST_TOOL = wx.NewId()
@@ -159,7 +160,10 @@
             y = dc.DeviceToLogicalY(0)
             thread.start_new_thread(self.canvas.layers['miniatures'].upload, (postdata, dlg.GetPath()), {'pos':cmpPoint(x,y)})
         else:
-            min_url = self.settings.get_setting('LocalImageBaseURL') + filename
+            try:
+                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