Skip to content

Commit

Permalink
add script to fetch ud validator data
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Sep 24, 2024
1 parent f80513b commit e3ba768
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/projects/controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import datetime
import json
import os
from typing import List

Expand All @@ -11,9 +9,11 @@
from werkzeug.utils import secure_filename
import werkzeug

from app import db
from app.utils.grew_utils import GrewService
from app.user.service import UserService
from app.trees.service import TreeValidationService
from app.github.model import GithubCommitStatus

from .interface import ProjectExtendedInterface, ProjectInterface, ProjectShownFeaturesAndMetaInterface
from .model import Project, ProjectAccess
Expand Down Expand Up @@ -203,9 +203,17 @@ def put(self, project_name: str):

config = []
args = request.get_json()
update_commit = args['updateCommit']
config.append(args['config'])

if update_commit and project.github_repository: # if project synchronized changing feats and misc in the config will modify data so changes will update the commit status
github_commit_status = GithubCommitStatus.query.filter_by(project_id=project.id).first()
if github_commit_status:
github_commit_status.update({"changes_number": github_commit_status.changes_number + 1})
db.session.commit()

GrewService.update_project_config(project.project_name, config)


return {"status": "success", "message": "New conllu schema was saved"}

Expand Down
17 changes: 17 additions & 0 deletions fetch_validator_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

cd "$parent_path"

cd "app/utils/ud_validator/"

curl -L -o "repo.zip" "https://github.com/UniversalDependencies/tools/archive/refs/heads/master.zip"

unzip -q "repo.zip" -d "temp_unzip_dir"

rm -rf ./data

mv "temp_unzip_dir/tools-master/data" .

rm -rf "temp_unzip_dir" "repo.zip"

0 comments on commit e3ba768

Please sign in to comment.