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

Spelling and linting #126

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SCAutolib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True,
"""
if return_code is None:
return_code = [0]
if type(cmd) == str:
if isinstance(cmd, str):
cmd = cmd.split(" ")
logger.debug(f"run: {' '.join([str(i) for i in cmd])}")
out = subprocess.run(cmd, stdout=stdout, stderr=stderr, encoding="utf-8",
Expand Down
2 changes: 1 addition & 1 deletion SCAutolib/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def setup_system(self, install_missing: bool, gdm: bool, graphical: bool):

if graphical:
run(['dnf', 'groupinstall', 'Server with GUI', '-y'])
# disable subsription message
# disable subscription message
run(['systemctl', '--global', 'mask',
'org.gnome.SettingsDaemon.Subscription.target'])
# disable welcome message
Expand Down
2 changes: 1 addition & 1 deletion SCAutolib/models/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def load(json_file, **kwars):

card = None
if cnt["type"] == "virtual":
assert "user" in kwars.keys(),\
assert "user" in kwars.keys(), \
"No user is provided to load the card."
card = VirtualCard(user=kwars["user"],
softhsm2_conf=Path(cnt["softhsm"]))
Expand Down
2 changes: 1 addition & 1 deletion SCAutolib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def user_factory(username, **kwargs):
user = None
if user_file.exists():
result = BaseUser.load(user_file, **kwargs)
if type(result) == tuple:
if isinstance(result, tuple):
user, card_file = result
logger.debug(f"Loading card from {card_file}")
user.card = Card.load(card_file, user=user)
Expand Down
2 changes: 1 addition & 1 deletion test/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_create_fail(file_test_prepare):
file_test = file_test_prepare
with file_test._conf_file.open('w') as config:
config.write('Test config file')
with pytest.raises(FileExistsError, match=f'{file_test._conf_file } '
with pytest.raises(FileExistsError, match=f'{file_test._conf_file} '
f'already exists'):
file_test.create()

Expand Down
Loading