Skip to content

Commit bd25d0f

Browse files
save
1 parent f27d64c commit bd25d0f

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

generate_schemas.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require("fs");
22
const path = require("path");
33
const glob = require("glob");
44
const process = require("process");
5-
const { log } = require("console");
65

76
const findDirectoryPath = (targetDirectoryName) => {
87
const pathToCheck = path.join(process.cwd(), targetDirectoryName);
@@ -16,6 +15,10 @@ const findDirectoryPath = (targetDirectoryName) => {
1615
path: path.join(pathToCheck, folder.name),
1716
}));
1817
const rpcDirectory = path.join(folders[0].path, "rpc");
18+
19+
console.log("rpcDirectory", rpcDirectory);
20+
console.log("folders[0].name", folders[0].name);
21+
1922
return [rpcDirectory, folders[0].name];
2023
};
2124

@@ -33,13 +36,21 @@ function return_json_schema(directoryPath, folder_path, project_name) {
3336
}));
3437
var folders_schemas = {};
3538
folders.forEach((folder) => {
39+
console.log("folder", folder);
3640
if (folder.name == "schemas") {
37-
const jsonFiles = glob.sync(path.join(folder.path, "**/*.json"));
41+
console.log("schemas");
42+
console.log("folder.path", folder.path);
43+
console.log("test", path.join(folder.path, "/*.json"));
44+
var jsonFiles = glob.sync(path.join(folder.path, "/*.json"));
45+
console.log("jsonFiles", jsonFiles);
3846
var schemas = {};
47+
3948
jsonFiles.forEach((filePath) => {
49+
console.log("filePath", filePath);
4050
try {
4151
const fileContent = fs.readFileSync(filePath, "utf8");
4252
var jsonData = JSON.parse(fileContent);
53+
console.log("jsonData", jsonData);
4354
var filename = filePath
4455
.replace(/^.*[\\/]/, "")
4556
.replace(/\.[^/.]+$/, "");

src/opengeodeweb_viewer/vtk_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def get_point_position(self, params):
214214
return {"x": ppos[0], "y": ppos[1], "z": ppos[2]}
215215

216216
@exportRpc(reset_json["rpc"])
217-
def reset(self):
217+
def reset(self, params):
218218
validate_schemas(params, reset_json)
219219
renderWindow = self.getView("-1")
220220
renderWindow.GetRenderers().GetFirstRenderer().RemoveAllViewProps()

src/opengeodeweb_viewer/vtkw_server.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ def initialize(self):
7878

7979

8080
if __name__ == "__main__":
81-
if os.path.isfile("./.env"):
82-
basedir = os.path.abspath(os.path.dirname(__file__))
83-
dotenv.load_dotenv(os.path.join(basedir, ".env"))
81+
basedir = os.path.abspath(os.path.dirname(__file__))
82+
print(f"{basedir=}", flush=True)
83+
if os.path.isfile(os.path.join(basedir, "../../.env")):
84+
print("Loading .env file", flush=True)
85+
print(f"{basedir=}", flush=True)
86+
dotenv.load_dotenv(os.path.join(basedir, "../../.env"))
87+
else:
88+
print("No .env file found", flush=True)
8489
PYTHON_ENV = os.environ.get("PYTHON_ENV", default="prod").strip().lower()
90+
print(f"{PYTHON_ENV=}", flush=True)
8591
if PYTHON_ENV == "prod":
8692
config.prod_config()
8793
elif PYTHON_ENV == "dev":
@@ -94,7 +100,8 @@ def initialize(self):
94100
args = parser.parse_args()
95101
args.port = os.environ.get("PORT")
96102
args.host = os.environ.get("HOST")
97-
print(f"{args=}", flush=True)
103+
DATA_FOLDER_PATH = os.environ.get("DATA_FOLDER_PATH")
104+
print(f"{DATA_FOLDER_PATH=}", flush=True)
98105

99106
_Server.configure(args)
100107
server.start_webserver(options=args, protocol=_Server)

0 commit comments

Comments
 (0)