changeset 432:8ecc5a7062e4

browser and server sides: fixes module import + use enumerate instead of xrange
author souliane <souliane@mailoo.org>
date Sun, 27 Apr 2014 18:53:37 +0200
parents 4fcf9bac109c
children bbdbee25123a
files browser_side/base_widget.py browser_side/contact_group.py browser_side/menu.py browser_side/panels.py browser_side/richtext.py twisted/plugins/libervia.py
diffstat 6 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/browser_side/base_widget.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/browser_side/base_widget.py	Sun Apr 27 18:53:37 2014 +0200
@@ -38,7 +38,7 @@
 from pyjamas import Window
 from __pyjamas__ import doc
 
-import dialog
+from browser_side import dialog
 
 
 class DragLabel(DragWidget):
--- a/browser_side/contact_group.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/browser_side/contact_group.py	Sun Apr 27 18:53:37 2014 +0200
@@ -27,8 +27,8 @@
 from pyjamas.ui import HasAlignment
 from browser_side.dialog import ConfirmDialog, InfoDialog
 from list_manager import ListManager
-import dialog
-import contact
+from browser_side import dialog
+from browser_side import contact
 
 
 class ContactGroupManager(ListManager):
--- a/browser_side/menu.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/browser_side/menu.py	Sun Apr 27 18:53:37 2014 +0200
@@ -31,8 +31,8 @@
 from html_tools import html_sanitize
 from file_tools import FileUploadPanel
 from xmlui import XMLUI
-import panels
-import dialog
+from browser_side import panels
+from browser_side import dialog
 from contact_group import ContactGroupEditor
 import re
 from sat.core.i18n import _
--- a/browser_side/panels.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/browser_side/panels.py	Sun Apr 27 18:53:37 2014 +0200
@@ -48,10 +48,10 @@
 from card_game import CardPanel
 from radiocol import RadioColPanel
 from menu import Menu
-import dialog
-import base_widget
-import richtext
-import contact
+from browser_side import dialog
+from browser_side import base_widget
+from browser_side import richtext
+from browser_side import contact
 
 from constants import Const
 from plugin_xep_0085 import ChatStateMachine
--- a/browser_side/richtext.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/browser_side/richtext.py	Sun Apr 27 18:53:37 2014 +0200
@@ -34,7 +34,7 @@
 from base_panels import TitlePanel, BaseTextEditor, HTMLTextEditor
 from list_manager import ListManager
 from html_tools import html_sanitize
-import panels
+from browser_side import panels
 
 from sat_frontends.tools import composition
 from sat.core.i18n import _
--- a/twisted/plugins/libervia.py	Mon Apr 07 23:31:21 2014 +0200
+++ b/twisted/plugins/libervia.py	Sun Apr 27 18:53:37 2014 +0200
@@ -50,11 +50,12 @@
         """
         config = SafeConfigParser()
         config.read(Const.CONFIG_FILES)
-        for index in xrange(0, len(self.optParameters)):
-            name = self.optParameters[index][0]
+        for index, param in list(enumerate(self.optParameters)):
+            # index is only used to not modify the loop variable "param"
+            name = param[0]
             try:
                 value = config.get('libervia', name)
-                self.optParameters[index][2] = self.optParameters[index][4](value)
+                self.optParameters[index][2] = param[4](value)
             except (NoSectionError, NoOptionError):
                 pass
         usage.Options.__init__(self)