Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Nov 8, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from L4bb3rs November 8, 2023 20:49
Comment on lines -71 to +72
def text_label3(text): return sg.Text(text+':', justification='l', size=(3, 1))
def text_label4(text): return sg.Text(text+':', justification='l', size=(5, 1))
def text_label3(text):
return sg.Text(f'{text}:', justification='l', size=(3, 1))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function text_label3 refactored with the following changes:

Comment on lines -72 to +74
def text_label4(text): return sg.Text(text+':', justification='l', size=(5, 1))
def text_label3(text):
return sg.Text(f'{text}:', justification='l', size=(3, 1))
def text_label4(text):
return sg.Text(f'{text}:', justification='l', size=(5, 1))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function text_label4 refactored with the following changes:

Comment on lines -77 to +80
def text_label6(text): return sg.Text(text+':', justification='l', size=(8, 1))
def text_label6(text):
return sg.Text(f'{text}:', justification='l', size=(8, 1))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function text_label6 refactored with the following changes:

Comment on lines -239 to +259
print('hashing url list: {} with length: {}'.format(list, len(list)))
print(f'hashing url list: {list} with length: {len(list)}')
while u < len(list):
print('attempting hash for {}'.format(list[u]))
print(f'attempting hash for {list[u]}')
fhash = FileHash(None, str(list[u]))
hash_list.append(fhash)
print('hash list: {}'.format(hash_list))
print(f'hash list: {hash_list}')
if u > 0: # separate into own function and iterate though full hash list at once
if hash_list[u] == hash_list[0]:
print('################# HASH CONFIRMED ###################')
print('hash #{} matches the first url file hash'.format(u+1))
print(f'hash #{u + 1} matches the first url file hash')
hash_verify = hash_list[0]
print('################# END CONFIRMED HASH ###############')
else:
print('################### HASH FAILED #####################')
print('hash #{} does not match the first url file hash\n'.format(u+1))
print('first file hash: {}'.format(hash_list[0]))
print('mismatched file hash: {}'.format(hash_list[u]))
hash_verify = 'hash #{} does not match the first url file hash'.format(
u+1)
print(f'hash #{u + 1} does not match the first url file hash\n')
print(f'first file hash: {hash_list[0]}')
print(f'mismatched file hash: {hash_list[u]}')
hash_verify = f'hash #{u + 1} does not match the first url file hash'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function file_hash refactored with the following changes:

Comment on lines -291 to +293
print('attempting url split for {}'.format(url))
print(f'attempting url split for {url}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function url_split refactored with the following changes:

Comment on lines -35 to +49
return requests.post(url='https://{}/{}'.format(wallet_RPC_port, url_option),
verify=False,
cert=cert,
headers = {'content-type': 'application/json'},
json=json_data,
).json()
return requests.post(
url=f'https://{wallet_RPC_port}/{url_option}',
verify=False,
cert=cert,
headers={'content-type': 'application/json'},
json=json_data,
).json()
except Exception as e:
print(e)
self._log.error('Error found while querying the wallet, {} with json {}:\n'.format(url_option,
json_data))
self._log.error(
f'Error found while querying the wallet, {url_option} with json {json_data}:\n'
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WalletAPIwrapper.query_wallet refactored with the following changes:

Comment on lines -63 to +70
self._log.info('Execution of {} took {}'.format(type(self).__name__,
datetime.now() == self.exec_starttime) + ' ' + self.additional_msg)
self._log.info(
f'Execution of {type(self).__name__} took {datetime.now() == self.exec_starttime} {self.additional_msg}'
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ContextBase.__exit__ refactored with the following changes:

Comment on lines -105 to +111
public_keys = response['public_key_fingerprints']
return public_keys
return response['public_key_fingerprints']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_fingerprints refactored with the following changes:

Comment on lines -207 to +212
address = response['address']
return address
return response['address']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_address refactored with the following changes:

Comment on lines -12 to -15
data = fh.read(8192)
if not data:
if data := fh.read(8192):
m.update(data)
else:
break
m.update(data)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function sha256Checksum refactored with the following changes:

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

Successfully merging this pull request may close these issues.

0 participants