本文整理匯總了Python中peerdrive.Connector.regularStores方法的典型用法代碼示例。如果您正苦於以下問題:Python Connector.regularStores方法的具體用法?Python Connector.regularStores怎麽用?Python Connector.regularStores使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類peerdrive.Connector
的用法示例。
在下文中一共展示了Connector.regularStores方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from peerdrive import Connector [as 別名]
# 或者: from peerdrive.Connector import regularStores [as 別名]
(options, args) = parser.parse_args()
if len(args) > 2:
parser.error("incorrect number of arguments")
if options.auto and not options.persist:
parser.error("'--auto' depends on '--persist'")
if options.persist and (len(args) < 2):
parser.error("incorrect number of arguments")
fstab = struct.FSTab()
if len(args) == 0:
enum = Connector().enum()
if options.verbose:
printStore(enum.sysStore(), True)
for store in enum.regularStores():
auto = False
if store.label in fstab.knownLabels():
auto = fstab.get(store.label).get('auto', False)
printStore(store, options.verbose, auto)
if options.verbose:
print "\nUnmounted stores:"
unmounted = set(fstab.knownLabels()) - set([s.label for s in enum.regularStores()])
for label in unmounted:
store = fstab.get(label)
type = store.get("type", "file")
options = store.get("options", "")
credentials = store.get("credentials", "")
auto = store.get("auto", False)
line = "'%s' as '%s' type '%s'" % (store['src'], label, type)
if options: