printer.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:PRET 作者: RUB-NDS 项目源码 文件源码
def do_put(self, arg, rpath=""):
    "Send file:  put <local file>"
    if not arg:
      arg = raw_input("Local file: ")
    if not rpath:
      rpath = os.path.basename(arg)
    rpath = self.rpath(rpath)
    lpath = os.path.abspath(arg)
    # read from local file
    data = file().read(lpath)
    if data != None:
      self.put(rpath, data)
      lsize = len(data)
      rsize = self.file_exists(rpath)
      if rsize == lsize:
        print(str(rsize) + " bytes transferred.")
      elif rsize == c.NONEXISTENT:
        print("Permission denied.")
      else:
        self.size_mismatch(lsize, rsize)

  # ------------------------[ append <file> <string> ]------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号