8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-06 01:46:27 +00:00
re2o/printer/settings.py

63 lines
1.6 KiB
Python
Raw Normal View History

"""printer.settings
Define variables used in printer app
"""
2018-10-25 23:30:21 +00:00
from django.utils.translation import ugettext_lazy as _
from preferences.models import OptionalPrinter
settings = OptionalPrinter.objects.get()
MAX_PRINTFILE_SIZE = settings.max_size * 1024 * 1024 # 25 MB
ALLOWED_TYPES = ['application/pdf']
2018-09-08 12:04:44 +00:00
A3_enabled = settings.A3_enabled
booklet_enabled = settings.booklet_enabled
color_enabled = settings.color_enabled
stapling_enabled = settings.stapling_enabled
perforation_enabled = settings.perforation_enabled
FORMAT_AVAILABLE = (
2018-10-25 23:30:21 +00:00
('A4', _('A4')),
('A3', _('A3')),
)
COLOR_CHOICES = (
2018-10-25 23:30:21 +00:00
('Greyscale', _('Greyscale')),
('Color', _('Color'))
)
DISPOSITIONS_AVAILABLE = (
2018-10-25 23:30:21 +00:00
('TwoSided', _('Two sided')),
('OneSided', _('One sided')),
('Booklet', _('Booklet'))
)
STAPLING_OPTIONS = (
2018-10-25 23:30:21 +00:00
('None', _('None')),
('TopLeft', _('One top left')),
('TopRight', _('One top right')),
('LeftSided', _('Two left sided')),
('RightSided', _('Two right sided'))
)
PERFORATION_OPTIONS = (
2018-10-25 23:30:21 +00:00
('None', _('None')),
('TwoLeftSidedHoles', _('Two left sided holes')),
('TwoRightSidedHoles', _('Two right sided holes')),
('TwoTopHoles', _('Two top holes')),
('TwoBottomHoles', _('Two bottom holes')),
('FourLeftSidedHoles', _('Four left sided holes')),
('FourRightSidedHoles', _('Four right sided holes'))
)
2018-09-08 12:04:44 +00:00
## Config
## Depreciation
depr = settings.depreciation_coef
2018-09-08 12:04:44 +00:00
PRICES = {
'Depreciation': depr,
'A3': settings.A3_price,
'A4': settings.A4_price,
'Color': settings.Color_price + depr,
'Greyscale': settings.Greyscale_price + depr,
'Staples': settings.Staples_price,
2018-09-08 12:04:44 +00:00
}