comparison orpg/mapper/background_handler.py @ 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
comparison
equal deleted inserted replaced
10:73d9286c22cf 11:292e064396e4
30 import thread 30 import thread
31 from threading import Lock 31 from threading import Lock
32 from background import * 32 from background import *
33 from base_handler import * 33 from base_handler import *
34 import mimetypes 34 import mimetypes
35 35 import os
36 from base import * 36 from base import *
37 37
38 class background_handler(base_layer_handler): 38 class background_handler(base_layer_handler):
39 def __init__(self, parent, id, canvas): 39 def __init__(self, parent, id, canvas):
40 base_layer_handler.__init__(self, parent, id, canvas) 40 base_layer_handler.__init__(self, parent, id, canvas)
81 else: 81 else:
82 try: 82 try:
83 min_url = open_rpg.get_component("cherrypy") + filename 83 min_url = open_rpg.get_component("cherrypy") + filename
84 except: 84 except:
85 return 85 return
86 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/' 86 if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Textures':
87 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/' 87 min_url = open_rpg.get_component("cherrypy") + 'Textures/' + filename
88 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/' 88 if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Maps':
89 path = url + filename 89 min_url = open_rpg.get_component("cherrypy") + 'Maps/' + filename
90 if dlg.GetDirectory() == orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep + 'Miniatures':
91 min_url = open_rpg.get_component("cherrypy") + 'Miniatures/' + filename
92 print min_url
93
90 if self.bg_type.GetStringSelection() == 'Texture': 94 if self.bg_type.GetStringSelection() == 'Texture':
91 self.canvas.layers['bg'].set_texture(path) 95 self.canvas.layers['bg'].set_texture(str(min_url))
92 elif self.bg_type.GetStringSelection() == 'Image': 96 elif self.bg_type.GetStringSelection() == 'Image':
93 self.size = self.canvas.layers['bg'].set_image(path,1) 97 self.size = self.canvas.layers['bg'].set_image(str(min_url),1)
94 self.update_info() 98 self.update_info()
95 self.canvas.send_map_data() 99 self.canvas.send_map_data()
96 self.canvas.Refresh(False) 100 self.canvas.Refresh(False)
97 101
98 def update_info(self): 102 def update_info(self):