def __init__(self, path="", rootDir=configuration.get_path_to_reports()):
     self.path = path
     self.rootDir = rootDir
     self.CONN_STRING = configuration.get_connection_string()
     if not self.rootDir.endswith('/'):
         self.rootDir += '/'
     self.pathParts = self.path[len(self.rootDir):].split('/')
Example #2
0
 def __init__(self, path="", rootDir=configuration.get_path_to_reports()):
     self.path = path
     self.rootDir = rootDir
     self.CONN_STRING = configuration.get_connection_string()
     if not self.rootDir.endswith('/'):
         self.rootDir += '/'
     self.pathParts = self.path[len(self.rootDir):].split('/')
def main():
    years = [ "111", "110","109", "108"] 

    reports_base=configuration.get_path_to_reports()
    bills2008 = os.path.join(configuration.get_path_to_bills(), "/110/bills/hr/hr2764/text-versions/")
    bills2009 = os.path.join(configuration.get_path_to_bills(), "/111/bills/hr/hr1105/text-versions/")


    conn = psycopg2.connect(CONN_STRING)

    insert_all(bills2008, conn);
    insert_all(bills2009, conn);

    for year in years:
       insert_all(reports_base+year+"/", conn);
    conn.close()