def new_model(self) -> str: return barcode.textify(self.model_name) + barcode.tabify(2) + barcode.delayify( self.model_identifier)
def new_asset(self, asset_tag, user, form_type) -> str: status = 'Ready' return ( barcode.textify(asset_tag) + barcode.listify(self.model_identifier) + self.get_asset_sequence(form_type) + barcode.listify(status) + self.get_user_sequence(user) + barcode.delayify(self.serial_number) )
def test_barcode_data_delayify_long(): assert barcode.delayify('foo', 2) == '~d~dfoo'
def get_user_sequence(self, user) -> str: try: user_sequence = [barcode.SPACE, '({})'.format(user), barcode.ENTER, barcode.TAB] return ''.join([barcode.delayify(char) for char in user_sequence]) except TypeError('User entry is required.'): sys.exit(1)
def test_barcode_data_delayify(): assert barcode.delayify('foo') == '~dfoo'