Esempio n. 1
0
	def __init__(self):
		SignalDispatcher.__init__(self)
		self.__dict__['_settings'] = dict()
		self.__dict__['_setting_sources'] = list()
		for name in ALLOWED_SETTINGS:
			self.signal_bind('setopt.'+name,
					self._raw_set_with_signal, priority=0.2)
Esempio n. 2
0
    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.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", ""))
Esempio n. 3
0
    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 = "******" + 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)