comparison 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
comparison
equal deleted inserted replaced
9:c97c641a76fd 10:73d9286c22cf
36 import xml.dom.minidom as minidom 36 import xml.dom.minidom as minidom
37 import wx 37 import wx
38 from grid import GRID_RECTANGLE 38 from grid import GRID_RECTANGLE
39 from grid import GRID_HEXAGON 39 from grid import GRID_HEXAGON
40 from grid import GRID_ISOMETRIC 40 from grid import GRID_ISOMETRIC
41
41 LABEL_TOOL = wx.NewId() 42 LABEL_TOOL = wx.NewId()
42 LAYER_TOOL = wx.NewId() 43 LAYER_TOOL = wx.NewId()
43 MIN_LIST_TOOL = wx.NewId() 44 MIN_LIST_TOOL = wx.NewId()
44 MIN_TOOL = wx.NewId() 45 MIN_TOOL = wx.NewId()
45 MIN_URL = wx.NewId() 46 MIN_URL = wx.NewId()
157 dc.SetUserScale(self.canvas.layers['grid'].mapscale,self.canvas.layers['grid'].mapscale) 158 dc.SetUserScale(self.canvas.layers['grid'].mapscale,self.canvas.layers['grid'].mapscale)
158 x = dc.DeviceToLogicalX(0) 159 x = dc.DeviceToLogicalX(0)
159 y = dc.DeviceToLogicalY(0) 160 y = dc.DeviceToLogicalY(0)
160 thread.start_new_thread(self.canvas.layers['miniatures'].upload, (postdata, dlg.GetPath()), {'pos':cmpPoint(x,y)}) 161 thread.start_new_thread(self.canvas.layers['miniatures'].upload, (postdata, dlg.GetPath()), {'pos':cmpPoint(x,y)})
161 else: 162 else:
162 min_url = self.settings.get_setting('LocalImageBaseURL') + filename 163 try:
164 min_url = open_rpg.get_component("cherrypy") + filename
165 except:
166 return
163 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 167 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
164 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 168 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
165 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 169 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
166 # build url 170 # build url
167 if min_url == "" or min_url == "http://": 171 if min_url == "" or min_url == "http://":