Comments (7)
I am adding the following two imports to main.py
import patoolib
from pathlib import Path
I am also adding patool
to the requirments.txt
file as a dependency.
from modbuddy.
I am trying to make this improvement myself, but currently after successfully adding the new mod in with patools, ModBuddy doesnt seem to update its mods list in the json files and therefore refresh the GUI with the new mod row.
from modbuddy.
Thanks for the issue. I'm glad to hear that this project is used in a game i'm patiently waiting for further development on.
Regarding patool, i'm noticing that the last release is back in 2016. As long as the package doesn't seem to create any issues with newer versions of python (>=3.9
), I'd be thrilled to extend this functionality.
In the example you provided, does the folder actually extracts to the correct place? My suspicion is that patooolib throws FileNoutFoundError
, which would prevent calling self.add_mod()
in this case (else-clauses in a try-block only fires if there's no handled/unhandled exceptions).
from modbuddy.
You are correct about FileNotFoundError
, I have reworked the above pseudo code to a working improvement. I just haven't cleaned it up yet to do a PR. After talking with another developer I went with a code solution that remove the try
clause and has the target_directory
created just before the patoolib extraction.
The main reason i decided this was good enough is because FileNotFoundError shouldn't be the error to populate if the directory is made just before instantiation. There are a other reasons to have a try/except
there for the archive extraction, but I wanted to focus on the improvement.
from modbuddy.
If you feel like assigning this to me, I expect to have a PR here at some point in the week.
from modbuddy.
Glad to hear that. Feel free to provide a solution when ever you have the time, and I'll be happy to look over it.
Regarding removal of the try
clause: I'm hesitant to remove that in this case, however it isn't there because of a missing file (judging by your draft which is using FileNotFoundError
), but because of potential errors with the archive, such as something unexpected errors regarding the archive itself.
For instance, Shutil.ReadError
can occur when an archive is unable to extract for an unspecified reason, such as corrupt data (even though my implementation heavily hints that it is due to an unsupported archive).
from modbuddy.
That was my inference. With patoolib
taking over for shutil
I knew that particular pain should not populate. Though the corrupted archive is a real risk.
from modbuddy.
Related Issues (16)
- Backup volatile mod folder before use
- Implement dirty bit
- Consider refactoring to DearPyGui HOT 1
- Flip the default column spacing for the name and path fields HOT 2
- Base content a duplicated variable caused unexpected bug during repeated testing HOT 3
- Required steps to "resetting" ModBuddy HOT 3
- modbuddy mod file linking some how causing mod loading errors in java game. HOT 7
- Split up application logic from the GUI
- Ensure that disabled mods are removed
- Improve presets HOT 1
- CRUD-ify the mod table HOT 2
- Implement option of new autosaved presets
- Error on first start HOT 4
- Handle issues regarding case sensitivity
- Extract text strings from code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modbuddy.