示例#1
0
文件: __init__.py 项目: 4udak/ped-s60
# Ped plugin making it a system application using the "envy" module
# (has to be installed separately). Configurable.
#
# Copyright (c) 2008, Arkadiusz Wahlig
# <*****@*****.**>
#
# Distributed under the new BSD license.
#

import sys, ped, ui

try:
    from envy import set_app_system
except ImportError:
    sys.exit('%s plugin requires envy module' % __plugin__)

def apply_settings(self):
    old_apply_settings(self)
    set_app_system(self.settings.plugins.system_app)

# get the translator object for this plugin
_ = ped.get_plugin_translator(__file__)

# patch the ped.Application.apply_settings method
old_apply_settings = ped.repattr(ped.Application,
    'apply_settings', apply_settings)

# add to settings
ped.app.settings.plugins.append('system_app',
    ui.BoolSetting(_('System application'), False))
示例#2
0
文件: __init__.py 项目: 4udak/ped-s60
    # check if there are '#' chars at cursor and remove them
    # or add one if there weren't any
    pos = self.body.get_pos()
    if self.body.get(pos, 1) == u"#":
        while self.body.get(pos, 1) == u"#":
            self.body.delete(pos, 1)
    else:
        self.body.add(u"#")

    # find the start of next line and go there
    found = False
    for ln, lpos, line in self.get_lines():
        if found:
            pos = lpos
            break
        if lpos == pos:
            found = True

    # move the cursor to the new position
    self.body.set_pos(pos)


# get the translator object for this plugin
_ = ped.get_plugin_translator(__file__)

# patch the ped.PythonFileWindow.get_shortcuts classmethod
old_get_shortcuts = ped.repattr(ped.PythonFileWindow, "get_shortcuts", classmethod(get_shortcuts))

# add the ped.PythonFileWindow.comment_line method
ped.PythonFileWindow.comment_line = comment_line
示例#3
0
    # check if there are '#' chars at cursor and remove them
    # or add one if there weren't any
    pos = self.body.get_pos()
    if self.body.get(pos, 1) == u'#':
        while self.body.get(pos, 1) == u'#':
            self.body.delete(pos, 1)
    else:
        self.body.add(u'#')
    
    # find the start of next line and go there
    found = False
    for ln, lpos, line in self.get_lines():
        if found:
            pos = lpos
            break
        if lpos == pos:
            found = True

    # move the cursor to the new position
    self.body.set_pos(pos)

# get the translator object for this plugin
_ = ped.get_plugin_translator(__file__)

# patch the ped.PythonFileWindow.get_shortcuts classmethod
old_get_shortcuts = ped.repattr(ped.PythonFileWindow, 'get_shortcuts',
    classmethod(get_shortcuts))
    
# add the ped.PythonFileWindow.comment_line method
ped.PythonFileWindow.comment_line = comment_line
示例#4
0
#
# Copyright (c) 2008, Arkadiusz Wahlig
# <*****@*****.**>
#
# Distributed under the new BSD license.
#

import sys, ped, ui

try:
    from envy import set_app_system
except ImportError:
    sys.exit('%s plugin requires envy module' % __plugin__)


def apply_settings(self):
    old_apply_settings(self)
    set_app_system(self.settings.plugins.system_app)


# get the translator object for this plugin
_ = ped.get_plugin_translator(__file__)

# patch the ped.Application.apply_settings method
old_apply_settings = ped.repattr(ped.Application, 'apply_settings',
                                 apply_settings)

# add to settings
ped.app.settings.plugins.append('system_app',
                                ui.BoolSetting(_('System application'), False))