Esempio n. 1
0
 def setPort(self):
     config.AdvancedMovieSelection.server_port.save()
     port = config.AdvancedMovieSelection.server_port.value
     for client in getClients():
         if client.getAddress() != self.staticIP:
             client.setPort(port)
         else:
             # this only set the port of local client !don't reconnect it!
             client.port = port
     serverInstance.reconnect(port=port)
Esempio n. 2
0
 def setPort(self):
     config.AdvancedMovieSelection.server_port.save() 
     port = config.AdvancedMovieSelection.server_port.value
     for client in getClients():
         if client.getAddress() != self.staticIP:
             client.setPort(port)
         else:
             # this only set the port of local client !don't reconnect it!
             client.port = port
     serverInstance.reconnect(port=port)
Esempio n. 3
0
 def reload(self):
     self.list = []
     for client in getClients():
         self.list.append((client, ))
         print client.getAddress()
     self.l.setList(self.list)
Esempio n. 4
0
 def setWindowTitle(self):
     self.setTitle(_("Advanced Movie Selection - Wastebasket"))
     if not config.AdvancedMovieSelection.askdelete.value and config.AdvancedMovieSelection.showinfo.value:
         self["warning"].setText(
             _("ATTENTION: Ask before delete is disabled!"))
     if not self.inited:
         self.delayTimer.start(0, 1)
         self.inited = True
     value = int(config.AdvancedMovieSelection.auto_empty_wastebasket.value)
     if value != -1:
         if config.AdvancedMovieSelection.last_auto_empty_wastebasket.value == 0:
             self["autoemptylast"].setText(
                 _("Last automated wastebasket empty:") + ' ' + _("Never!"))
         else:
             t = localtime(config.AdvancedMovieSelection.
                           last_auto_empty_wastebasket.value)
             lastUpdateCheck_time = strftime(("%02d.%02d.%04d" %
                                              (t[2], t[1], t[0])) + ' ' +
                                             _("at") + ' ' +
                                             ("%02d:%02d" % (t[3], t[4])) +
                                             ' ' + _("Clock"))
             self["autoemptylast"].setText(
                 _("Last automated wastebasket empty at %s") %
                 lastUpdateCheck_time)
         t = localtime(config.AdvancedMovieSelection.
                       next_auto_empty_wastebasket.value)
         nextUpdateCheck_time = strftime(("%02d.%02d.%04d" %
                                          (t[2], t[1], t[0])) + ' ' +
                                         _("at") + ' ' + ("%02d:%02d" %
                                                          (t[3], t[4])) +
                                         ' ' + _("Clock"))
         self["autoemptynext"].setText(
             _("Next automated wastebasket empty at %s") %
             nextUpdateCheck_time)
     else:
         if self.staticIP:
             for client in getClients():
                 if client is not None:
                     lastEmptyEvent = client.lastTrashEvent()
                     if lastEmptyEvent != -1:
                         t = localtime(lastEmptyEvent)
                         self["autoemptylast"].setText(
                             _("Last remote wastebasket empty at %s") %
                             (strftime(("%02d.%02d.%04d" %
                                        (t[2], t[1], t[0])) + ' ' +
                                       _("at") + ' ' +
                                       ("%02d:%02d" %
                                        (t[3], t[4])) + ' ' + _("Clock"))))
                     nextEmptyEvent = client.nextTrashEvent()
                     if nextEmptyEvent != -1:
                         t = localtime(nextEmptyEvent)
                         self["autoemptynext"].setText(
                             _("Next remote wastebasket empty at %s") %
                             (strftime(("%02d.%02d.%04d" %
                                        (t[2], t[1], t[0])) + ' ' +
                                       _("at") + ' ' +
                                       ("%02d:%02d" %
                                        (t[3], t[4])) + ' ' + _("Clock"))))
                 else:
                     self["autoemptylast"].setText(
                         _("No last empty status available!"))
                     self["autoemptynext"].setText(
                         _("No next empty status available!"))
         else:
             self["autoemptylast"].setText(
                 _("Auto empty wastebasket is disabled"))
Esempio n. 5
0
 def reload(self):
     self.list = []
     for client in getClients():
         self.list.append((client,))
         print client.getAddress()
     self.l.setList(self.list)
Esempio n. 6
0
 def setWindowTitle(self):
     self.setTitle(_("Advanced Movie Selection - Wastebasket"))
     if not config.AdvancedMovieSelection.askdelete.value and config.AdvancedMovieSelection.showinfo.value:
         self["warning"].setText(_("ATTENTION: Ask before delete is disabled!"))
     if not self.inited:
         self.delayTimer.start(0, 1)
         self.inited = True
     value = int(config.AdvancedMovieSelection.auto_empty_wastebasket.value)
     if value != -1:
         if config.AdvancedMovieSelection.last_auto_empty_wastebasket.value == 0:
             self["autoemptylast"].setText(_("Last automated wastebasket empty:") + " " + _("Never!"))
         else:
             t = localtime(config.AdvancedMovieSelection.last_auto_empty_wastebasket.value)
             lastUpdateCheck_time = strftime(
                 ("%02d.%02d.%04d" % (t[2], t[1], t[0]))
                 + " "
                 + _("at")
                 + " "
                 + ("%02d:%02d" % (t[3], t[4]))
                 + " "
                 + _("Clock")
             )
             self["autoemptylast"].setText(_("Last automated wastebasket empty at %s") % lastUpdateCheck_time)
         t = localtime(config.AdvancedMovieSelection.next_auto_empty_wastebasket.value)
         nextUpdateCheck_time = strftime(
             ("%02d.%02d.%04d" % (t[2], t[1], t[0]))
             + " "
             + _("at")
             + " "
             + ("%02d:%02d" % (t[3], t[4]))
             + " "
             + _("Clock")
         )
         self["autoemptynext"].setText(_("Next automated wastebasket empty at %s") % nextUpdateCheck_time)
     else:
         if self.staticIP:
             for client in getClients():
                 if client is not None:
                     lastEmptyEvent = client.lastTrashEvent()
                     if lastEmptyEvent != -1:
                         t = localtime(lastEmptyEvent)
                         self["autoemptylast"].setText(
                             _("Last remote wastebasket empty at %s")
                             % (
                                 strftime(
                                     ("%02d.%02d.%04d" % (t[2], t[1], t[0]))
                                     + " "
                                     + _("at")
                                     + " "
                                     + ("%02d:%02d" % (t[3], t[4]))
                                     + " "
                                     + _("Clock")
                                 )
                             )
                         )
                     nextEmptyEvent = client.nextTrashEvent()
                     if nextEmptyEvent != -1:
                         t = localtime(nextEmptyEvent)
                         self["autoemptynext"].setText(
                             _("Next remote wastebasket empty at %s")
                             % (
                                 strftime(
                                     ("%02d.%02d.%04d" % (t[2], t[1], t[0]))
                                     + " "
                                     + _("at")
                                     + " "
                                     + ("%02d:%02d" % (t[3], t[4]))
                                     + " "
                                     + _("Clock")
                                 )
                             )
                         )
                 else:
                     self["autoemptylast"].setText(_("No last empty status available!"))
                     self["autoemptynext"].setText(_("No next empty status available!"))
         else:
             self["autoemptylast"].setText(_("Auto empty wastebasket is disabled"))