2016-03-13, 06:22
I am currently writing a program code to delete useless stuff in order to save memory on my device.
so far i have been able to do the following:
- clear cache folder
- delete the "kodi.old.log" file
- delete the thumbnail folder (full folder)
- delete the files within Database folder (not able to delete Addons19.db & Texture13.db)
- delete the packages folder within addons folder
what i need help with
is there a possibility to delete those 2 db files?
also, i have wizard that i use to load the onto android box
what i want to is within the wizard i want to be able to delete the previous folder and then install my backup
I have the code that does what i want but i have to hard code the folders that i want to save within the addons folder in default.py
i want to be able to enter the folders name in text file and read the text file in the default.py and work from there.
part that is commented out is what i am trying but its not working
myAddonPath = kodi\addons\plugin.program.cleanup_tool\
any help would be much appreciated
once done i would be releasing the addon for the community
so far i have been able to do the following:
- clear cache folder
- delete the "kodi.old.log" file
- delete the thumbnail folder (full folder)
- delete the files within Database folder (not able to delete Addons19.db & Texture13.db)
- delete the packages folder within addons folder
what i need help with
is there a possibility to delete those 2 db files?
Code:
def deleteThumbnails():
if os.path.exists(thumbnailPath)==True:
try: shutil.rmtree(thumbnailPath)
except: pass
also, i have wizard that i use to load the onto android box
what i want to is within the wizard i want to be able to delete the previous folder and then install my backup
I have the code that does what i want but i have to hard code the folders that i want to save within the addons folder in default.py
i want to be able to enter the folders name in text file and read the text file in the default.py and work from there.
Code:
def deleteAddons():
saveFolders = ["<FOLDER NAME I NEED TO SAVE>"
#saveFolders = []
#text_file_path = os.path.join(myAddonPath, "SaveAddonFolders.txt")
#with open(text_file_path, "r") as reader:
# saveFolders = list(reader)
#open_file.close()
if os.path.exists(addonPath)==True:
for d in os.listdir(addonPath):
if d not in saveFolders:
try: os.remove(os.path.join(addonPath,d))
except: shutil.rmtree(os.path.join(addonPath,d))
dialog = xbmcgui.Dialog()
#dialog.ok("Maintenance Tool", "Done deleting extra addons")
dialog.ok("Maintenance Tool", d)
myAddonPath = kodi\addons\plugin.program.cleanup_tool\
any help would be much appreciated
once done i would be releasing the addon for the community