Skip to content

Commit

Permalink
get logging workin in voc2md, fix logic for extended voc
Browse files Browse the repository at this point in the history
new build of vocabularies.db

new build of vocabulary display files

add L = getLogger()

new build of vocabularies.db

declar logger

new build of vocabularies.db

new build of vocabulary display files

fix query for extended voc, add sttuf to try to get logging working

new build of vocabularies.db

fix load call

new build of vocabularies.db

new build of vocabulary display files

fix vocab.py call

new build of vocabularies.db

new build of vocabulary display files

fix problem with extension processing in load

new build of vocabularies.db

don't need to install warnings, its part of python

new build of vocabularies.db

new build of vocabulary display files

add logging in vocab2mdCacheV2

debugging vocabulary function

This reverts commit dff3b5a.

ignore py cache

new build of vocabularies.db

new build of vocabulary display files

remove version on SQLAlchemy

more debug statements

new build of vocabularies.db

new build of vocabulary display files

define getlogger

add get logger statement, set purge to false

change verbosity to DEBUG

new build of vocabularies.db

new build of vocabulary display files

get rid of type in line 1

Update action.yml to make docs default action

fix process_vocab.yml to use this repo

delete vocabularies.db

purge docs
  • Loading branch information
smrgeoinfo committed Dec 21, 2023
1 parent a3711a4 commit 4c536a5
Show file tree
Hide file tree
Showing 13 changed files with 1,282 additions and 265 deletions.
26 changes: 14 additions & 12 deletions .github/actions/github_action_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ def main():
# do function of original Makefile here

for inputf in inputttl:
result=load_cachedb(sourcevocabdir + "/" + inputf + ".ttl", cachepath)
theindex=0
result=load_cachedb(sourcevocabdir + "/" + inputf + ".ttl", cachepath, inputvocaburi[theindex] )
if (result == 0):
print(f"load_cachedb call successful for: {inputf}")
print(f"load_cachedb call successful for: {inputf}, {inputvocaburi[theindex]}")
else:
print(f"load_cachedb had problem processing: {inputf}")
print(f"load_cachedb had problem processing: {inputf},{inputvocaburi[theindex]}")
theindex = theindex + 1


if command == "uijson":
Expand All @@ -90,11 +92,11 @@ def main():
print(f"Unknown command {command}. Exiting.")
sys.exit(-1)

def load_cachedb(inputf, cachepath):
def load_cachedb(inputf, cachepath, voc_uri):
# tools/vocab.py --verbosity ERROR -s $(CACHE) load $(SRC)/$@

print(f"cachdb file to load: {inputf}")
load_args = ["--verbosity","DEBUG", "-s", cachepath, "load", inputf]
load_args = ["--verbosity","DEBUG", "-s", cachepath, "load", inputf, voc_uri]
result = _run_python_in_container("/app/tools/vocab.py", load_args, f="")
if (result == 0):
print(f"vocab.py.load call successful for {inputf}")
Expand Down Expand Up @@ -124,26 +126,26 @@ def _run_make_in_container(target: str):
subprocess.run(["/usr/bin/make", "-C", "/app", "-f", "/app/Makefile", target])


def _run_uijson_in_container(output_path: str, vocab_uri: str):
def _run_uijson_in_container(output_path: str, vocab_location: str):
with open(output_path, "w") as f:
vocab_args = ["-s", "/app/cache/vocabularies.db", "uijson", vocab_uri, "-e"]
vocab_args = ["-s", "/app/cache/vocabularies.db", "uijson", vocab_location, "-e"]
testflag = _run_python_in_container("/app/tools/vocab.py", vocab_args, f)
if (testflag == 0):
print(f"Run_uijson: Successfully wrote uijson file to {output_path}")
return 0
else:
print(f"problem processing {vocab_uri}")
print(f"problem processing {vocab_location}")
return 1

def _run_docs_in_container(output_path: str, vocab_uri: str):
def _run_docs_in_container(output_path: str, vocab_location: str):
with open(output_path, "w") as f:
docs_args = ["/app/cache/vocabularies.db", vocab_uri]
docs_args = ["/app/cache/vocabularies.db", vocab_location]
testflag = _run_python_in_container("/app/tools/vocab2mdCacheV2.py", docs_args, f)
if (testflag == 0):
print(f"Docs in container: Successfully wrote doc file {vocab_uri} to {output_path}")
print(f"Docs in container: Successfully wrote doc file {vocab_location} to {output_path}")
return 0
else:
print(f"vocab2mdCacheV2. problem processing {vocab_uri}")
print(f"vocab2mdCacheV2. problem processing {vocab_location}")
return 1

def _run_python_in_container(path_to_python_script: str, args: list[str], f):
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/process_vocab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Vocabulary action
uses: isamplesorg/vocabularyTest@main
uses: isamplesorg/vocabularyTemplate@main
# input variables 'action' and 'path' are defined in action.yml, and assigned values here
# GitHub creates an environment variable for the input with the name INPUT_<VARIABLE_NAME>
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/

tools/navocab/__pycache__/__init__.cpython-311.pyc
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
action:
description: 'Which action to run -- defaults to uijson'
required: true
default: 'uijson'
default: 'docs'
path:
description: 'Path to the output directory for script output'
required: true
Expand Down
Binary file modified cache/vocabularies.db
Binary file not shown.
282 changes: 250 additions & 32 deletions docs/test_feature_type.html

Large diffs are not rendered by default.

Loading

0 comments on commit 4c536a5

Please sign in to comment.