Create basic package structure
This commit is contained in:
parent
dfc1e8bf8b
commit
6ebb397a86
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python3
|
||||
import logging
|
||||
import sys
|
||||
|
||||
import psycopg2
|
||||
|
||||
import procrusql
|
||||
import procrusql.parser
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(format="%(asctime)s %(levelname)s %(name)s %(lineno)d | %(message)s", level=logging.DEBUG)
|
||||
with open(sys.argv[1]) as rf:
|
||||
text = rf.read()
|
||||
ps = procrusql.parser.ParseState(text)
|
||||
|
||||
ps2 = procrusql.parser.parse_ruleset(ps)
|
||||
|
||||
if not ps2:
|
||||
ps.printerror()
|
||||
sys.exit(1)
|
||||
|
||||
db = psycopg2.connect(sys.argv[2])
|
||||
procrusql.fit(db, ps2.ast)
|
||||
|
||||
# vim: tw=0
|
|
@ -291,17 +291,3 @@ def rulename():
|
|||
rulenum += 1
|
||||
return f"__rule_{rulenum}"
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(format="%(asctime)s %(levelname)s %(name)s %(lineno)d | %(message)s", level=logging.DEBUG)
|
||||
with open(sys.argv[1]) as rf:
|
||||
text = rf.read()
|
||||
ps = ParseState(text)
|
||||
|
||||
ps2 = parse_ruleset(ps)
|
||||
|
||||
if not ps2:
|
||||
ps.printerror()
|
||||
sys.exit(1)
|
||||
|
||||
db = psycopg2.connect(sys.argv[2])
|
||||
procrusql.fit(db, ps2.ast)
|
Loading…
Reference in New Issue