Make timestamp header a default.
This commit is contained in:
parent
75f00e7171
commit
c1055bd703
@ -3,7 +3,6 @@ import datetime
|
|||||||
|
|
||||||
SESSION = None
|
SESSION = None
|
||||||
|
|
||||||
|
|
||||||
def __gen_session_name__():
|
def __gen_session_name__():
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
return "treeNLU-session-{}.org".format(
|
return "treeNLU-session-{}.org".format(
|
||||||
@ -25,6 +24,11 @@ def global_session():
|
|||||||
return SESSION
|
return SESSION
|
||||||
|
|
||||||
|
|
||||||
|
def get_header():
|
||||||
|
now = datetime.datetime.utcnow()
|
||||||
|
return ("# Ran on {}\n".format(
|
||||||
|
now.strftime("%y/%m/%d %H:%M:%S.%f")))
|
||||||
|
|
||||||
class LevelContext:
|
class LevelContext:
|
||||||
def __init__(self, increaser, decreaser):
|
def __init__(self, increaser, decreaser):
|
||||||
self.increaser = increaser
|
self.increaser = increaser
|
||||||
@ -43,6 +47,8 @@ class OrgModeSession:
|
|||||||
self.level = 0
|
self.level = 0
|
||||||
self.dirty = False
|
self.dirty = False
|
||||||
|
|
||||||
|
self.f.write(get_header())
|
||||||
|
|
||||||
def annotate(self, annotation):
|
def annotate(self, annotation):
|
||||||
if self.dirty:
|
if self.dirty:
|
||||||
self.f.write("{indentation} {data}\n".format(
|
self.f.write("{indentation} {data}\n".format(
|
||||||
|
@ -21,10 +21,6 @@ def gen_session_name():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
org_mode.create_global_session(gen_session_name())
|
org_mode.create_global_session(gen_session_name())
|
||||||
|
|
||||||
now = datetime.datetime.utcnow()
|
|
||||||
org_mode.global_session().annotate("Ran on {}".format(
|
|
||||||
now.strftime("%y_%m_%d %H:%M:%S_%f")))
|
|
||||||
failed = False
|
failed = False
|
||||||
for test_name, test_module in tests:
|
for test_name, test_module in tests:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user