Ejemplo n.º 1
0
class CreateItem(Task):
    def __init__(self, num):
        self._output_path = Path('item_%d_price.txt' % num)

    def target(self):
        return self._output_path

    def build(self):
        with self._output_path.open('w', encoding='UTF-8') as f:
            f.write('100')
Ejemplo n.º 2
0
class CreateItem(Task):
    def __init__(self, num):
        self._output_path = Path('item_%d_price.txt' % num)

    def target(self):
        return self._output_path

    def build(self):
        with self._output_path.open('w', encoding='UTF-8') as f:
            f.write('100')
Ejemplo n.º 3
0
class AddTaxToItem(Task):
    def __init__(self, num):
        self._output_path = Path('item_%d_tax.txt' % num)

    def target(self):
        return self._output_path

    def build(self, input_path):
        with input_path.open(encoding='UTF-8') as f:
            price = int(f.read())
        with self._output_path.open('w', encoding='UTF-8') as f:
            f.write('%d' % int(price * 1.3))
Ejemplo n.º 4
0
class AddTaxToItem(Task):
    def __init__(self, num):
        self._output_path = Path('item_%d_tax.txt' % num)

    def target(self):
        return self._output_path

    def build(self, input_path):
        with input_path.open(encoding='UTF-8') as f:
            price = int(f.read())
        with self._output_path.open('w', encoding='UTF-8') as f:
            f.write('%d' % int(price * 1.3))