Ejemplo n.º 1
0
 def save(self):
     servers = []
     for nscfg in self._nameservers:
         if isinstance(nscfg, ConfigIP):
             servers.append(toIP4String(nscfg))
         elif isinstance(nscfg, ConfigIP6):
             servers.append(nscfg.value)
     self._service.setNameserversConfig(StringList(servers))
Ejemplo n.º 2
0
    def _reload(self):
        result = self._db.getParentDirectories()
        currentDir = self._db.getCurrentScanPath()
        enqueued = StringList()
        self._db.getEnqueuedPaths(enqueued)
        l = []

        for dir in result.data():
            path = str(dir["path"])
            if path == currentDir:
                count = _("scanning...")
            else:
                if path in enqueued:
                    count = _("enqueued for future scan...")
                else:
                    dir_id = str(dir["id"])
                    params = StringList((dir_id, dir_id))
                    count = self._db.query(
                        """SELECT COUNT(t_files.id) as count
									 FROM t_files
									  INNER JOIN t_directories
									   ON ( t_directories.id = t_files.dir_id AND parent_id = ? )
									   OR ( t_directories.id =  t_files.dir_id and t_directories.id = ? );""",
                        params)
                    try:
                        count = count.data()[0]["count"]
                    except:
                        count = _("n/a")
            item = "%s (%s)" % (path, count)

            l.append((item, dir))
        index = self["list"].index
        if index > len(l) - 1:
            index = len(l) - 1

        self["list"].list = l
        self["list"].index = index
Ejemplo n.º 3
0
 def _get_res(self):
     return self._db.query("SELECT * from video WHERE hd=?;",
                           StringList(["0"]))
Ejemplo n.º 4
0
	def __getSDVideos(self, item):
		self.__getFolderContent = None
		res = self._db.query("SELECT * from video WHERE hd=?;", StringList(["0"]))
		self._processResult(res)
 def __init__(self):
     eUriResolver.__init__(self, StringList(self._schemas))
     Log.i(self._schemas)
Ejemplo n.º 6
0
 def save(self):
     servers = [x.value for x in self._timeservers]
     self._nm.setTimeservers(StringList(servers))
	def __init__(self):
		Log.w(self._schemas)
		eUriResolver.__init__(self, StringList(self._schemas))