JamesPy
Coder
Hey guys! I'm making a virtual assistant using python (and probably JS for UI when I can be bothered to). I've got alot of it made already, 4 different version to be exact, and I am planning on open sourcing it soon. Before I do this I have a checklist of what needs to be done before I open source the software, on this checklist is auto-updating / being able to update without redownloading the software. I managed to do this without any tutorials, but just a basic version, and currently it can only update existing files it can't add new files from the github repository. I have an idea of how to expand it to actually create new files that I put on the github but I need opinions on if there is a better way.
Right now what I do is I check the version of the github repository and then the version of the code thats running, if they are different then it will ask the user if they want to update. If the user says yes it will loop through all the files in the src folder, and their subfolders and then it will attempt to find it in the github repository. If it does find this file then it will just do a write to the file on your PC with the contents of the githubs file. This works fine right now. The only issue is, when I start adding new things such as new commands or new features, they won't be updated as they will be in a seperate file and this code only updates files that already exist.
I have an idea of how to solve this:
- It does what it already does first and then checks for files that dont exist (i don't know exactly how to search for a file you dont know the name of on github, but i'll figure something out)
- If it cant find the file/folder in the src folder on your PC then it will create it with the contents from the github.
I believe this will work but my main issue is efficiency. I want this code to run fast and be as efficient as I can make it since others will be using it. If anybody knows a better way to do this I would appreciate it. (If you need code snippets I can provide them)
Right now what I do is I check the version of the github repository and then the version of the code thats running, if they are different then it will ask the user if they want to update. If the user says yes it will loop through all the files in the src folder, and their subfolders and then it will attempt to find it in the github repository. If it does find this file then it will just do a write to the file on your PC with the contents of the githubs file. This works fine right now. The only issue is, when I start adding new things such as new commands or new features, they won't be updated as they will be in a seperate file and this code only updates files that already exist.
I have an idea of how to solve this:
- It does what it already does first and then checks for files that dont exist (i don't know exactly how to search for a file you dont know the name of on github, but i'll figure something out)
- If it cant find the file/folder in the src folder on your PC then it will create it with the contents from the github.
I believe this will work but my main issue is efficiency. I want this code to run fast and be as efficient as I can make it since others will be using it. If anybody knows a better way to do this I would appreciate it. (If you need code snippets I can provide them)