本文整理汇总了Python中pickle.Unpickler.pop方法的典型用法代码示例。如果您正苦于以下问题:Python Unpickler.pop方法的具体用法?Python Unpickler.pop怎么用?Python Unpickler.pop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pickle.Unpickler
的用法示例。
在下文中一共展示了Unpickler.pop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pickle import Unpickler [as 别名]
# 或者: from pickle.Unpickler import pop [as 别名]
#.........这里部分代码省略.........
(isinstance(elm[keys[i]], SugarSyncDirectory) and typ == SugarSyncShell.TYPE_FOLDER)
or (isinstance(elm[keys[i]], SugarSyncFile) and typ == SugarSyncShell.TYPE_FILE)
or typ == SugarSyncShell.TYPE_ALL
):
data = elm[keys[i]]
i = i+1
return data
def clear(self, param):
(width, height) = Console.getTerminalSize()
for f in range(0,height):
print('');
def help(self, param):
# this is a method to display the help
print('Following commands are possible:')
for cmd in self.cmds:
print(cmd)
def cd(self, param):
# TODO: at this point its very pre-release...
# we have to trim the param
param = param.strip()
if param[len(param)-1:] == '/':
param = param[:-1]
# and split on / ?
if param == '.':
return True
elif param == '..':
self.path.pop()
else:
# search
path = self.searchRecursivePath(None, param, SugarSyncShell.TYPE_FOLDER)
if path is not None:
self.path = path
return True
else:
print('Could not change the directory.')
return False
def ls(self, param):
# get actual element:
elm = self.path[len(self.path)-1]
print(Colors.c('./', Colors.BLUE))
if len(self.path) > 1:
print(Colors.c('../', Colors.BLUE))
for k,v in elm.getChildren().items():
if isinstance(v, SugarSyncDirectory):
print(Colors.c(str(k) + '/', Colors.BLUE))
else:
print(k)
def pwd(self, param):
print(self.getPath(False, False)) # withour header and without color
def history(self, param):
param = param.strip()
if param in ['.', './', '..', '../'] or param[len(param)-1:] == '/':