Feat: packaging (#127)

- Add configuration files for packaging
- Precommit now uses ruff

Co-authored-by: bkfox <thomas bkfox net>
Reviewed-on: rc/aircox#127
This commit is contained in:
Thomas Kairos
2023-10-11 10:58:34 +02:00
parent 5ea092dba6
commit f7a61fe6c0
82 changed files with 332 additions and 935 deletions

View File

@ -67,9 +67,7 @@ class Station(models.Model):
max_length=2048,
null=True,
blank=True,
help_text=_(
"Audio streams urls used by station's player. One url " "a line."
),
help_text=_("Audio streams urls used by station's player. One url " "a line."),
)
default_cover = FilerImageField(
on_delete=models.SET_NULL,
@ -153,16 +151,10 @@ class Port(models.Model):
(TYPE_FILE, _("file")),
)
station = models.ForeignKey(
Station, models.CASCADE, verbose_name=_("station")
)
direction = models.SmallIntegerField(
_("direction"), choices=DIRECTION_CHOICES
)
station = models.ForeignKey(Station, models.CASCADE, verbose_name=_("station"))
direction = models.SmallIntegerField(_("direction"), choices=DIRECTION_CHOICES)
type = models.SmallIntegerField(_("type"), choices=TYPE_CHOICES)
active = models.BooleanField(
_("active"), default=True, help_text=_("this port is active")
)
active = models.BooleanField(_("active"), default=True, help_text=_("this port is active"))
settings = models.TextField(
_("port settings"),
help_text=_(
@ -193,8 +185,6 @@ class Port(models.Model):
def save(self, *args, **kwargs):
if not self.is_valid_type():
raise ValueError(
"port type is not allowed with the given port direction"
)
raise ValueError("port type is not allowed with the given port direction")
return super().save(*args, **kwargs)