示例#1
0
 def exportshow_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "DBUS error:" + str(reply.error().message()))
     else:
         ts_ = (reply.argumentAt(0).toPyObject()[0].toULongLong()[0],
                reply.argumentAt(0).toPyObject()[1].toULongLong()[0])
         exports = []
         for export in reply.argumentAt(1).toPyObject():
             ex = export.toPyObject()
             lasttime = ex[10].toPyObject()
             exp = Export(ExportID=ex[0].toInt()[0],
                          ExportPath=str(ex[1].toString()),
                          HasNFSv3=ex[2].toBool(),
                          HasMNT=ex[3].toBool(),
                          HasNLM4=ex[4].toBool(),
                          HasRQUOTA=ex[5].toBool(),
                          HasNFSv40=ex[6].toBool(),
                          HasNFSv41=ex[7].toBool(),
                          HasNFSv42=ex[8].toBool(),
                          Has9P=ex[9].toBool(),
                          LastTime=(lasttime[0].toPyObject(),
                                    lasttime[1].toPyObject()))
             exports.append(exp)
         self.show_exports.emit(ts_, exports)
示例#2
0
 def exportrm_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "Error:" + str(reply.error().message()))
     else:
         self.show_status.emit(True, "Done")
示例#3
0
 def Get_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "DBUS error:" + str(reply.error().message()))
     else:
         level = str(reply.value().toPyObject().toString())
         self.show_level.emit(level)
示例#4
0
 def exportadd_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "Error:" + str(reply.error().message()))
     else:
         message = reply.argumentAt(0).toPyObject()
         self.show_status.emit(True, "Done: " + message)
示例#5
0
 def admin_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "DBUS error:" + str(reply.error().message()))
     else:
         status = reply.argumentAt(0).toPyObject()
         msg = reply.argumentAt(1).toPyObject()
         self.show_status.emit(status, msg)
示例#6
0
 def exportdisplay_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "Error:" + str(reply.error().message()))
     else:
         id_ = reply.argumentAt(0).toPyObject()
         fullpath = reply.argumentAt(1).toPyObject()
         pseudopath = reply.argumentAt(2).toPyObject()
         tag = reply.argumentAt(3).toPyObject()
         self.display_export.emit(id_, fullpath, pseudopath, tag)
示例#7
0
 def GetAll_done(self, call):
     reply = QtDBus.QDBusPendingReply(call)
     if reply.isError():
         self.show_status.emit(False,
                               "DBus error:" + str(reply.error().message()))
     else:
         # what follows is DBus+Qt magic.  We get a Variant object back
         # which contains a "map", aka "dict" in python.  Each item in
         # the map has a variant as a key and a variant as the value
         # first unwrap the top variant into d...
         # then walk d, unwrap the variant key to store the unwrapped
         # variant value into a string value.
         prop_dict = {}
         d = reply.value().toPyObject()
         for key in d.keys():
             prop_dict[str(key.toString())] = str(d[key].toPyObject().toString())
         self.show_components.emit(prop_dict)