CC-4965: Fix airtime-silan import tool
-various fixes
This commit is contained in:
parent
0f19ffc7df
commit
b8f9acc0e5
2 changed files with 41 additions and 22 deletions
|
@ -1,11 +1,12 @@
|
|||
import logging
|
||||
from configobj import ConfigObj
|
||||
from api_clients import api_client as apc
|
||||
|
||||
import logging
|
||||
import json
|
||||
import shutil
|
||||
import commands
|
||||
import os
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
import subprocess
|
||||
import traceback
|
||||
|
||||
|
@ -19,16 +20,16 @@ logging.disable(50)
|
|||
# add ch to logger
|
||||
logger.addHandler(ch)
|
||||
|
||||
if (os.geteuid() != 0):
|
||||
if os.geteuid() != 0:
|
||||
print 'Must be a root user.'
|
||||
sys.exit()
|
||||
sys.exit(1)
|
||||
|
||||
# loading config file
|
||||
try:
|
||||
config = ConfigObj('/etc/airtime/media-monitor.cfg')
|
||||
except Exception, e:
|
||||
print('Error loading config file: %s', e)
|
||||
sys.exit()
|
||||
sys.exit(1)
|
||||
|
||||
api_client = apc.AirtimeApiClient(config)
|
||||
|
||||
|
@ -58,7 +59,7 @@ try:
|
|||
data['cueout'] = str('{0:f}'.format(info['sound'][-1][1]))
|
||||
processed_data.append((f['id'], data))
|
||||
total += 1
|
||||
if (total % 5 == 0):
|
||||
if total % 5 == 0:
|
||||
print "Total %s / %s files has been processed.." % (total, total_files)
|
||||
except Exception, e:
|
||||
print e
|
||||
|
@ -77,5 +78,3 @@ try:
|
|||
except Exception, e:
|
||||
print e
|
||||
print traceback.format_exc()
|
||||
|
||||
#update_cue_values_by_silan
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue