sugar-control: fixed some imports, cleaned some strings

This commit is contained in:
Simon Schampijer 2007-10-31 11:32:54 +01:00
parent 38b87ad7cd
commit 14ffdc1d03
3 changed files with 14 additions and 12 deletions

View File

@ -24,7 +24,7 @@ from sugar import env
sys.path.insert(0, env.get_shell_path()) sys.path.insert(0, env.get_shell_path())
import control from controlpanel import control
def cmd_help(): def cmd_help():
print 'Usage: sugar-control [ option ] key [ args ... ] \n\ print 'Usage: sugar-control [ option ] key [ args ... ] \n\

View File

@ -1,2 +1,4 @@
sugardir = $(pkgdatadir)/shell/controlpanel sugardir = $(pkgdatadir)/shell/controlpanel
sugar_PYTHON = control.py sugar_PYTHON = \
__init__.py \
control.py

View File

@ -218,7 +218,7 @@ def print_jabber():
def set_jabber(server): def set_jabber(server):
"""Set the jabber server """Set the jabber server
server : 'olpc.collabora.co.uk' server : e.g. 'olpc.collabora.co.uk'
""" """
pro = profile.get_profile() pro = profile.get_profile()
pro.jabber_server = server pro.jabber_server = server
@ -239,11 +239,11 @@ def print_color():
print 'fill: color=%s hue=%s'%(color, hue) print 'fill: color=%s hue=%s'%(color, hue)
def set_color(stroke, fill, modstroke='medium', modfill='medium'): def set_color(stroke, fill, modstroke='medium', modfill='medium'):
"""Set the system color. """Set the system color by setting a fill and stroke color.
fill : 'red, orange, yellow, blue, purple' fill : [red, orange, yellow, blue, purple]
stroke : 'red, orange, yellow, blue, purple' stroke : [red, orange, yellow, blue, purple]
modstroke : 'dark, medium, light' hue stroke : [dark, medium, light] (optional)
modfill : ''dark, medium, light' hue fill : [dark, medium, light] (optional)
""" """
if modstroke not in _MODIFIERS or modfill not in _MODIFIERS: if modstroke not in _MODIFIERS or modfill not in _MODIFIERS:
@ -272,7 +272,7 @@ def print_nick():
def set_nick(nick): def set_nick(nick):
"""Set the nickname. """Set the nickname.
nick : 'erikos' nick : e.g. 'walter'
""" """
pro = profile.get_profile() pro = profile.get_profile()
pro.nick_name = nick pro.nick_name = nick
@ -285,16 +285,16 @@ def get_radio():
state = nm.state() state = nm.state()
if state: if state:
if state == NM_ASLEEP: if state == NM_ASLEEP:
return _('Asleep') return _('off')
else: else:
return _('Awake') return _('on')
return _('State is unknown.') return _('State is unknown.')
def print_radio(): def print_radio():
print get_radio() print get_radio()
def set_radio(state): def set_radio(state):
"""Turn Radio off """Turn Radio 'on' or 'off'
state : 'on/off' state : 'on/off'
""" """