Skip to content

Commit

Permalink
Git version information will now be written to .FAAVlog and .formantl…
Browse files Browse the repository at this point in the history
…og files when git is available.
  • Loading branch information
JoFrhwld committed May 15, 2014
1 parent 65a5df3 commit f09866f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
28 changes: 28 additions & 0 deletions FAVE-align/FAAValign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
19 changes: 18 additions & 1 deletion FAVE-extract/bin/extractFormants.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import plotnik
import cmu
import vowel
import subprocess

import numpy as np

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f09866f

Please sign in to comment.