mirror of
https://github.com/Crocmagnon/charasheet.git
synced 2024-05-19 09:22:51 +02:00
Compare commits
8 commits
9e630b041e
...
0df9713511
Author | SHA1 | Date | |
---|---|---|---|
Gabriel Augendre | 0df9713511 | ||
Gabriel Augendre | f569c9c8c1 | ||
Gabriel Augendre | f93439d0f7 | ||
Gabriel Augendre | a2a3260c3e | ||
Gabriel Augendre | fdf529d2f5 | ||
Gabriel Augendre | 4a66efd3a6 | ||
Gabriel Augendre | df3a480335 | ||
Gabriel Augendre | f4570ee55d |
5
.devcontainer/Dockerfile
Normal file
5
.devcontainer/Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye
|
||||||
|
RUN apt-get update && apt-get upgrade -y
|
||||||
|
RUN pip install pip-tools invoke
|
||||||
|
COPY requirements.in requirements.txt requirements-dev.in requirements-dev.txt constraints.txt tasks.py ./
|
||||||
|
RUN invoke sync-dependencies
|
7
.devcontainer/devcontainer.json
Normal file
7
.devcontainer/devcontainer.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"build": {
|
||||||
|
"dockerfile": "Dockerfile",
|
||||||
|
"context": ".."
|
||||||
|
},
|
||||||
|
"postStartCommand": "inv sync-dependencies && pre-commit install --install-hooks"
|
||||||
|
}
|
25
.idea/jsonSchemas.xml
Normal file
25
.idea/jsonSchemas.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JsonSchemaMappingsProjectConfiguration">
|
||||||
|
<state>
|
||||||
|
<map>
|
||||||
|
<entry key="devcontainer.json">
|
||||||
|
<value>
|
||||||
|
<SchemaInfo>
|
||||||
|
<option name="name" value="devcontainer.json" />
|
||||||
|
<option name="relativePathToSchema" value="https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json" />
|
||||||
|
<option name="applicationDefined" value="true" />
|
||||||
|
<option name="patterns">
|
||||||
|
<list>
|
||||||
|
<Item>
|
||||||
|
<option name="path" value=".devcontainer/devcontainer.json" />
|
||||||
|
</Item>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</SchemaInfo>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -40,7 +40,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: djhtml
|
- id: djhtml
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: v0.0.257
|
rev: v0.0.259
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
|
|
@ -55,7 +55,7 @@ idna==3.4
|
||||||
# via
|
# via
|
||||||
# requests
|
# requests
|
||||||
# trio
|
# trio
|
||||||
markdown==3.4.1
|
markdown==3.4.3
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
outcome==1.2.0
|
outcome==1.2.0
|
||||||
# via trio
|
# via trio
|
||||||
|
@ -67,7 +67,7 @@ requests==2.28.2
|
||||||
# via
|
# via
|
||||||
# -r requirements.in
|
# -r requirements.in
|
||||||
# django-anymail
|
# django-anymail
|
||||||
selenium==4.8.2
|
selenium==4.8.3
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
sniffio==1.3.0
|
sniffio==1.3.0
|
||||||
# via trio
|
# via trio
|
||||||
|
|
|
@ -56,6 +56,7 @@ ignore = [
|
||||||
"B011", # Do not call assert False since python -O removes these calls.
|
"B011", # Do not call assert False since python -O removes these calls.
|
||||||
"ARG001", # Unused function argument (mostly fixtures)
|
"ARG001", # Unused function argument (mostly fixtures)
|
||||||
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
|
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
|
||||||
|
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes.
|
||||||
]
|
]
|
||||||
# File {name} is part of an implicit namespace package. Add an `__init__.py`.
|
# File {name} is part of an implicit namespace package. Add an `__init__.py`.
|
||||||
"tasks.py" = ["INP001"]
|
"tasks.py" = ["INP001"]
|
||||||
|
|
|
@ -66,7 +66,7 @@ exceptiongroup==1.1.1
|
||||||
# via
|
# via
|
||||||
# -c constraints.txt
|
# -c constraints.txt
|
||||||
# trio-websocket
|
# trio-websocket
|
||||||
filelock==3.10.0
|
filelock==3.10.4
|
||||||
# via virtualenv
|
# via virtualenv
|
||||||
freezegun==1.2.2
|
freezegun==1.2.2
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
|
@ -78,7 +78,7 @@ h11==0.14.0
|
||||||
# wsproto
|
# wsproto
|
||||||
hypothesis==6.70.0
|
hypothesis==6.70.0
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
identify==2.5.21
|
identify==2.5.22
|
||||||
# via pre-commit
|
# via pre-commit
|
||||||
idna==3.4
|
idna==3.4
|
||||||
# via
|
# via
|
||||||
|
@ -166,9 +166,9 @@ requests==2.28.2
|
||||||
# bpython
|
# bpython
|
||||||
# pytest-base-url
|
# pytest-base-url
|
||||||
# pytest-selenium
|
# pytest-selenium
|
||||||
ruff==0.0.257
|
ruff==0.0.259
|
||||||
# via -r requirements-dev.in
|
# via -r requirements-dev.in
|
||||||
selenium==4.8.2
|
selenium==4.8.3
|
||||||
# via
|
# via
|
||||||
# -c constraints.txt
|
# -c constraints.txt
|
||||||
# pytest-selenium
|
# pytest-selenium
|
||||||
|
|
|
@ -55,7 +55,7 @@ idna==3.4
|
||||||
# via
|
# via
|
||||||
# requests
|
# requests
|
||||||
# trio
|
# trio
|
||||||
markdown==3.4.1
|
markdown==3.4.3
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
outcome==1.2.0
|
outcome==1.2.0
|
||||||
# via trio
|
# via trio
|
||||||
|
@ -67,7 +67,7 @@ requests==2.28.2
|
||||||
# via
|
# via
|
||||||
# -r requirements.in
|
# -r requirements.in
|
||||||
# django-anymail
|
# django-anymail
|
||||||
selenium==4.8.2
|
selenium==4.8.3
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
sniffio==1.3.0
|
sniffio==1.3.0
|
||||||
# via trio
|
# via trio
|
||||||
|
|
|
@ -304,12 +304,12 @@ class Character(models.Model):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def natural_key(self):
|
|
||||||
return (self.name, self.player_id)
|
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse("character:view", kwargs={"pk": self.pk})
|
return reverse("character:view", kwargs={"pk": self.pk})
|
||||||
|
|
||||||
|
def natural_key(self):
|
||||||
|
return (self.name, self.player_id)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def modifier_strength(self) -> int:
|
def modifier_strength(self) -> int:
|
||||||
return modifier(self.value_strength)
|
return modifier(self.value_strength)
|
||||||
|
|
|
@ -123,12 +123,12 @@ class BattleEffect(TimeStampedModel, models.Model):
|
||||||
|
|
||||||
objects = BattleEffectManager.from_queryset(BattleEffectQuerySet)()
|
objects = BattleEffectManager.from_queryset(BattleEffectQuerySet)()
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def remaining_percent(self) -> float:
|
def remaining_percent(self) -> float:
|
||||||
max_display_percent = 5
|
max_display_percent = 5
|
||||||
if self.remaining_rounds >= max_display_percent or self.remaining_rounds < 0:
|
if self.remaining_rounds >= max_display_percent or self.remaining_rounds < 0:
|
||||||
return 100
|
return 100
|
||||||
return self.remaining_rounds / max_display_percent * 100
|
return self.remaining_rounds / max_display_percent * 100
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
Loading…
Reference in a new issue