diff orpg/mapper/background_handler.py @ 20:072ffc1d466f traipse_dev

2nd attempt. Still untested.
author sirebral
date Sat, 25 Jul 2009 19:23:25 -0500
parents 78407d627cba
children c54768cffbd4
line wrap: on
line diff
--- a/orpg/mapper/background_handler.py	Sat Jul 25 17:24:40 2009 -0500
+++ b/orpg/mapper/background_handler.py	Sat Jul 25 19:23:25 2009 -0500
@@ -86,17 +86,13 @@
                 thread.start_new_thread(self.canvas.layers['bg'].upload, 
                     (postdata, dlg.GetPath(), self.bg_type.GetStringSelection()))
             else:
-                try:
-                    min_url = open_rpg.get_component("cherrypy") + filename
-                except:
-                    return
+                try: min_url = open_rpg.get_component("cherrypy") + filename
+                except: return
                 min_url = dlg.GetDirectory().replace(orpg.dirpath.dir_struct["user"]+'webfiles' + os.sep, 
                     open_rpg.get_component("cherrypy")) + '/' + filename
 
-                if self.bg_type.GetStringSelection() == 'Texture':
-                    self.canvas.layers['bg'].set_texture(min_url)
-                elif self.bg_type.GetStringSelection() == 'Image':
-                    self.size = self.canvas.layers['bg'].set_image(min_url,1)
+                if self.bg_type.GetStringSelection() == 'Texture': self.canvas.layers['bg'].set_texture(min_url)
+                elif self.bg_type.GetStringSelection() == 'Image': self.size = self.canvas.layers['bg'].set_image(min_url,1)
                 self.update_info()
                 self.canvas.send_map_data()
                 self.canvas.Refresh(False)
@@ -104,8 +100,7 @@
     def update_info(self):
         bg_type = self.canvas.layers['bg'].get_type()
         session=self.canvas.frame.session
-        if (session.my_role() != session.ROLE_GM):
-            self.url_path.Hide()
+        if (session.my_role() != session.ROLE_GM): self.url_path.Hide()
         else:
             self.url_path.Show()
             self.url_path.Enable(BG_COLOR!=bg_type)
@@ -147,9 +142,8 @@
             return
         self.canvas.layers['bg'].set_color(self.color_button.GetBackgroundColour())
 
-        if self.bg_type.GetStringSelection() == 'Texture':
-            self.canvas.layers['bg'].set_texture(self.url_path.GetValue())
-        elif self.bg_type.GetStringSelection() == 'Image':
+        if self.bg_type.GetStringSelection() == 'Texture': self.canvas.layers['bg'].set_texture(self.url_path.GetValue())
+        elif self.bg_type.GetStringSelection() == 'Image': 
             self.size = self.canvas.layers['bg'].set_image(self.url_path.GetValue(),1)
 
         self.update_info()