Skip to content

Commit

Permalink
performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mtill committed May 27, 2018
1 parent 7f25b36 commit fddd566
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kontomodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,15 @@ def getConsolidated(byCategory, traceNames, fromDate, toDate, categories, thepat

def updateCategory(itemId, thecategory, thepath='lists/'):
thefilenames = getLists(thepath)
fileIdPos = itemId.rfind('_')
if fileIdPos == -1:
raise Exception('invalid id')
fileId = itemId[0:fileIdPos]

for thefilename in thefilenames:
if not thefilename.startswith(fileId):
continue

content = parseFile(thefilename, thepath=thepath)
for c in content:
if c['id'] == itemId:
Expand Down

0 comments on commit fddd566

Please sign in to comment.