fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
eb9291fce7
commit
1b4ba2089a
19 changed files with 248 additions and 205 deletions
|
@ -78,7 +78,7 @@ class CoreposHandler(GenericHandler):
|
|||
|
||||
return model
|
||||
|
||||
def make_session_office_op(self, dbkey='default', **kwargs):
|
||||
def make_session_office_op(self, dbkey="default", **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'op' DB.
|
||||
|
||||
|
@ -87,11 +87,11 @@ class CoreposHandler(GenericHandler):
|
|||
"""
|
||||
from corepos.db.office_op import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_op_engines[dbkey]
|
||||
if "bind" not in kwargs:
|
||||
kwargs["bind"] = self.config.core_office_op_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_office_trans(self, dbkey='default', **kwargs):
|
||||
def make_session_office_trans(self, dbkey="default", **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'trans' DB.
|
||||
|
||||
|
@ -100,11 +100,11 @@ class CoreposHandler(GenericHandler):
|
|||
"""
|
||||
from corepos.db.office_trans import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_trans_engines[dbkey]
|
||||
if "bind" not in kwargs:
|
||||
kwargs["bind"] = self.config.core_office_trans_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_office_arch(self, dbkey='default', **kwargs):
|
||||
def make_session_office_arch(self, dbkey="default", **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Office 'arch' DB.
|
||||
|
||||
|
@ -113,11 +113,11 @@ class CoreposHandler(GenericHandler):
|
|||
"""
|
||||
from corepos.db.office_arch import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_office_arch_engines[dbkey]
|
||||
if "bind" not in kwargs:
|
||||
kwargs["bind"] = self.config.core_office_arch_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_lane_op(self, dbkey='default', **kwargs):
|
||||
def make_session_lane_op(self, dbkey="default", **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Lane 'op' DB.
|
||||
|
||||
|
@ -126,11 +126,11 @@ class CoreposHandler(GenericHandler):
|
|||
"""
|
||||
from corepos.db.lane_op import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_lane_op_engines[dbkey]
|
||||
if "bind" not in kwargs:
|
||||
kwargs["bind"] = self.config.core_lane_op_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def make_session_lane_trans(self, dbkey='default', **kwargs):
|
||||
def make_session_lane_trans(self, dbkey="default", **kwargs):
|
||||
"""
|
||||
Make a new :term:`db session` for the CORE Lane 'trans' DB.
|
||||
|
||||
|
@ -139,8 +139,8 @@ class CoreposHandler(GenericHandler):
|
|||
"""
|
||||
from corepos.db.lane_trans import Session
|
||||
|
||||
if 'bind' not in kwargs:
|
||||
kwargs['bind'] = self.config.core_lane_trans_engines[dbkey]
|
||||
if "bind" not in kwargs:
|
||||
kwargs["bind"] = self.config.core_lane_trans_engines[dbkey]
|
||||
return Session(**kwargs)
|
||||
|
||||
def get_office_url(self, require=False):
|
||||
|
@ -154,15 +154,11 @@ class CoreposHandler(GenericHandler):
|
|||
|
||||
:returns: URL as string.
|
||||
"""
|
||||
url = self.config.get('corepos.office.url', require=require)
|
||||
url = self.config.get("corepos.office.url", require=require)
|
||||
if url:
|
||||
return url.rstrip('/')
|
||||
return url.rstrip("/")
|
||||
|
||||
def get_office_department_url(
|
||||
self,
|
||||
dept_id,
|
||||
office_url=None,
|
||||
require=False):
|
||||
def get_office_department_url(self, dept_id, office_url=None, require=False):
|
||||
"""
|
||||
Returns the CORE Office URL for a Department.
|
||||
|
||||
|
@ -178,13 +174,9 @@ class CoreposHandler(GenericHandler):
|
|||
if not office_url:
|
||||
office_url = self.get_office_url(require=require)
|
||||
if office_url:
|
||||
return f'{office_url}/item/departments/DepartmentEditor.php?did={dept_id}'
|
||||
return f"{office_url}/item/departments/DepartmentEditor.php?did={dept_id}"
|
||||
|
||||
def get_office_employee_url(
|
||||
self,
|
||||
employee_id,
|
||||
office_url=None,
|
||||
require=False):
|
||||
def get_office_employee_url(self, employee_id, office_url=None, require=False):
|
||||
"""
|
||||
Returns the CORE Office URL for an Employee.
|
||||
|
||||
|
@ -200,13 +192,9 @@ class CoreposHandler(GenericHandler):
|
|||
if not office_url:
|
||||
office_url = self.get_office_url(require=require)
|
||||
if office_url:
|
||||
return f'{office_url}/admin/Cashiers/CashierEditor.php?emp_no={employee_id}'
|
||||
return f"{office_url}/admin/Cashiers/CashierEditor.php?emp_no={employee_id}"
|
||||
|
||||
def get_office_likecode_url(
|
||||
self,
|
||||
likecode_id,
|
||||
office_url=None,
|
||||
require=False):
|
||||
def get_office_likecode_url(self, likecode_id, office_url=None, require=False):
|
||||
"""
|
||||
Returns the CORE Office URL for a Like Code.
|
||||
|
||||
|
@ -222,13 +210,9 @@ class CoreposHandler(GenericHandler):
|
|||
if not office_url:
|
||||
office_url = self.get_office_url(require=require)
|
||||
if office_url:
|
||||
return f'{office_url}/item/likecodes/LikeCodeEditor.php?start={likecode_id}'
|
||||
return f"{office_url}/item/likecodes/LikeCodeEditor.php?start={likecode_id}"
|
||||
|
||||
def get_office_product_url(
|
||||
self,
|
||||
upc,
|
||||
office_url=None,
|
||||
require=False):
|
||||
def get_office_product_url(self, upc, office_url=None, require=False):
|
||||
"""
|
||||
Returns the CORE Office URL for a Product.
|
||||
|
||||
|
@ -244,13 +228,9 @@ class CoreposHandler(GenericHandler):
|
|||
if not office_url:
|
||||
office_url = self.get_office_url(require=require)
|
||||
if office_url:
|
||||
return f'{office_url}/item/ItemEditorPage.php?searchupc={upc}'
|
||||
return f"{office_url}/item/ItemEditorPage.php?searchupc={upc}"
|
||||
|
||||
def get_office_vendor_url(
|
||||
self,
|
||||
vend_id,
|
||||
office_url=None,
|
||||
require=False):
|
||||
def get_office_vendor_url(self, vend_id, office_url=None, require=False):
|
||||
"""
|
||||
Returns the CORE Office URL for a Vendor.
|
||||
|
||||
|
@ -266,4 +246,4 @@ class CoreposHandler(GenericHandler):
|
|||
if not office_url:
|
||||
office_url = self.get_office_url(require=require)
|
||||
if office_url:
|
||||
return f'{office_url}/item/vendors/VendorIndexPage.php?vid={vend_id}'
|
||||
return f"{office_url}/item/vendors/VendorIndexPage.php?vid={vend_id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue