AUDIO_INPUT directory configurable

This commit is contained in:
boyska 2013-12-04 16:48:17 +01:00
parent ae9d686aa1
commit 3502a72274
2 changed files with 9 additions and 2 deletions

View file

@ -2,5 +2,6 @@ OUTPUT_DIR='output'
HOST='localhost'
PORT='8000'
DEBUG=True
DB_URI='sqlite://techrec.db'
DB_URI='sqlite:///techrec.db'
AUDIO_OUTPUT='output/'
AUDIO_INPUT='rec/'

View file

@ -1,13 +1,19 @@
from datetime import datetime, timedelta
import os.path
from subprocess import Popen
from config_manager import get_config
def get_timefile_exact(time):
'''
time is of type `datetime`; it is not "rounded" to match the real file;
that work is done in get_timefile(time)
'''
return time.strftime('%Y-%m/%d/rec-%Y-%m-%d-%H-%M-%S-ror.mp3')
return os.path.join(
get_config()['AUDIO_INPUT'],
time.strftime('%Y-%m/%d/rec-%Y-%m-%d-%H-%M-%S-ror.mp3')
)
def round_timefile(exact):