Ejemplo n.º 1
0
def preProcessDocketFile(filename):
    "Preprocess docket file to skip non-party.block stuff"
    with open(filename, 'r') as tfile:
        mystring = ''
        partyBlockYet = 0
        for line in tfile:
            if partyBlockYet == 1:
                mystring += line
            if line == '<party.block>':
                partyBlockYet = 1
            elif line == '</party.block>':
                partyBlockYet = 0
    return mystring


mylogger = setupLoggerAndReturn('inspect-party-block.py.log')

################
# BOTTOM STUFF #
################


def printHeaderMaterial(listOfFiles):
    logging.info("List of files:\n\t%s", listOfFiles)
    logging.info("Number of files=%s", len(listOfFiles))
    logging.info("Datetime at start is %s", dt.now())


searchAll = re.compile('.*xml$').search
dataDir = '/data2/dockets/'  #preprocessed/'
listOfAllFiles = [
Ejemplo n.º 2
0
sys.path.append(
    '/home/gelbach/pydockets/python/hensler/github/Class-Actions-Project-with-DH/modules'
)
from henslerFunctions import CLASS_TEXT, MDL
from entryObject import entryObject

from xmlFiles import *
from CaseLevelFunctions import *
from GeneralFunctions import *
from docketsFileReader_new import *
from myqueryexecuter import myQueryExecuter
from setupLoggerAndReturn import setupLoggerAndReturn

#THISFILE = __file__
THISFILE = 'dummy'
mylogger = setupLoggerAndReturn(THISFILE + '.log')

dockettext_re = re.compile(
    r'(?P<docketmaintext>\d+:\d\d-[a-zA-Z]{2,3}-\d+)(?P<docketsupplementaltext>(-\w*){0,})'
)


def makeLeaddocketList(string):
    stringList = string.split(' ')
    accumulatedString = ''
    tupleList = list()
    id = 0
    for s in stringList:
        if dockettext_re.match(s) is not None:
            m = dockettext_re.match(s)
            id += 1
import sqlite3

import sys
sys.path.append('/data2/dockets/utilities')

import logging
from setupLoggerAndReturn import setupLoggerAndReturn

from xmlFiles import *
from CaseLevelFunctions import *
from GeneralFunctions import *
from docketsFileReader_new import *

from myqueryexecuter import myQueryExecuter

mylogger = setupLoggerAndReturn('try-uniquification.py.log')
db = sqlite3.connect('/data2/dockets/sqlite/pydockets-devt.db')
c = db.cursor()
#mq = myQueryExecuter(c,mylogger)
#
##get list of fullcase_id values
#qFullcase = '''
#           SELECT id FROM fullcase;
#'''
#qUniqueEntry = '''
#                  SELECT entrynumber, dateentry, entrytext,
#                         fullcase_id, caseheader_id
#                    FROM entry
#                    WHERE fullcase_id=?
#'''