changeset 898:2d15b484ca33

blog, browser: updated imports to reflect renaming of common.py to common/data_format.py
author Goffi <goffi@goffi.org>
date Tue, 22 Mar 2016 22:45:39 +0100
parents 6de862136eb6
children bc3a3e804a7a
files src/browser/sat_browser/blog.py src/browser/sat_browser/richtext.py src/server/blog.py
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/blog.py	Sun Mar 20 22:30:03 2016 +0100
+++ b/src/browser/sat_browser/blog.py	Tue Mar 22 22:45:39 2016 +0100
@@ -20,7 +20,7 @@
 import pyjd  # this is dummy in pyjs
 from sat.core.log import getLogger
 log = getLogger(__name__)
-from sat.tools import common
+from sat.tools.common import data_format
 from sat.core.i18n import _ #, D_
 
 from pyjamas.ui.SimplePanel import SimplePanel
@@ -136,7 +136,7 @@
         """Set the bubble displaying the initial content."""
         content = {'text': self.item.content_xhtml if self.item.content_xhtml else self.item.content or '',
                    'title': self.item.title_xhtml if self.item.title_xhtml else self.item.title or ''}
-        common.iter2dict('tag', self.item.tags, content)
+        data_format.iter2dict('tag', self.item.tags, content)
 
         if self.mode == C.ENTRY_MODE_TEXT:
             # assume raw text message have no title
@@ -277,7 +277,7 @@
             # message syntax in mb_data for the frontend to use it instead of current syntax.
             self.item.content_rich = content['text']  # XXX: this also works if the syntax is XHTML
             self.item.title = content['title']
-            self.item.tags = list(common.dict2iter('tag', content))
+            self.item.tags = list(data_format.dict2iter('tag', content))
         else:
             self.item.content = content['text']
 
--- a/src/browser/sat_browser/richtext.py	Sun Mar 20 22:30:03 2016 +0100
+++ b/src/browser/sat_browser/richtext.py	Tue Mar 22 22:45:39 2016 +0100
@@ -21,7 +21,7 @@
 from sat.core.i18n import _
 from sat.core.log import getLogger
 log = getLogger(__name__)
-from sat.tools import common
+from sat.tools.common import data_format
 
 from pyjamas.ui.TextArea import TextArea
 from pyjamas.ui.Button import Button
@@ -265,7 +265,7 @@
         if hasattr(self, 'title_panel'):
             content.update({'title': self.strproc(self.title_panel.getText())})
         if hasattr(self, 'tags_panel'):
-            common.iter2dict('tag', self.tags_panel.getTags(), content)
+            data_format.iter2dict('tag', self.tags_panel.getTags(), content)
         return content
 
     def edit(self, edit=False, abort=False, sync=False):
@@ -302,7 +302,7 @@
                         self.title_panel.setStackVisible(0, content['title'] != '')
 
                     if hasattr(self, 'tags_panel'):
-                        tags = list(common.dict2iter('tag', content))
+                        tags = list(data_format.dict2iter('tag', content))
                         self.tags_panel.setTags(tags)
                         self.tags_panel.setStackVisible(0, len(tags) > 0)
 
@@ -328,7 +328,7 @@
             title = ""
 
         tags = ""
-        for tag in common.dict2iter('tag', content):
+        for tag in data_format.dict2iter('tag', content):
             tags += "<li><a>%s</a></li>" % html_tools.html_sanitize(tag)
         if tags:
             tags = '<ul class="mblog_tags">%s</ul>' % tags
--- a/src/server/blog.py	Sun Mar 20 22:30:03 2016 +0100
+++ b/src/server/blog.py	Tue Mar 22 22:45:39 2016 +0100
@@ -22,7 +22,7 @@
 from sat_frontends.tools.strings import addURLToText, fixXHTMLLinks
 from sat.core.log import getLogger
 log = getLogger(__name__)
-from sat.tools import common
+from sat.tools.common import data_format
 from sat.tools import xml_tools
 from dbus.exceptions import DBusException
 from twisted.internet import defer
@@ -751,7 +751,7 @@
             if query_data:
                 self.url += '?{}'.format(_urlencode(query_data))
             self.title = self.getText(entry, 'title')
-            self.tags = [sanitizeHtml(tag) for tag in common.dict2iter('tag', entry)]
+            self.tags = [sanitizeHtml(tag) for tag in data_format.dict2iter('tag', entry)]
 
             count_text = lambda count: D_(u'comments') if count > 1 else D_(u'comment')