Initial work on splitting bitmessagemain.py into multiple files #238
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-18#238
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "splitting_bitmessagemain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Most code being in the single main file (bitmessagemain.py) was raised as being a possible issue for maintainability in the future - see issues https://github.com/Bitmessage/PyBitmessage/issues/235 and https://github.com/Bitmessage/PyBitmessage/issues/200.
This pull request shows my work so far towards splitting up the main file a bit. I'm finding it a little tricky and I'd really like to hear people's opinions/feedback on this.
Thanks for working on this! It will be much easier to maintain this code after the changes you're starting. In the meantime, I am nervous about major conflicts between this and pull/234 (& pull/236). Our changes are mostly basic gruntwork on bitmessagemain.py, but they already touch a lot of the file.
Since your changes are fairly modular and straightforward to redo on our changes, I'm thinking that the path of least resistance is:
What do you think of this plan?
Of course, if we had planned ahead it would have made more sense to work the other way around, starting with your changes. But alas, here we are.
I'm more experienced using SVN that Git, so I'm not all too certain of its merging capabilities. It'll be interested to see either way.
Logically, I would have to agree with @Atheros1 that merging this pull first should be less error prone (and I believe it is currently in a state that causes no regressions, based on my testing). However, I respect this may give @fiatflux and @xj9 more work dependant on how well Git performs its merging.
Regardless, I'm happy to go with either way, and wish to defer the decision to those with more Git experience than myself.
I'm fine either way, but am interested to hear what @xj9 thinks. They seem
to be rather git-adept.
Even though I don't necessarily agree that merging pull/238 first is less
error-prone, merging this first has
PROS:
Leaves a reference version in the main fork that should behave to users
just the same as the current one.
CONS:
More aggregate work for people involved.
On Fri, Jun 21, 2013 at 10:45 AM, DivineOmega notifications@github.comwrote:
On my local machine I just merged #238 and then #236 and it actually went very smoothly (few conflicts). It appears that all or most of your logger-changes have been to things that weren't migrated to other files. So I will go about testing #238 by itself and will then merge into master and then I'll manually merge in #236.
Oh, cool, glad to hear it wasn't too bad. Sounds like a good plan. I'll
still hold off on more logger conversions until main gets broken into
manageable chunks. (Especially easy since I'll be busy for several days.)
On Fri, Jun 21, 2013 at 11:30 AM, Jonathan Warren
notifications@github.comwrote:
@Atheros1 Thanks for fixing some of the import inconsistencies.
I'm curious why you decided to move the singleListener class back into the bitmessagemain file. I'd like to understand the decision and check if I missed anything important.
The singleListener class references the sendDataThread and the ReceiveDataThread classes. When it was in its own file it couldn't reference those two classes. We could do:
..but I feel like doing that sort of thing defeats the purpose of modularizing the code. If you think using import bitmessagemain is best then we can do that.
Ah, my bad. That issue did not come up in my testing as I have not set up any port forwarding, thus no incoming connections ever occurred.
I believe for the sake of splitting up the code (at least initially), we should 'import bitmessagemain'. I agree that it's probably the best we can do for now.
However, I was considering moving the sendDataThread and receiveDataThread classes into their own files, which we could then import, thus removing (or at least reducing) the need to import bitmessagemain. What do you think?
That would be perfect
Okay, I'll open up a port and see what I can do.
I've merged all of the commits in this pull request to master.
Thank you!
Great stuff. :)