def close_archive_screen(self): if not config.plugins.archivCZSK.preload.getValue(): self.__addons.clear() self.__repositories.clear() ArchivCZSK.__loaded = False # We dont need worker thread anymore so we stop it Task.stopWorkerThread() # finally save all cfg changes - edit by shamman configfile.save() # clear tmp content by shamman filelist = [ f for f in os.listdir("/tmp") if f.endswith(".url") ] for f in filelist: try: os.remove(os.path.join('/tmp', f)) except OSError: continue filelist = [ f for f in os.listdir("/tmp") if f.endswith(".png") ] for f in filelist: try: os.remove(os.path.join('/tmp', f)) except OSError: continue shutil.rmtree("/tmp/archivCZSK", True) if config.plugins.archivCZSK.clearMemory.getValue(): try: with open("/proc/sys/vm/drop_caches", "w") as f: f.write("1") except IOError as e: print 'cannot drop caches : %s' % str(e)
def close_archive_screen(self): if not config.plugins.archivCZSK.preload.getValue(): self.__addons.clear() self.__repositories.clear() ArchivCZSK.__loaded = False # We dont need worker thread anymore so we stop it Task.stopWorkerThread() # finally save all cfg changes - edit by shamman configfile.save() # clear tmp content by shamman filelist = [f for f in os.listdir("/tmp") if f.endswith(".url")] for f in filelist: try: os.remove(os.path.join('/tmp', f)) except OSError: continue filelist = [f for f in os.listdir("/tmp") if f.endswith(".png")] for f in filelist: try: os.remove(os.path.join('/tmp', f)) except OSError: continue shutil.rmtree("/tmp/archivCZSK", True) if config.plugins.archivCZSK.clearMemory.getValue(): try: with open("/proc/sys/vm/drop_caches", "w") as f: f.write("1") except IOError as e: print 'cannot drop caches : %s' % str(e)
def open_archive_screen(self, callback=None): if not ArchivCZSK.__loaded: self.load_repositories() # first screen to open when starting plugin, # so we start worker thread where we can run our tasks(ie. loading archives) Task.startWorkerThread() self.session.openWithCallback(self.close_archive_screen, ArchivCZSKContentScreen, self)