Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Wrap this into a class that can be imported into other projects #2

Open
sahlberg opened this issue Apr 16, 2021 · 5 comments
Assignees

Comments

@sahlberg
Copy link

sahlberg commented Apr 16, 2021

Do you have any plans of making this useful also to be imported as a class into other projects and not only a standalone executable?
I ask because I am putting together a universal psx installer program for all platforms psx games can be played over at:
https://github.com/sahlberg/pop-fe
Excuse the hyperbole of mine, but PSIO is one beloved target that I want to support and CUE2CU2 suport would be nice.
I support PSIO right now in the sense it automatically discovers the game-id, game-name and fetches box art for it, and installs it onto the sd-card for psio, with boxart and also with MULTIDISC.LTS if it is a multidisc game. But adding cue2cu2 would make i t even bettar.

If you want to see what I mean with making it into a class, please see my repo for pop-fe and sor example bchunk.py, which is a version on bchunk in python3, but it is designed in such a way that it can either be run as an independent program :
if name == "main":

Or, as I use it from pop-fe, also be used as "import bchunk" and then I programatically do the same thing from my main program.

If you have no plans of this, would you be willing to take a pull request if I make those changes to cue2cu2 ?

Great work though. PS1 Is awesome and everyone that works on making it even awesomerer is great!

@NRGDEAD
Copy link
Owner

NRGDEAD commented Apr 16, 2021

I shall have a look at this over the weekend. :-)

@NRGDEAD NRGDEAD self-assigned this Apr 16, 2021
@NRGDEAD
Copy link
Owner

NRGDEAD commented Apr 18, 2021

Hm, so the thing is, I never messed with OOP other than a bit in theory. And the way I see it, at least some of the code would have to be rewritten and much would have to be restructured, wouldn't it? For example, the program's main function, unless -1/--stdout is given, would directly write the output CU2 sheet. Would the class still do that?

I wouldn't want a pull request at this time because I'd still need to understand what happens when and how, in case I need to modify things later. ;-)

@sahlberg
Copy link
Author

sahlberg commented Apr 19, 2021 via email

@NRGDEAD
Copy link
Owner

NRGDEAD commented Apr 20, 2021

I'll see if I can implement this in the near future. But I can't give an ETA at the moment. :-)

@sahlberg
Copy link
Author

Ok,
For the time being I have added code to just call out to cue2cu2.py via subprocess IFF the user has installed it in the same directory as where my pop-fe is installed. So no urgency.

Looking forward to see what you can come up with since it would be nice to have a more close integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants