Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
Applied Black code style
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 20, 2022
1 parent e26c849 commit 259117e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
6 changes: 1 addition & 5 deletions autodonate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ def __init__(self) -> None:
)
if (BASE_DIR / "config.yml.example").is_file():
copy_file(str(BASE_DIR / "config.yml.example"), str(self.CONFIG_PATH))
log.warning(
'config.yml.example found, copied to "%s" and used '
% str(self.CONFIG_PATH)
+ "as config"
)
log.warning('config.yml.example found, copied to "%s" and used ' % str(self.CONFIG_PATH) + "as config")
self._load()

self.inter: ConfigIntermediate = ConfigIntermediate(config=self.CONFIG)
Expand Down
8 changes: 2 additions & 6 deletions autodonate/lib/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
class Item(Model):
"""Model for the given item"""

currency = SmallIntegerField(
choices=[(0, "RUB"), (1, "UAH"), (2, "USD"), (3, "EUR")], null=True
)
currency = SmallIntegerField(choices=[(0, "RUB"), (1, "UAH"), (2, "USD"), (3, "EUR")], null=True)
price = FloatField(null=True)
rcon_command = TextField(null=True)
require_nick = BooleanField(default=False)
Expand Down Expand Up @@ -55,9 +53,7 @@ def format_rcon(self) -> str:
self.process.cleanup_nickname()
if not self.process.item.rcon_command:
raise ValueError("Item.rcon_command required.")
return str(
self.process.item.rcon_command.format(nickname=self.process.nickname)
)
return str(self.process.item.rcon_command.format(nickname=self.process.nickname))

def issue(self) -> str:
return Rcon.run(self.format_rcon())
4 changes: 1 addition & 3 deletions autodonate/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,5 @@
)
)

if settings.CONFIG.get("DEBUG", True) and settings.CONFIG.get(
"DEBUG_STATICFILES_SERVER", True
):
if settings.CONFIG.get("DEBUG", True) and settings.CONFIG.get("DEBUG_STATICFILES_SERVER", True):
urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
4 changes: 1 addition & 3 deletions tests/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ def test_config_converter() -> None:
assert ConfigIntermediate._process_answer("list:1,2") == ["1", "2"]
assert ConfigIntermediate._process_answer("bool:1") is True
assert ConfigIntermediate._process_answer("bool:0") is False
assert ConfigIntermediate._process_answer('json:{"key":"value"}') == {
"key": "value"
} # noqa: E501
assert ConfigIntermediate._process_answer('json:{"key":"value"}') == {"key": "value"} # noqa: E501
assert ConfigIntermediate._process_answer("null:") is None

0 comments on commit 259117e

Please sign in to comment.