OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
reorder_log Namespace Reference

Functions

def datetime_from_str
 

Variables

tuple parser = argparse.ArgumentParser(description='Reorder chronologically the log.')
 
string help = 'Output file. If unused stdout is used instead'
 
tuple args = parser.parse_args()
 
string timestamp_re = r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}:\d{3})\]'
 
tuple timestamp_prog = re.compile(timestamp_re)
 
tuple of = open(args.output, "w")
 
dictionary dt2txt = {}
 
int line_num = 0
 
tuple m = timestamp_prog.match(l)
 
tuple dt = datetime_from_str(m.group(1))
 
 dt_line_num = line_num
 

Function Documentation

def reorder_log.datetime_from_str (   time_str)
Return <datetime.datetime() instance> for the given
datetime string given in OpenCog's date time log format
>>> _datetime_from_str("2009-12-25 13:05:14:453")
datetime.datetime(2009, 12, 25, 13, 5, 14, 453000)

Definition at line 10 of file reorder_log.py.

Variable Documentation

tuple reorder_log.args = parser.parse_args()

Definition at line 24 of file reorder_log.py.

tuple reorder_log.dt = datetime_from_str(m.group(1))

Definition at line 39 of file reorder_log.py.

dictionary reorder_log.dt2txt = {}

Definition at line 33 of file reorder_log.py.

reorder_log.dt_line_num = line_num

Definition at line 40 of file reorder_log.py.

string reorder_log.help = 'Output file. If unused stdout is used instead'

Definition at line 23 of file reorder_log.py.

int reorder_log.line_num = 0

Definition at line 35 of file reorder_log.py.

tuple reorder_log.m = timestamp_prog.match(l)

Definition at line 37 of file reorder_log.py.

tuple reorder_log.of = open(args.output, "w")

Definition at line 30 of file reorder_log.py.

tuple reorder_log.parser = argparse.ArgumentParser(description='Reorder chronologically the log.')

Definition at line 20 of file reorder_log.py.

tuple reorder_log.timestamp_prog = re.compile(timestamp_re)

Definition at line 27 of file reorder_log.py.

string reorder_log.timestamp_re = r'\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}:\d{3})\]'

Definition at line 26 of file reorder_log.py.