core (tools): moved common to a separate package, and put data method in a data_format module
This commit is contained in:
parent
d0fb849398
commit
2d1d286be2
2 changed files with 15 additions and 15 deletions
|
|
@ -32,7 +32,7 @@ import tempfile
|
|||
import subprocess
|
||||
import shlex
|
||||
import glob
|
||||
from sat.tools import common
|
||||
from sat.tools.common import data_format
|
||||
|
||||
__commands__ = ["Blog"]
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ class Edit(base.CommandBase, BlogCommon):
|
|||
# and override metadata with command-line arguments
|
||||
mb_data['allow_comments'] = C.boolConst(not self.args.no_comment)
|
||||
if self.args.tag:
|
||||
common.iter2dict('tag', self.args.tag, mb_data)
|
||||
data_format.iter2dict('tag', self.args.tag, mb_data)
|
||||
if self.args.title is not None:
|
||||
mb_data['title'] = self.args.title
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ log = getLogger(__name__)
|
|||
from sat_frontends.quick_frontend.constants import Const as C
|
||||
from sat_frontends.quick_frontend import quick_widgets
|
||||
from sat_frontends.tools import jid
|
||||
from sat.tools import common
|
||||
from sat.tools.common import data_format
|
||||
|
||||
try:
|
||||
# FIXME: to be removed when an acceptable solution is here
|
||||
|
|
@ -49,7 +49,7 @@ class Item(object):
|
|||
self.title = data.get('title')
|
||||
self.title_rich = None
|
||||
self.title_xhtml = data.get('title_xhtml')
|
||||
self.tags = list(common.dict2iter('tag', data))
|
||||
self.tags = list(data_format.dict2iter('tag', data))
|
||||
self.content = data.get('content')
|
||||
self.content_rich = None
|
||||
self.content_xhtml = data.get('content_xhtml')
|
||||
|
|
@ -264,7 +264,7 @@ class Entry(EntriesManager):
|
|||
if value is not None:
|
||||
mb_data[name] = value
|
||||
|
||||
common.iter2dict('tag', self.item.tags, mb_data)
|
||||
data_format.iter2dict('tag', self.item.tags, mb_data)
|
||||
|
||||
if self.blog.new_message_target not in (C.PUBLIC, C.GROUP):
|
||||
raise NotImplementedError
|
||||
|
|
@ -273,7 +273,7 @@ class Entry(EntriesManager):
|
|||
mb_data["allow_comments"] = C.BOOL_TRUE
|
||||
|
||||
if self.blog.new_message_target == C.GROUP:
|
||||
common.iter2dict('group', self.blog.targets, mb_data)
|
||||
data_format.iter2dict('group', self.blog.targets, mb_data)
|
||||
|
||||
self.blog.host.bridge.mbSend(
|
||||
unicode(self.service or ''),
|
||||
|
|
|
|||
Loading…
Reference in a new issue