本文整理匯總了Python中ranger.ext.signals.SignalDispatcher類的典型用法代碼示例。如果您正苦於以下問題:Python SignalDispatcher類的具體用法?Python SignalDispatcher怎麽用?Python SignalDispatcher使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SignalDispatcher類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
def __init__(self):
SignalDispatcher.__init__(self)
self.__dict__['_localsettings'] = dict()
self.__dict__['_settings'] = dict()
for name in ALLOWED_SETTINGS:
self.signal_bind('setopt.'+name,
self._raw_set_with_signal, priority=0.2)
示例2: __init__
def __init__(self, args, descr, silent=False, read=False):
SignalDispatcher.__init__(self)
Loadable.__init__(self, self.generate(), descr)
self.args = args
self.silent = silent
self.read = read
self.stdout_buffer = ""
示例3: __init__
def __init__(self, ui=None, bookmarks=None, tags=None, paths=None):
"""Initialize FM."""
Actions.__init__(self)
SignalDispatcher.__init__(self)
self.ui = ui if ui is not None else UI()
self.start_paths = paths if paths is not None else ['.']
self.directories = dict()
self.bookmarks = bookmarks
self.current_tab = 1
self.tabs = {}
self.tags = tags
self.restorable_tabs = deque([], ranger.MAX_RESTORABLE_TABS)
self.py3 = sys.version_info >= (3, )
self.previews = {}
self.default_linemodes = deque()
self.loader = Loader()
self.copy_buffer = set()
self.do_cut = False
self.metadata = MetadataManager()
self.image_displayer = None
self.run = None
self.rifle = None
self.thistab = None
try:
self.username = pwd.getpwuid(os.geteuid()).pw_name
except KeyError:
self.username = 'uid:' + str(os.geteuid())
self.hostname = socket.gethostname()
self.home_path = os.path.expanduser('~')
mimetypes.knownfiles.append(os.path.expanduser('~/.mime.types'))
mimetypes.knownfiles.append(self.relpath('data/mime.types'))
self.mimetypes = mimetypes.MimeTypes()
示例4: __init__
def __init__(self, ui=None, bookmarks=None, tags=None, paths=["."]):
"""Initialize FM."""
Actions.__init__(self)
SignalDispatcher.__init__(self)
if ui is None:
self.ui = UI()
else:
self.ui = ui
self.start_paths = paths
self.directories = dict()
self.log = deque(maxlen=20)
self.bookmarks = bookmarks
self.current_tab = 1
self.tabs = {}
self.tags = tags
self.restorable_tabs = deque([], ranger.MAX_RESTORABLE_TABS)
self.py3 = sys.version_info >= (3,)
self.previews = {}
self.loader = Loader()
self.copy_buffer = set()
self.do_cut = False
try:
self.username = pwd.getpwuid(os.geteuid()).pw_name
except:
self.username = "uid:" + str(os.geteuid())
self.hostname = socket.gethostname()
self.home_path = os.path.expanduser("~")
self.log.append("ranger {0} started! Process ID is {1}.".format(__version__, os.getpid()))
self.log.append("Running on Python " + sys.version.replace("\n", ""))
mimetypes.knownfiles.append(os.path.expanduser("~/.mime.types"))
mimetypes.knownfiles.append(self.relpath("data/mime.types"))
self.mimetypes = mimetypes.MimeTypes()
示例5: __init__
def __init__(self, args, descr, silent=False, read=False, input=None,
kill_on_pause=False):
SignalDispatcher.__init__(self)
Loadable.__init__(self, self.generate(), descr)
self.args = args
self.silent = silent
self.read = read
self.stdout_buffer = ""
self.input = input
self.kill_on_pause = kill_on_pause
示例6: __init__
def __init__(self, args, descr, # pylint: disable=too-many-arguments
silent=False, read=False, input=None, # pylint: disable=redefined-builtin
kill_on_pause=False, popenArgs=None):
SignalDispatcher.__init__(self)
Loadable.__init__(self, self.generate(), descr)
self.args = args
self.silent = silent
self.read = read
self.stdout_buffer = ""
self.input = input
self.kill_on_pause = kill_on_pause
self.popenArgs = popenArgs # pylint: disable=invalid-name
示例7: __init__
def __init__(self):
SignalDispatcher.__init__(self)
self.__dict__['_localsettings'] = dict()
self.__dict__['_localregexes'] = dict()
self.__dict__['_tagsettings'] = dict()
self.__dict__['_settings'] = dict()
for name in ALLOWED_SETTINGS:
self.signal_bind('setopt.' + name, self._sanitize,
priority=SIGNAL_PRIORITY_SANITIZE)
self.signal_bind('setopt.' + name, self._raw_set_with_signal,
priority=SIGNAL_PRIORITY_SYNC)
for name, values in ALLOWED_VALUES.items():
assert values
assert name in ALLOWED_SETTINGS
self._raw_set(name, values[0])
示例8: __init__
def __init__(self, ui=None, bookmarks=None, tags=None):
"""Initialize FM."""
Actions.__init__(self)
SignalDispatcher.__init__(self)
self.ui = ui
self.log = deque(maxlen=20)
self.bookmarks = bookmarks
self.tags = tags
self.tabs = {}
self.py3 = sys.version_info >= (3, )
self.previews = {}
self.current_tab = 1
self.loader = Loader()
self.log.append('Ranger {0} started! Process ID is {1}.' \
.format(__version__, os.getpid()))
self.log.append('Running on Python ' + sys.version.replace('\n',''))
示例9: __init__
def __init__(self, path):
SignalDispatcher.__init__(self)
self.path = abspath(expanduser(path))
self._cf = None
self.pathway = ()
self.directories = {}
self.keybuffer = KeyBuffer()
self.keymaps = KeyMaps(self.keybuffer)
self.copy = set()
self.history = History(self.settings.max_history_size, unique=False)
try:
self.username = pwd.getpwuid(os.geteuid()).pw_name
except:
self.username = "uid:" + str(os.geteuid())
self.hostname = socket.gethostname()
self.home_path = os.path.expanduser("~")
self.signal_bind("move", self._set_cf_from_signal, priority=0.1, weak=True)
示例10: __init__
def __init__(self, ui=None, bookmarks=None, tags=None):
"""Initialize FM."""
Actions.__init__(self)
SignalDispatcher.__init__(self)
self.ui = ui
self.log = deque(maxlen=20)
self.bookmarks = bookmarks
self.tags = tags
self.tabs = {}
self.py3 = sys.version_info >= (3,)
self.previews = {}
self.current_tab = 1
self.loader = Loader()
self.log.append("ranger {0} started! Process ID is {1}.".format(__version__, os.getpid()))
self.log.append("Running on Python " + sys.version.replace("\n", ""))
mimetypes.knownfiles.append(os.path.expanduser("~/.mime.types"))
mimetypes.knownfiles.append(self.relpath("data/mime.types"))
self.mimetypes = mimetypes.MimeTypes()
示例11: __init__
def __init__(self, path):
SignalDispatcher.__init__(self)
self.path = abspath(expanduser(path))
self._cf = None
self.pathway = ()
self.directories = {}
self.keybuffer = KeyBuffer(None, None)
self.keymanager = KeyManager(self.keybuffer, ALLOWED_CONTEXTS)
self.copy = set()
self.history = History(self.settings.max_history_size, unique=False)
try:
self.username = pwd.getpwuid(os.geteuid()).pw_name
except:
self.username = 'uid:' + str(os.geteuid())
self.hostname = socket.gethostname()
self.home_path = os.path.expanduser('~')
self.signal_bind('move', self._set_cf_from_signal, priority=0.1,
weak=True)
示例12: __init__
def __init__(self, ui=None, bookmarks=None, tags=None, paths=['.']):
"""Initialize FM."""
Actions.__init__(self)
SignalDispatcher.__init__(self)
if ui is None:
self.ui = UI()
else:
self.ui = ui
self.start_paths = paths
self.directories = dict()
self.log = deque(maxlen=20)
self.image_displayer = ImageDisplayer()
self.bookmarks = bookmarks
self.current_tab = 1
self.tabs = {}
self.tags = tags
self.restorable_tabs = deque([], ranger.MAX_RESTORABLE_TABS)
self.py3 = sys.version_info >= (3, )
self.previews = {}
self.default_linemodes = deque()
self.loader = Loader()
self.copy_buffer = set()
self.do_cut = False
self.metadata = MetadataManager()
try:
self.username = pwd.getpwuid(os.geteuid()).pw_name
except:
self.username = 'uid:' + str(os.geteuid())
self.hostname = socket.gethostname()
self.home_path = os.path.expanduser('~')
self.log.append('ranger {0} started! Process ID is {1}.' \
.format(__version__, os.getpid()))
self.log.append('Running on Python ' + sys.version.replace('\n',''))
mimetypes.knownfiles.append(os.path.expanduser('~/.mime.types'))
mimetypes.knownfiles.append(self.relpath('data/mime.types'))
self.mimetypes = mimetypes.MimeTypes()
示例13: __init__
def __init__(self, path):
SignalDispatcher.__init__(self)
descr = "Waiting for dir '" + path + "' to be mounted"
Loadable.__init__(self, self.generate(), descr)
self.path = path
示例14: __init__
def __init__(self, path):
SignalDispatcher.__init__(self)