Exemple #1
0
    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 = '******' + 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()
Exemple #2
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)
Exemple #3
0
    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 = "******" + 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()
Exemple #4
0
 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 = ""
Exemple #5
0
 def __init__(self):
     SignalDispatcher.__init__(self)
     self.__dict__['_localsettings'] = {}
     self.__dict__['_localregexes'] = {}
     try:
         self.__dict__['_localregexes_is_sorteddict'] = False
         from sortedcontainers import SortedDict
         self.__dict__['_localregexes'] = SortedDict()
         self.__dict__['_localregexes_is_sorteddict'] = True
     except ModuleNotFoundError:
         # cannot use self.fm.notify. it results in infinite recursion.
         print("_localregexes is not sorted container.")
     self.__dict__['_tagsettings'] = {}
     self.__dict__['_settings'] = {}
     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])
Exemple #6
0
    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 = '******' + 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()
Exemple #7
0
	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 = ""
Exemple #8
0
	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)
Exemple #9
0
 def __init__(self):
     SignalDispatcher.__init__(self)
     self.__dict__['_localsettings'] = dict()
     self.__dict__['_localregexes'] = dict()
     self.__dict__['_settings'] = dict()
     for name in ALLOWED_SETTINGS:
         self.signal_bind('setopt.' + name, self._sanitize, priority=1.0)
         self.signal_bind('setopt.' + name,
                          self._raw_set_with_signal,
                          priority=0.2)
Exemple #10
0
 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
Exemple #11
0
 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
Exemple #12
0
 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
Exemple #13
0
 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)
Exemple #14
0
 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])
Exemple #15
0
 def __init__(self):
     SignalDispatcher.__init__(self)
     self.__dict__['_localsettings'] = {}
     self.__dict__['_localregexes'] = {}
     self.__dict__['_tagsettings'] = {}
     self.__dict__['_settings'] = {}
     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])
Exemple #16
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.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', ''))
Exemple #17
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.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',''))
    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 = "******" + 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)
Exemple #19
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.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()
Exemple #20
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)
Exemple #21
0
    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.papermanager = PaperManager()

        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.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()
Exemple #22
0
    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 = '******' + 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()
Exemple #23
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)
Exemple #24
0
 def __init__(self, path):
     SignalDispatcher.__init__(self)
Exemple #25
0
 def __init__(self, path):
     SignalDispatcher.__init__(self)
     descr = "Waiting for dir '" + path + "' to be mounted"
     Loadable.__init__(self, self.generate(), descr)
     self.path = path
Exemple #26
0
 def __init__(self, path):
     SignalDispatcher.__init__(self)
     descr = "Waiting for dir '" + path + "' to be mounted"
     Loadable.__init__(self, self.generate(), descr)
     self.path = path
Exemple #27
0
 def __init__(self, path):
     SignalDispatcher.__init__(self)