当前位置: 首页>>代码示例>>Python>>正文


Python Node.get_dest_path方法代码示例

本文整理汇总了Python中node.Node.get_dest_path方法的典型用法代码示例。如果您正苦于以下问题:Python Node.get_dest_path方法的具体用法?Python Node.get_dest_path怎么用?Python Node.get_dest_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在node.Node的用法示例。


在下文中一共展示了Node.get_dest_path方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pull_file

# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import get_dest_path [as 别名]
 def pull_file(self, filename, source_uname, source_ip):
     """pull file 'filename' from the source"""
     my_file = Node.get_dest_path(filename, self.username)
     self.pulled_files.add(my_file)
     proc = subprocess.Popen(['scp', "%[email protected]%s:%s" % (source_uname, source_ip, filename), my_file])
     return_status = proc.wait()
     logger.debug("returned status %s", return_status)
开发者ID:LivLuvHub,项目名称:PySyncIt,代码行数:9,代码来源:client.py

示例2: get_watch_dirs

# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import get_dest_path [as 别名]
def get_watch_dirs(config, user_name):
    watch_dirs = []
    for key, value in config.items('syncit.dirs'):
        dir = os.path.expanduser(value.strip())
        my_dir = Node.get_dest_path(dir, user_name)
        watch_dirs.append(my_dir)
    logger.debug("watched dirs %s", watch_dirs)
    return watch_dirs
开发者ID:LivLuvHub,项目名称:PySyncIt,代码行数:10,代码来源:monitor.py

示例3: check_collision

# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import get_dest_path [as 别名]
 def check_collision(self, filedata):
     my_file = Node.get_dest_path(filedata["name"], self.username)
     try:
         collision_exist = os.path.getmtime(my_file) > filedata["time"]
         logger.debug("collision check: server time %s  client time %s", os.path.getmtime(my_file), filedata["time"])
     except OSError as e:
         if e.errno == errno.ENOENT:
             collision_exist = False
         else:
             raise
     logger.debug("collision check for file %s result %s", my_file, collision_exist)
     return collision_exist
开发者ID:kamwoods,项目名称:PySyncIt,代码行数:14,代码来源:server.py

示例4: req_push_file

# 需要导入模块: from node import Node [as 别名]
# 或者: from node.Node import get_dest_path [as 别名]
    def req_push_file(self, filedata, source_uname, source_ip, source_port):
        """Mark this file as to be notified to clients - this file 'filename' has been modified, pull the latest copy"""
        logger.debug("server filedata %s %s", filedata["name"], filedata.keys())
        my_file = Node.get_dest_path(filedata["name"], self.username)
        # check if there is a conflict
        if self.check_collision(filedata):
            server_filename = "%s.backup.%s.%s.%s:%s" % (
                my_file,
                filedata["time"],
                source_uname,
                source_ip,
                source_port,
            )
        else:
            server_filename = my_file

        logger.debug("server filename %s returned for file %s", server_filename, filedata["name"])
        return server_filename
开发者ID:kamwoods,项目名称:PySyncIt,代码行数:20,代码来源:server.py


注:本文中的node.Node.get_dest_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。