-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Git version information will now be written to .FAAVlog and .formantl…
…og files when git is available.
- Loading branch information
Showing
2 changed files
with
46 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -77,6 +77,7 @@ | |
import traceback | ||
import codecs | ||
import mimetypes | ||
import subprocess | ||
|
||
truncated = re.compile(r'\w+\-$') ## truncated words | ||
intended = re.compile(r'^\+\w+') ## intended word (inserted by transcribers after truncated word) | ||
|
@@ -1355,6 +1356,33 @@ def write_log(filename, wavfile, duration): | |
f.write(t_stamp) | ||
f.write("\n\n") | ||
f.write("Alignment statistics for file %s:\n\n" % os.path.basename(wavfile)) | ||
try: | ||
check_version = subprocess.Popen(["git","describe"], stdout = subprocess.PIPE) | ||
version,err = check_version.communicate() | ||
version = version.rstrip() | ||
except OSError: | ||
version = None | ||
|
||
if version: | ||
f.write("version info from Git: %s"%version) | ||
f.write("\n") | ||
else: | ||
f.write("Not using Git version control. Version info unavailable.\n") | ||
f.write("Consider installing Git (http://git-scm.com/).\ | ||
and cloning this repository from GitHub with: \n \ | ||
git clone [email protected]:JoFrhwld/FAVE.git") | ||
f.write("\n") | ||
|
||
try: | ||
check_changes = subprocess.Popen(["git", "diff", "--stat"], stdout = subprocess.PIPE) | ||
changes, err = check_changes.communicate() | ||
except OSError: | ||
changes = None | ||
|
||
if changes: | ||
f.write("Uncommitted changes when run:\n") | ||
f.write(changes) | ||
|
||
f.write("Total number of words:\t\t\t%i\n" % count_words) | ||
f.write("Uncertain transcriptions:\t\t%i\t(%.1f%%)\n" % (count_uncertain, float(count_uncertain)/float(count_words)*100)) | ||
f.write("Unclear passages:\t\t\t%i\t(%.1f%%)\n" % (count_unclear, float(count_unclear)/float(count_words)*100)) | ||
|
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 |
---|---|---|
|
@@ -78,6 +78,7 @@ | |
import plotnik | ||
import cmu | ||
import vowel | ||
import subprocess | ||
|
||
import numpy as np | ||
|
||
|
@@ -1935,7 +1936,23 @@ def writeLog(filename, wavFile, maxTime, meansFile, covsFile, stopWords): | |
|
||
f = open(filename, 'w') | ||
f.write(time.asctime()) | ||
f.write("\n\n") | ||
f.write("\n") | ||
try: | ||
check_version = subprocess.Popen(["git","describe"], stdout = subprocess.PIPE) | ||
version,err = check_version.communicate() | ||
version = version.rstrip() | ||
except OSError: | ||
version = None | ||
|
||
if version: | ||
f.write("version info from Git: %s"%version) | ||
f.write("\n") | ||
else: | ||
f.write("Not using Git version control. Version info unavailable.\n") | ||
f.write("Consider installing Git (http://git-scm.com/).\ | ||
and cloning this repository from GitHub with: \n \ | ||
git clone [email protected]:JoFrhwld/FAVE.git") | ||
f.write("\n") | ||
f.write("extractFormants statistics for file %s:\n\n" % | ||
os.path.basename(wavFile)) | ||
f.write("Total number of vowels (initially):\t%i\n" % count_vowels) | ||
|