示例#1
0
    def path(self, *parts):
        """A factory for :class:`RemotePaths <plumbum.remote_machine.RemotePath>`. Usage

        ::

            p = rem.path("/usr", "lib", "python2.7")
        """
        return RemotePath(self, *parts)
示例#2
0
 def path(self, *parts):
     """A factory for :class:`RemotePaths <plumbum.remote_machine.RemotePath>`.
     Usage: ``p = rem.path("/usr", "lib", "python2.7")``
     """
     parts2 = [str(self.cwd)]
     for p in parts:
         if isinstance(p, LocalPath):
             raise TypeError("Cannot construct RemotePath from %r" % (p, ))
         p = str(p)
         if "~" in p:
             p = self.env.expanduser(p)
         parts2.append(p)
     return RemotePath(self, *parts2)
示例#3
0
 def getpath(self):
     """Returns the current working directory as a
     `remote path <plumbum.remote_machine.RemotePath>` object"""
     return RemotePath(self.remote, self)