本文整理汇总了Python中peerdrive.Connector.rev方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.rev方法的具体用法?Python Connector.rev怎么用?Python Connector.rev使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类peerdrive.Connector
的用法示例。
在下文中一共展示了Connector.rev方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from peerdrive import Connector [as 别名]
# 或者: from peerdrive.Connector import rev [as 别名]
def __init__(self, link, parent=None):
super(PropertiesDialog, self).__init__(parent)
mainLayout = QtGui.QVBoxLayout()
# mainLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
self.__doc = link.doc()
self.__rev = link.rev()
if self.__doc:
isDoc = True
banner = "document"
l = Connector().lookupDoc(self.__doc)
stores = [s for s in l.stores() if Connector().lookupRev(l.rev(s), [s]) == [s]]
else:
isDoc = False
banner = "revision"
stores = Connector().lookupRev(self.__rev)
if len(stores) == 0:
QtGui.QMessageBox.warning(self, "Missing document", "The requested document was not found on any store.")
sys.exit(1)
self.__docTab = DocumentTab(link.store(), stores, banner)
self.__docTab.switchStore.connect(self.__switchStore)
self.__revTab = RevisionTab()
self.__annoTab = AnnotationTab(isDoc)
self.__annoTab.changed.connect(self.__changed)
self.__hisTab = HistoryTab()
tabWidget = QtGui.QTabWidget()
tabWidget.addTab(self.__annoTab, "Annotation")
tabWidget.addTab(self.__hisTab, "History")
if isDoc:
self.__buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Save | QtGui.QDialogButtonBox.Close)
self.__buttonBox.button(QtGui.QDialogButtonBox.Save).setEnabled(False)
self.__buttonBox.accepted.connect(self.__save)
self.__buttonBox.rejected.connect(self.reject)
else:
self.__buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok)
self.__buttonBox.accepted.connect(self.accept)
mainLayout.addWidget(self.__docTab)
mainLayout.addWidget(self.__revTab)
mainLayout.addWidget(tabWidget)
mainLayout.addWidget(self.__buttonBox)
self.setLayout(mainLayout)
self.__switchStore(self.__docTab.activeStore())
self.setWindowTitle("Properties of %s" % (self.__annoTab.getTitle()))
示例2: test_sync_ff_err
# 需要导入模块: from peerdrive import Connector [as 别名]
# 或者: from peerdrive.Connector import rev [as 别名]
def test_sync_ff_err(self):
(doc, rev1, rev2) = self.createMerge("public.data", {}, {"FILE": "left1"}, {"FILE": "right1"})
watch = self.watchDoc(doc, connector.Watch.EVENT_MODIFIED)
self.startSync("ff", self.store1, self.store2)
self.startSync("ff", self.store2, self.store1)
self.assertFalse(watch.waitForWatch(1))
# check that doc is not synced
l = Connector().lookupDoc(doc)
self.assertEqual(len(l.revs()), 2)
self.assertEqual(l.rev(self.store1), rev1)
self.assertEqual(l.rev(self.store2), rev2)