コード例 #1
0
ファイル: sink.py プロジェクト: Kyle-Verhoog/sink
    def repl(self):
        PROMPT = self.dropbox.users_get_current_account().email + " > "
        parser = argparse.ArgumentParser(description="Use the sink repl")
        parser.add_argument("command", help="subcommand")

        while True:
            self.args = prompt(PROMPT,
                               vi_mode=True,
                               completer=self.generate_completer(),
                               history=file_history(sh.join_paths(
                                   sh.get_home_dir(), '.sinkhist'))).split(' ')
            args = parser.parse_args(self.args[0:1])
            if not hasattr(self, args.command):
                print("Command not found")
                continue
            getattr(self, args.command)()
コード例 #2
0
ファイル: sink.py プロジェクト: gitter-badger/sink
    def repl(self):
        PROMPT = self.dropbox.users_get_current_account().email + " > "
        parser = argparse.ArgumentParser(description="Use the sink repl")
        parser.add_argument("command", help="subcommand")

        while True:
            self.args = prompt(PROMPT,
                               vi_mode=True,
                               completer=self.generate_completer(),
                               history=file_history(
                                   sh.join_paths(sh.get_home_dir(),
                                                 '.sinkhist'))).split(' ')
            args = parser.parse_args(self.args[0:1])
            if not hasattr(self, args.command):
                print("Command not found")
                continue
            getattr(self, args.command)()
コード例 #3
0
ファイル: sink.py プロジェクト: gitter-badger/sink
 def init_config(self):
     self.conf_file = open(sh.join_paths(sh.get_home_dir(), '.sink'), "r+")
     self.curdir = util.directory(self.conf_file.readline().rstrip())
     #self.curdir = self.__sanitize_dir(self.conf_file.readline().rstrip())
     #self.curdir = sh.get_var(Sink.SINK_DIR, self.curdir)
     self.conf_file.close()
コード例 #4
0
ファイル: sink.py プロジェクト: gitter-badger/sink
 def __unload(self):
     self.conf_file = open(sh.join_paths(sh.get_home_dir(), '.sink'), "w+")
     self.conf_file.write(self.curdir.get_directory())
     #sh.set_var(Sink.SINK_DIR, self.curdir)
     self.conf_file.close()
コード例 #5
0
ファイル: sink.py プロジェクト: Kyle-Verhoog/sink
 def init_config(self):
     self.conf_file = open(sh.join_paths(sh.get_home_dir(), '.sink'), "r+")
     self.curdir = util.directory(self.conf_file.readline().rstrip())
     #self.curdir = self.__sanitize_dir(self.conf_file.readline().rstrip())
     #self.curdir = sh.get_var(Sink.SINK_DIR, self.curdir)
     self.conf_file.close()
コード例 #6
0
ファイル: sink.py プロジェクト: Kyle-Verhoog/sink
 def __unload(self):
     self.conf_file = open(sh.join_paths(sh.get_home_dir(), '.sink'), "w+")
     self.conf_file.write(self.curdir.get_directory())
     #sh.set_var(Sink.SINK_DIR, self.curdir)
     self.conf_file.close()