Check-in [60feceaf39]
Overview
Comment: | Try/catch abent cache/ or icons/ folders in ~/.config/streamtuner2/ |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
60feceaf3915839831b16e0e43bb471e |
User & Date: | mario on 2017-01-01 15:32:00 |
Other Links: | manifest | tags |
Context
2017-01-01
| ||
15:33 | Remove full config folder for uninstall.cmd check-in: ce35771e44 user: mario tags: trunk | |
15:32 | Try/catch abent cache/ or icons/ folders in ~/.config/streamtuner2/ check-in: 60feceaf39 user: mario tags: trunk | |
15:31 | Fix typo in default config save/load filename. check-in: 7b225c5888 user: mario tags: trunk | |
Changes
Modified contrib/cachereset.py from [8b61178eba] to [3bc4b461a7].
︙ | ︙ | |||
58 59 60 61 62 63 64 | s3 = self.foldersize(conf.tmp) / 1024 self.l1.set_text("Channels (%s KB)" % s1) self.l2.set_text("Icons (%s KB)" % s2) self.l3.set_text("Temp (%s KB)" % s3) # Calculate folder size (flat dir) def foldersize(self, p): | > > | > > > > | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | s3 = self.foldersize(conf.tmp) / 1024 self.l1.set_text("Channels (%s KB)" % s1) self.l2.set_text("Icons (%s KB)" % s2) self.l3.set_text("Temp (%s KB)" % s3) # Calculate folder size (flat dir) def foldersize(self, p): if os.path.exists(p): try: return sum([os.path.getsize(p+"/"+fn) for fn in os.listdir(p)]) except: pass return 0 # Actually delete stuff def execute(self, *w): for dir, btn in [(conf.dir+"/cache/", self.t1), (conf.dir+"/icons/", self.t2), (conf.tmp+"/", self.t3)]: # check if checked if not btn.get_state(): continue # list dir + delete files for fn in os.listdir(dir): os.unlink(dir + fn) open(dir + ".nobackup", "a").close() self.dialog_update() |