Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pouvoir créer un .tlg à partir de config + fichier
- Loading branch information
Showing
1 changed file
with
25 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
#!/usr/bin/python3 | ||
# This file create the tlg file for testing regression on example file. | ||
# Use : create-tlg.py | ||
# Use : create-tlg.py <optional file> <optional config> | ||
# | ||
from glob import glob | ||
import os.path | ||
import subprocess | ||
directories = glob("testfiles-*") | ||
from sys import argv | ||
if len(argv) == 3: | ||
directories = ["testfiles-" + argv[2]] | ||
this_file = argv[1] + '.lvt' | ||
else : | ||
directories = glob("testfiles-*") | ||
|
||
for this_directory in directories: | ||
def create_file(this_config, this_directory, this_file): | ||
run = ["l3build", "save", "-c"+this_config, "fichier"] | ||
basename, extension = os.path.splitext(os.path.basename(this_file)) | ||
if extension == ".lvt": | ||
run[3] = basename | ||
print ("*****") | ||
print (this_directory+"/"+this_file) | ||
print ("*****") | ||
|
||
#create the .tlg | ||
subprocess.run(run) | ||
|
||
for this_directory in directories: | ||
this_config = this_directory.replace("testfiles","config") | ||
run = ["l3build", "save", "-c"+this_config, "fichier"] | ||
for this_file in os.listdir(this_directory): | ||
basename, extension = os.path.splitext(os.path.basename(this_file)) | ||
if extension == ".lvt": | ||
run[3] = basename | ||
print ("*****") | ||
print (this_directory+"/"+this_file) | ||
print ("*****") | ||
if len(argv) == 3: | ||
create_file(this_config, this_directory, this_file) | ||
else: | ||
for this_file in os.listdir(this_directory): | ||
create_file(this_config, this_directory, this_file) | ||
|
||
|
||
#create the .tlg | ||
subprocess.run(run) | ||
|