[add] notes can be read from event folders

This commit is contained in:
Marcel Paffrath 2017-06-12 11:34:45 +02:00
parent ddedd3ed7a
commit 5412de8249
2 changed files with 13 additions and 2 deletions

View File

@ -2371,9 +2371,20 @@ class Event(object):
self.notes = '' self.notes = ''
self._testEvent = False self._testEvent = False
self._refEvent = False self._refEvent = False
try:
self.get_notes()
except:
pass
def get_notes(self):
notesfile = os.path.join(self.path, 'notes.txt')
if os.path.isfile(notesfile):
with open(notesfile) as infile:
text = '[eventInfo: '+str(infile.readlines()[0].split('\n')[0])+']'
self.addNotes(text)
def addNotes(self, notes): def addNotes(self, notes):
self.notes = notes self.notes = str(notes)
def clearNotes(self): def clearNotes(self):
self.notes = None self.notes = None

View File

@ -1 +1 @@
a2c7-dirty dded-dirty