-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidateRepo.py
More file actions
34 lines (29 loc) · 871 Bytes
/
validateRepo.py
File metadata and controls
34 lines (29 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#import git
import glob
import subprocess
import os
import sys
def gitPull(repoDir):
cmd = ['git', 'pull']
p = subprocess.Popen(cmd, cwd=repoDir)
p.wait()
repoRoot='/home/lou/Public/ELTeC-'
schemaDir='/home/lou/Public/Schemas'
if (len(sys.argv) <= 1) :
print("And which language repository would sir like to validate?")
else :
LANG=sys.argv[1]
repoName=repoRoot+LANG
print("Validating repo "+repoName)
gitPull(repoName)
os.chdir(repoName)
FILES=sorted(glob.glob('level0/*.xml'))
for FILE in FILES:
command="jing "+schemaDir+"/eltec-0.rng "+FILE
print(command)
subprocess.check_output(command,shell=True)
FILES=sorted(glob.glob('level1/*.xml'))
for FILE in FILES:
command="jing "+schemaDir+"/eltec-1.rng "+FILE
print(command)
subprocess.check_output(command,shell=True)