EntityScript

Draft 1.2:
Index


ingest_commands




"""
Copyright (C) 2020 New Entity Operations Inc.

ALL RIGHTS RESERVED

ingest_commands translates 'DeductionObject' class code into object code

In this POOL-> _DEDUCTION_OBJECT

"""
## Imports: Custom
from core_middlelayer import (
 DIRDATA,
 OUTPUT_ENTITY,
 OVD
)

## Import: Resource Pool
from .ResourcePool import POOL_DEDUCTION_OBJECT

## Establish Values
R_VALUE = \
POOL_DEDUCTION_OBJECT.R_VALUE
RETURN_START_FUNC = \
POOL_DEDUCTION_OBJECT.RETURN_START_FUNC
RETURN_VALUE_SLED = \
POOL_DEDUCTION_OBJECT.RETURN_VALUE_SLED
VALUE_a = \
POOL_DEDUCTION_OBJECT.VALUE_a
VALUE_b = \
POOL_DEDUCTION_OBJECT.VALUE_b
VALUE_c = \
POOL_DEDUCTION_OBJECT.VALUE_c
VALUE_d = \
POOL_DEDUCTION_OBJECT.VALUE_d
VALUE_e = \
POOL_DEDUCTION_OBJECT.VALUE_e
VALUE_f = \
POOL_DEDUCTION_OBJECT.VALUE_f
VALUE_g = \
POOL_DEDUCTION_OBJECT.VALUE_g

## Vectorize output data
class Vectorize:
    # retrieval by key
    def data(by_key):
        with open(DIRDATA+OVD, 'r') as file:
            line_by_line = file.readlines()
            return(line_by_line[by_key+8])
        file.close()

## Quick test, uncomment to use
# Vectorize: 
# print(vectorize_data(1))

# Specific Field: Sanity Test
# print(vectorize_data(2[0]))

class DeductionObject:
    def __init__(self, id, code, card, type, amount, date, to):
     self.id = id
     self.code = code
     self.card = card
     self.type = type
     self.amount = amount
     self.date = date
     self.to = to
    def __str__(self):
     return RETURN_START_FUNC+RETURN_VALUE_SLED.format(self=self,
      a=VALUE_a,
      b=VALUE_b,
      c=VALUE_c,
      d=VALUE_d,
      e=VALUE_e,
      f=VALUE_f,
      g=VALUE_g
     )

    def __repr__(self):
     return RETURN_START_FUNC+RETURN_VALUE_SLED.format(self=self,
      a=VALUE_a,
      b=VALUE_b,
      c=VALUE_c,
      d=VALUE_d,
      e=VALUE_e,
      f=VALUE_f,
      g=VALUE_g
    )



Return HOME