• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.err函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中terminatorlib.util.err函数的典型用法代码示例。如果您正苦于以下问题:Python err函数的具体用法?Python err怎么用?Python err使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了err函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: executeStep

 def executeStep(self, step, terminal, terminalElement):
     if step == DIRECTORY_ATTRIBUTE:
         self.setDirectory(terminal, terminalElement)
     elif step == EXPORT_TERMINAL_NUMBER_ATTRIBUTE:
         self.exportTerminalNumber(terminal, self.exportVariable)
     elif step == COMMAND_ATTRIBUTE:
         self.executeTerminalCommand(terminal, terminalElement)
     else:
         err("ignoring unknown step [%s]" % step)
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例2: execute_step

 def execute_step(self, step, terminal, terminal_element):
     if step == DIRECTORY_ATTRIBUTE:
         self.set_directory(terminal, terminal_element)
     elif step == EXPORT_TERMINAL_NUMBER_ATTRIBUTE:
         self.export_terminal_number(terminal, self.export_variable)
     elif step == COMMAND_ATTRIBUTE:
         self.execute_terminal_command(terminal, terminal_element)
     else:
         err('ignoring unknown step [%s]' % step)
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例3: get_orientation

    def get_orientation(paned):
        if isinstance(paned, VPaned):
            orientation = VERTICAL_VALUE
        else:
            if not isinstance(paned, HPaned):
                err('unknown Paned type; will use: %s' % HORIZONTAL_VALUE)
            orientation = HORIZONTAL_VALUE

        return orientation
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例4: isVerticalOrientation

 def isVerticalOrientation(self, orientation):
     if orientation is None:
         err("orientation is None; use default")
     elif orientation == HORIZONTAL_VALUE:
         return False
     elif not orientation == VERTICAL_VALUE:
         err("unknown orientation [%s]; use default" % orientation)
         
     return True
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例5: getOrientation

 def getOrientation(self, paned):
     if isinstance(paned, VPaned):
         orientation = VERTICAL_VALUE
     else: 
         if not isinstance(paned, HPaned):
             err("unknown Paned type; use %s" % HORIZONTAL_VALUE)           
         orientation = HORIZONTAL_VALUE
         
     return orientation
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例6: is_vertical_orientation

    def is_vertical_orientation(orientation):
        if orientation is None:
            err('orientation is None; use default')
        elif orientation == HORIZONTAL_VALUE:
            return False
        elif not orientation == VERTICAL_VALUE:
            err('unknown orientation [%s]; use default' % orientation)

        return True
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:9,代码来源:LayoutManager.py


示例7: loadChildRecursive

 def loadChildRecursive(self,terminal,childElement):
     targetElement = childElement.find(SPLIT_ELEMENT)
     handled = self.tryLoadSplitRecursive(terminal, targetElement)
     
     if not handled:
         targetElement = childElement.find(TERMINAL_ELEMENT)
         handled = self.tryLoadTerminal(terminal, targetElement)
     
     if not handled:
         err("neither split, nor terminal found.")
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:10,代码来源:LayoutManager.py


示例8: load_child_recursive

    def load_child_recursive(self, terminal, child_element):
        target_element = self.try_get_xml_child(child_element, SPLIT_ELEMENT)
        handled = self.try_load_split_recursive(terminal, target_element)

        if not handled:
            target_element = self.try_get_xml_child(child_element, TERMINAL_ELEMENT)
            handled = self.try_load_terminal(terminal, target_element)

        if not handled:
            err('neither split, nor terminal found: %s' % child_element)
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:10,代码来源:LayoutManager.py


示例9: try_load_split_recursive

 def try_load_split_recursive(self, terminal, split_element):
     if split_element is None:
         return False
     split_children = list(self.try_get_xml_children(split_element, CHILD_ELEMENT))
     if len(split_children) == 2:
         orientation = self.try_get_xml_attribute(split_element, ORIENTATION_ATTRIBUTE)
         self.split_and_load_axis_recursive(terminal, orientation, split_children[0], split_children[1])
     else:
         err('split element needs exactly two child elements. You have: %d' % len(split_children))
     return True
开发者ID:walbinjr,项目名称:TerminatorPlugins,代码行数:10,代码来源:LayoutManager.py


示例10: save_recursive

 def save_recursive(self, target, element, terminal=None):
     if isinstance(target, Terminal):
         self.save_terminal(target, element)
     elif isinstance(target, Paned):
         self.save_paned_recursive(target, element)
     elif isinstance(target, Window):
         self.save_window_recursive(target, element, terminal)
     elif isinstance(target, Notebook):
         self.save_notebook_recursive(target, element, terminal)
     else:
         err('ignoring unknown target type %s' % target.__class__)
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:11,代码来源:LayoutManager.py


示例11: saveRecursive

 def saveRecursive(self, target, element, terminal = None):       
     if isinstance(target, Terminal):
         self.saveTerminal(target, element)
     elif isinstance(target, Paned):
         self.savePanedRecursive(target, element)
     elif isinstance(target, Window):
         self.saveWindowRecursiv(target, element, terminal)
     elif isinstance(target, Notebook):
         self.saveNotebookRecursiv(target, element, terminal)
     else:
         err("ignoring unknown target type")
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:11,代码来源:LayoutManager.py


示例12: insertCommandParameter

 def insertCommandParameter(self, command):
     if not command:
         return None
     
     if not self.parameter:
         err("no parameter left for terminal; ignoring command")
         return None
     
     parameter = self.parameter.pop()
     
     return command.replace(self.parameterPlaceholder, parameter)
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:11,代码来源:LayoutManager.py


