本文整理汇总了Python中File.File.printFiles方法的典型用法代码示例。如果您正苦于以下问题:Python File.printFiles方法的具体用法?Python File.printFiles怎么用?Python File.printFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File.File
的用法示例。
在下文中一共展示了File.printFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: startTransfer
# 需要导入模块: from File import File [as 别名]
# 或者: from File.File import printFiles [as 别名]
def startTransfer():
global users
global transfers
getUsers()
User.printUsers(users)
username = raw_input("From which user?").rstrip('\n')
user = User.findUser(users, username)
File.printFiles(user.files)
filename = raw_input("Which file?").rstrip('\n')
file = File.findFile(user.files, filename)
transfer = Transfer(user, file)
transfers.append(transfer)
transfer.start()
示例2: comm
# 需要导入模块: from File import File [as 别名]
# 或者: from File.File import printFiles [as 别名]
def comm():
global users
while True:
inp = raw_input("Enter desired command:\n")
inp = inp.rstrip('\n')
if inp == "users":
users = getUsers()
User.printUsers(users)
elif inp == "files":
username = raw_input("Enter username:").rstrip('\n')
files = getFiles(username)
findUser(users, username).files = files
File.printFiles(files)
elif inp == "discn":
discn()
return
elif inp == "updat":
updateFiles()
elif inp == "transfer":
startTransfer()
else:
print "Dafuq is this m8?"
示例3: ServerInitializer
# 需要导入模块: from File import File [as 别名]
# 或者: from File.File import printFiles [as 别名]
server_closer = ServerInitializer(1,o_server=p2pserver)
server_closer.start()
server_closer.join()
except AttributeError:
pass
sys.exit(0)
if __name__ == "__main__":
if len(sys.argv) != 7:
print "Usage: " + sys.argv[0] + " <server-ip> <user> <pass> <dir> <dest-dir> <local-port>"
sys.exit(1)
signal.signal(signal.SIGINT, signal_handler)
s = connect(sys.argv[1])
if not auth(sys.argv[2], sys.argv[3], sys.argv[6]):
print "Authentication failed..."
sys.exit(0)
user_files = File.getFileStruct(None, sys.argv[4])
File.printFiles(user_files)
s.sendall(pickle.dumps(user_files,-1))
dest_dir = sys.argv[5]
server_init = ServerInitializer(0, int(sys.argv[6]))
server_init.start()
comm()