From 6850a204415d0ba7d7682a3fd57000160d3f6ff1 Mon Sep 17 00:00:00 2001 From: Andreas Dieckmann Date: Sat, 16 Dec 2017 16:44:31 +0100 Subject: [PATCH] Added Journal.Date and JournalBasicFileInfo.FileName --- nodes/Journal.ByString.dyf | 7 +- nodes/Journal.Date.dyf | 40 ++++++++++ nodes/JournalBasicFileInfo.FileName.dyf | 40 ++++++++++ samples/AllNodes.dyn | 97 ++++++++++++++++++------- 4 files changed, 155 insertions(+), 29 deletions(-) create mode 100644 nodes/Journal.Date.dyf create mode 100644 nodes/JournalBasicFileInfo.FileName.dyf diff --git a/nodes/Journal.ByString.dyf b/nodes/Journal.ByString.dyf index 55d8e9f..89832f6 100644 --- a/nodes/Journal.ByString.dyf +++ b/nodes/Journal.ByString.dyf @@ -46,6 +46,8 @@ class Journal: def ContainsExceptions(self): if len([x for x in self.GetLinesByType('JournalTimeStamp') if x.Description.startswith("ExceptionCode")]) > 0: return True else: return False + def GetDate(self): + return self.GetDateTimeByBlock(1).Date def GetDateTimeByBlock(self, block): if block == 0: return None else: return [x for x in self.GetLinesByType('JournalTimeStamp') if x.Block == block][0].DateTime @@ -172,6 +174,7 @@ class JournalBasicFileInfo(JournalLine): self.CentralModelPath = None self.LastSavePath = None self.Locale = None + self.FileName = None def __repr__(self): return 'JournalBasicFileInfo' @@ -359,7 +362,9 @@ for line in lineObjs: bfidict = dict(zip(bfi[0], [x.strip() for x in bfi[1]])) if bfidict["Worksharing"] != "": line.Worksharing = bfidict["Worksharing"] if bfidict["CentralModelPath"] != "": line.CentralModelPath = bfidict["CentralModelPath"] - if bfidict["LastSavePath"] != "": line.LastSavePath = bfidict["LastSavePath"] + if bfidict["LastSavePath"] != "": + line.LastSavePath = bfidict["LastSavePath"] + line.FileName = bfidict["LastSavePath"].split("\\")[-1] if bfidict["LocaleWhenSaved"] != "": line.Locale = bfidict["LocaleWhenSaved"] elif line.Type == 'JournalGUIResourceUsage': g2 = [] diff --git a/nodes/Journal.Date.dyf b/nodes/Journal.Date.dyf new file mode 100644 index 0000000..9be57e4 --- /dev/null +++ b/nodes/Journal.Date.dyf @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nodes/JournalBasicFileInfo.FileName.dyf b/nodes/JournalBasicFileInfo.FileName.dyf new file mode 100644 index 0000000..b08430e --- /dev/null +++ b/nodes/JournalBasicFileInfo.FileName.dyf @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/AllNodes.dyn b/samples/AllNodes.dyn index a5d66fb..66f1e3a 100644 --- a/samples/AllNodes.dyn +++ b/samples/AllNodes.dyn @@ -1,4 +1,4 @@ - + @@ -28,7 +28,7 @@ - + @@ -40,7 +40,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -140,7 +140,7 @@ JournalKeyboardEvent - + @@ -154,11 +154,11 @@ - + JournalAddinEvent - + @@ -172,7 +172,7 @@ - + JournalAPIMessage @@ -353,7 +353,7 @@ - + @@ -365,7 +365,7 @@ - + @@ -413,7 +413,7 @@ - + @@ -677,7 +677,7 @@ - + @@ -689,7 +689,7 @@ - + @@ -773,7 +773,7 @@ - + @@ -785,7 +785,7 @@ - + @@ -797,7 +797,7 @@ - + @@ -809,7 +809,7 @@ - + @@ -821,7 +821,7 @@ - + @@ -833,7 +833,7 @@ - + @@ -845,7 +845,7 @@ - + @@ -1463,11 +1463,11 @@ - + JournalBasicFileInfo - + @@ -1481,7 +1481,7 @@ - + @@ -1529,6 +1529,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1570,6 +1606,8 @@ + + @@ -1690,12 +1728,13 @@ + - + @@ -1707,8 +1746,9 @@ + - + @@ -1727,6 +1767,7 @@ + @@ -1740,12 +1781,12 @@ - + - + @@ -1888,7 +1929,7 @@ - +