示例13: parsePluginConfig

def parsePluginConfig(config):
    '''merge the default settings with settings from terminator's config'''
    ret = DEFAULT_SETTINGS
    pluginConfig = config.plugin_get_config(EXPORTER_NAME)
    if pluginConfig:
        for currentKey in ret.keys():
            if currentKey in pluginConfig:
                ret[currentKey] = pluginConfig[currentKey]
        for currentKey in pluginConfig:
            if not currentKey in ret:
                err("invalid config parameter: %s" % currentKey)
    return ret
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:12,代码来源:TerminalExporter.py


示例14: parse_plugin_config

def parse_plugin_config(config):
    """merge the default settings with settings from terminator's config"""
    ret = DEFAULT_SETTINGS
    plugin_config = config.plugin_get_config(EXPORTER_NAME)
    if plugin_config:
        for current_key in ret.keys():
            if current_key in plugin_config:
                ret[current_key] = plugin_config[current_key]
        for current_key in plugin_config:
            if current_key not in ret:
                err('invalid config parameter: %s' % current_key)
    return ret
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:12,代码来源:TerminalExporter.py


示例15: tryLoadSplitRecursive

    def tryLoadSplitRecursive(self, terminal, splitElement):
        if splitElement == None:
            return False
        #TODO: pass the position to terminator's pane
        #position = self.tryGetXmlAttribute(splitElement, POSITION_ATTRIBUTE)
        splitChildren = list(splitElement.findall(CHILD_ELEMENT))
        if len(splitChildren) == 2:
            orientation = self.tryGetXmlAttribute(splitElement, ORIENTATION_ATTRIBUTE) 
            self.splitAndLoadAxisRecursive(terminal, orientation, splitChildren[0], splitChildren[1])
        else:
            err("split element does not have exactly 2 child elements as children")

        return True
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:13,代码来源:LayoutManager.py


示例16: insert_command_parameter

    def insert_command_parameter(self, command, terminal_element):
        if not command:
            return None

        parameter = self.try_get_xml_attribute(terminal_element, PARAMETER_ATTRIBUTE)

        if not parameter:
            if not self.parameter:
                err('no parameter left for terminal; ignoring command')
                return None

            parameter = self.parameter.pop()

        return command.replace(self.parameter_placeholder, parameter)
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:14,代码来源:LayoutManager.py


示例17: loadLayout

 def loadLayout(self, terminal, rootElement):
     childElement = rootElement.find(CHILD_ELEMENT)
     if not childElement is None:
         self.loadChildRecursive(terminal, childElement)
     else:
         err("rootElement has no child childElement; abort loading")
开发者ID:sfate,项目名称:TerminatorPlugins,代码行数:6,代码来源:LayoutManager.py


示例18: load_layout

 def load_layout(self, terminal, root_element):
     child_element = self.try_get_xml_child(root_element, CHILD_ELEMENT)
     if child_element is not None:
         return self.load_child_recursive(terminal, child_element)
     err('rootElement has no childElement; abort loading')
开发者ID:aedis,项目名称:TerminatorPlugins,代码行数:5,代码来源:LayoutManager.py


示例19: dbg

            ipc.new_window(OPTIONS.layout)
            sys.exit()
    except ImportError:
        dbg('dbus not imported')
        pass

    MAKER = Factory()
    TERMINATOR = Terminator()
    TERMINATOR.set_origcwd(ORIGCWD)
    TERMINATOR.set_dbus_data(dbus_service)
    TERMINATOR.reconfigure()
    try:
        dbg('Creating a terminal with layout: %s' % OPTIONS.layout)
        TERMINATOR.create_layout(OPTIONS.layout)
    except (KeyError,ValueError), ex:
        err('layout creation failed, creating a window ("%s")' % ex)
        TERMINATOR.new_window()
    TERMINATOR.layout_done()

    if OPTIONS.debug > 2:
        import terminatorlib.debugserver as debugserver
        # pylint: disable-msg=W0611
        import threading

        gtk.gdk.threads_init()
        (DEBUGTHREAD, DEBUGSVR) = debugserver.spawn(locals())
        TERMINATOR.debug_address = DEBUGSVR.server_address

    try:
        gtk.main()
    except KeyboardInterrupt:
开发者ID:stefaniuk,项目名称:playground,代码行数:31,代码来源:MyTerminal.py


示例20: err

import gtk
import gobject
import pyglet # for playing sounds
import terminatorlib.plugin as plugin
from terminatorlib.translation import _
from terminatorlib.util import err, dbg
from terminatorlib.version import APP_NAME

try:
    import pynotify
    # Every plugin you want Terminator to load *must* be listed in 'AVAILABLE'
    # This is inside this try so we only make the plugin available if pynotify
    #  is present on this computer.
    AVAILABLE = ['ActivityWatch', 'InactivityWatch']
except ImportError:
    err(_('ActivityWatch plugin unavailable: please install python-notify'))

class ActivityWatch(plugin.MenuItem):
    """Add custom commands to the terminal menu"""
    capabilities = ['terminal_menu']
    watches = None
    last_notifies = None
    timers = None
    

    def __init__(self):
        plugin.MenuItem.__init__(self)
        if not self.watches:
            self.watches = {}
        if not self.last_notifies:
            self.last_notifies = {}
开发者ID:davetcoleman,项目名称:unix_settings,代码行数:31,代码来源:activitywatch.py



注:本文中的terminatorlib.util.err函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python termio.get_or_update_metadata函数代码示例发布时间:2022-05-27
下一篇:
Python util.dbg函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap