Add Pickle Dump to Reporting
This commit is contained in:
parent
ecd2648372
commit
8e85b71e27
|
@ -20,11 +20,8 @@ import binascii
|
||||||
import csv
|
import csv
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import time
|
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
import cPickle as pickle
|
|
||||||
|
|
||||||
from logging.config import dictConfig
|
from logging.config import dictConfig
|
||||||
from hmac import new as hmac_new
|
from hmac import new as hmac_new
|
||||||
from binascii import b2a_hex as h
|
from binascii import b2a_hex as h
|
||||||
|
@ -38,6 +35,7 @@ from twisted.internet import task
|
||||||
from random import randint
|
from random import randint
|
||||||
from time import time
|
from time import time
|
||||||
from json import dumps as json_dump
|
from json import dumps as json_dump
|
||||||
|
from cPickle import dump as pickle_dump
|
||||||
|
|
||||||
__author__ = 'Cortney T. Buffington, N0MJS'
|
__author__ = 'Cortney T. Buffington, N0MJS'
|
||||||
__copyright__ = 'Copyright (c) 2013 - 2015 Cortney T. Buffington, N0MJS and the K0USY Group'
|
__copyright__ = 'Copyright (c) 2013 - 2015 Cortney T. Buffington, N0MJS and the K0USY Group'
|
||||||
|
@ -596,7 +594,7 @@ if REPORTS['REPORT_NETWORKS'] == 'PICKLE':
|
||||||
logger.debug('Periodic Reporting Loop Started (PICKLE)')
|
logger.debug('Periodic Reporting Loop Started (PICKLE)')
|
||||||
try:
|
try:
|
||||||
with open(REPORTS['REPORT_PATH']+'dmrlink_stats.pickle', 'wb') as file:
|
with open(REPORTS['REPORT_PATH']+'dmrlink_stats.pickle', 'wb') as file:
|
||||||
pass
|
pickle_dump(NETWORK, file, 2)
|
||||||
file.close()
|
file.close()
|
||||||
except IOError as detail:
|
except IOError as detail:
|
||||||
logger.error('I/O Error: %s', detail)
|
logger.error('I/O Error: %s', detail)
|
||||||
|
|
Loading…
Reference in New Issue