Updated code quality binary operator, ignored bare except, unicode function warnings changes in shared.py#1828
Conversation
880399c to
502b08d
Compare
431ebd6 to
32389dd
Compare
|
What's the point on editing this module? It should be removed soon and even has corresponding docstring. |
fa476c7 to
d898703
Compare
PeterSurda
left a comment
There was a problem hiding this comment.
Try moving the functions into a separate files.
There was a problem hiding this comment.
isAddressInMyAddressBook -> src/helper_addressbook.py
isAddressInMySubscriptionsList -> src/helper_addressbook.py
isAddressInMyAddressBookSubscriptionListOrWhitelist -> src/helper_addressbook.py
decodeWalletImportformat -> src/helper_wallet.py
reloadMyAddressHashes -> src/filesystem.py
reloadBroadcastSendersForWhichImWatching -> src/helper_addressbook.py
fixPotentiallyInvalidUTF8Data -> src/helper_unicode.py
checkSensitiveFilePermissions -> src/filesystem.py
fixSensitiveFilePermissions -> src/filesystem.py
did you look into #1796? I moved it into |
d898703 to
80c5c3f
Compare
remove? use b''.decode('utf-8', 'ignore') instead?
helper_startup? let's not smear side effects on the codebase. Also I'd prefer describing the code using packages and modules, not files (or worse - scripts). |
4b299cb to
b421c6e
Compare
Ok agree.
I worry we'll have more circular imports if we use
Well, there is one question about the final form, and another one about the iterative steps to get there. |
Where? I don't see it: |
|
It's called from reload hashes and this is called from several places. |
the reload hashes is still in the shared |
Yes but I asked for it to be moved too. |
Maybe move them together, into the |
|
Well, I'll try to arrange it so that it's not in conflict with your pending PRs, but I think it's OK if it's changed iteratively and moves several times, as long as it keeps working in the meantime. Having more rounds of refactoring shouldn't be an objection, as long as the individual rounds provide some benefit. The purpose of this round is to unburden Regarding key manager, well, I think that's a more complicated issue, as the crypto operations are also used inside |
|
It is not about the PR conflicts. I'm OK with conflicting PRs if they really make the code better, not just replace one bad formatting by another bad formatting or try to solve an issue already addressed in the existing PR. I think that a proper refactoring needs more research and planning because you can move it by the small steps trying to not break anything, but if you don't know where are you going to end up, the result is not gonna be great. The main source of the circular imports I can see now is the pyreverse src/network (2021-05-30 20:04:58): |
It doesn't need the private keys and maybe it shouldn't assemble the packets, just setup the PoW. I'm trying to move all the assemble code into the protocol in #1788. |
I don't necessarily disagree, but there are other problems to consider. For example, there is a backlog of PRs because they are often too exhausting to review or too difficult to test. The hurdles for new developers are too high. In summary, there is also a need to make it easier for others to contribute. I find it difficult to find experts to work on the project, and even if I do then there are often too many disagreements to get things done.
There are still steps that can be done that make it easier for new developers to contribute, or for more work to be doable in parallel. I think that this PR as an example of that.
I tend to agree about
It makes it easier for a new developer to understand the code. In first step, I have a limited time to spend on the codebase, and I know you have too. Therefore I try to focus on guiding others incrementally. I tried to have others do big planned refactorings, but it mostly doesn't work, even with moderately skilled developers it takes forever and nothing gets finished. For example #1794 appears to be roughly the limit of big refactoring that is still has some benefit. |
b55635c to
c5614a9
Compare
b1c8d35 to
0ee3235
Compare
706a63f to
5a8f591
Compare
There is already the |
5a8f591 to
0ee310b
Compare
| self.config.save() | ||
| queues.UISignalQueue.put(('writeNewAddressToTable', ('', '', ''))) | ||
| shared.reloadMyAddressHashes() | ||
| filesystem.reloadMyAddressHashes() |
There was a problem hiding this comment.
should be in a different file
| broadcastSendersForWhichImWatching = {} | ||
|
|
||
|
|
||
| def isAddressInMyAddressBook(address): |
|
|
||
|
|
||
| # At this point we should really just have a isAddressInMy(book, address)... | ||
| def isAddressInMySubscriptionsList(address): |
| return queryreturn != [] | ||
|
|
||
|
|
||
| def isAddressInMyAddressBookSubscriptionsListOrWhitelist(address): |
PeterSurda
left a comment
There was a problem hiding this comment.
Just formatting, no moving around functions.
f49cbf3 to
9a2de11
Compare
…ic exception, replaced unicode by decode function changes in shared.py Replaced unicode by decode function & added UnicodeDecodeError specific exception
9a2de11 to
894e9fc
Compare

Updated binary operator line change
Added ignore comments for bare except & unicode function warnings