コード例 #1
0
ファイル: wsprompt.py プロジェクト: soulplant/dotfiles
    def prompt_for_workspace(self):
        no_args = len(self._args) == 0
        if no_args:
            self.print_workspaces()
            return (None, [])
        index = self._parse_index(self._args[0])

        (subdir, i) = index
        if i is None:
            self.print_workspaces(subdir)
            return (None, [])

        ws = Workspace.all(subdir)
        if i < 0 or i >= len(ws):
            print "Index out of range: %d" % i
            self.print_workspaces()
            return (None, [])

        return (ws[i], self._args[1:])
コード例 #2
0
ファイル: wsprompt.py プロジェクト: soulplant/workspaces
    def prompt_for_workspace(self):
        no_args = len(self._args) == 0
        if no_args:
            self.print_workspaces()
            return (None, [])

        if self._args[0] == ":":
            self.print_subdirs()
            return (None, [])

        index = self._parse_index(self._args[0])

        (subdir, i) = index
        if i is None:
            self.print_workspaces(subdir)
            return (None, [])

        ws = Workspace.all(subdir)
        if i < 0 or i >= len(ws):
            print "Index out of range: %d" % i
            self.print_workspaces()
            return (None, [])

        return (ws[i], self._args[1:])
コード例 #3
0
ファイル: wsprompt.py プロジェクト: soulplant/dotfiles
 def print_workspaces(self, subdir=None):
     ws = Workspace.all(subdir)
     for i in range(len(ws)):
         print "%d: %s" % (i, ws[i].summary_line())
コード例 #4
0
ファイル: wsprompt.py プロジェクト: soulplant/workspaces
 def print_workspaces(self, subdir=None):
     ws = Workspace.all(subdir)
     for i in range(len(ws)):
         print "%d: %s" % (i, ws[i].summary_line())