Example #1
0
def load_tasbat():
    for root, dirs, files in os.walk('test-data'):
        f_found_files = []
        tasbats_to_process = []
        for file in files:
            f_tasbat = re.search('TASBAT', file)

            if f_tasbat and os.path.isfile('test-data/' + f_tasbat.string):
                print(bcolors.OKGREEN + 'TASBAT found file: {}, executing'.format(f_tasbat.string) + bcolors.ENDC)
                tasbats_to_process.append(openbook.openbook('test-data/' + f_tasbat.string, sheet_type='TASBAT'))
                # return a list of TASBAT objects
                return tasbats_to_process
Example #2
0
def load_tasbat():
    for root, dirs, files in os.walk('test-data'):
        f_found_files = []
        tasbats_to_process = []
        for file in files:
            f_tasbat = re.search('TASBAT', file)

            if f_tasbat and os.path.isfile('test-data/' + f_tasbat.string):
                print(bcolors.OKGREEN +
                      'TASBAT found file: {}, executing'.format(
                          f_tasbat.string) + bcolors.ENDC)
                tasbats_to_process.append(
                    openbook.openbook('test-data/' + f_tasbat.string,
                                      sheet_type='TASBAT'))
                # return a list of TASBAT objects
                return tasbats_to_process
Example #3
0
__author__ = 'josh'

import openbook
import datetime
from operator import itemgetter, attrgetter, methodcaller

SP_Lve_records = openbook.openbook('test-data/Absence-Details.xls', sheet_type='LVE')

class LR:
    def __init__(self, whois):
        self.whois = whois
        self.LEAVE_VAL = []

    def add_vals(self, Fromdate, Todate):
        self.LEAVE_VAL.append(Fromdate)
        self.LEAVE_VAL.append(Todate)

# controlled by list of processed LRs.  Name of LRs that are processed append to processed_records to not repeat
lrs = []
processed_records = []
output = []
for x in SP_Lve_records:

    # identifier from the record loaded first
    this_record = x.whois

    # see if we did the record already, if not, create the object, then look through the entire SP_Lve_Records list
    # appending the leave dates that relate to the record we have selected.
    if this_record not in processed_records:
        processed_records.append(this_record)
        new_records_object = LR(this_record)
Example #4
0
__author__ = 'josh'

import datetime
import openbook

SP_Lve_records = openbook.openbook('test-data/Absence-Details.xls',
                                   sheet_type='LVE')


class LR:
    def __init__(self, whois):
        self.whois = whois
        self.LEAVE_VAL = []

    def add_vals(self, Fromdate, Todate):
        self.LEAVE_VAL.append(Fromdate)
        self.LEAVE_VAL.append(Todate)


# controlled by list of processed LRs.  Name of LRs that are processed append to processed_records to not repeat
lrs = []
processed_records = []
output = []
for x in SP_Lve_records:

    # identifier from the record loaded first
    this_record = x.whois

    # see if we did the record already, if not, create the object, then look through the entire SP_Lve_Records list
    # appending the leave dates that relate to the record we have selected.
    if this_record not in processed_records: