]> git.leopard-lacewing.eu Git - tex_tools.git/commitdiff
[py] Time Information getting parsed -> sortable
authorPeter Schaefer <schaeferpm@gmail.com>
Sun, 17 Feb 2019 15:48:06 +0000 (16:48 +0100)
committerPeter Schaefer <schaeferpm@gmail.com>
Sun, 17 Feb 2019 15:48:06 +0000 (16:48 +0100)
generic/git2.tex
gitLog2tikz.py
text-output.pdf

index ab5bc03a6ab524a70d114f6b97a62265a364ce55..a067591a0b0d75b7ef606dbe134d9155d7007300 100644 (file)
@@ -2,6 +2,8 @@
 \arrayrulecolor{lightgray}\hline
 Date & Changes & Author\\
 \arrayrulecolor{lightgray}\hline
+17 Feb 2019&minor fixes&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+\arrayrulecolor{lightgray}\hline
 17 Feb 2019&[doc] new generic directory&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
 17 Feb 2019&started table output&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
@@ -10,26 +12,26 @@ Date & Changes & Author\\
 \arrayrulecolor{lightgray}\hline
 17 Feb 2019&fixed some issues&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] lsting Hooks&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+03 Jan 2019&[doc] lsting Hooks&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] Hook2 test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+03 Jan 2019&[doc] Hook2 test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] Hook2 test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+03 Jan 2019&[doc] Hook2 test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] Hook test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+03 Jan 2019&[doc] Hook test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] Features/Bugs
+03 Jan 2019&[doc] Features/Bugs
 [py] reversed changed&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-3 Jan 2019&[doc] neuer Branch&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+03 Jan 2019&[doc] neuer Branch&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-2 Jan 2019&[doc] neues Hooks&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+02 Jan 2019&[doc] neues Hooks&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-2 Jan 2019&[py] Export copy finished&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+02 Jan 2019&[py] Export copy finished&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-2 Jan 2019&[doc] kleine änderrung&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+02 Jan 2019&[doc] kleine änderrung&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
-2 Jan 2019&Grober Latex Test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
+02 Jan 2019&Grober Latex Test&\href{mailto:schaeferpm@gmail.com}{Peter Schaefer}\\
 \arrayrulecolor{lightgray}\hline
 \arrayrulecolor{lightgray}\hline
 \end{tabular}
index cee16e24945a50992262598fa656c0ea02e54f15..b48e5f3db285274b0829015585b952462c7b5b31 100644 (file)
@@ -6,6 +6,7 @@ from subprocess import check_output
 from collections import OrderedDict
 from re import compile, match
 from argparse import ArgumentParser
+from datetime import datetime
 import sys
 
 out_stream = sys.stdout
@@ -179,14 +180,17 @@ class Repo:
         def hash(self):
             return self._hash.hash()
 
+        def date(self):
+            return self._date.strftime("%d %b %Y")
+
         def AddInfo(self,line):
             line = line[self._message_pos:]
             info = line.split(':')
             if info[0] == 'Author':
                 self._author = Author(':'.join(info[1:]).strip())
             elif info[0] == 'Date':
-                tmp = ':'.join(info[1:]).strip().split(' ')
-                self._date = tmp[2] + ' ' + tmp[1] + ' ' + tmp[4]
+                t = ':'.join(info[1:]).strip()
+                self._date = datetime.strptime(t,"%a %b %d %H:%M:%S %Y %z")
             elif info[0] == 'Merge':
                 self._merge = info[1].strip().split(' ')
             elif line[0:4] == '    ':
@@ -208,7 +212,7 @@ class Repo:
             out("\\node[right,xshift=10] (label" + self.hash() + ") at (" + self.hash() + ".east) {\\verb!" + self.hash() + ": " + VerbClean(self._message) + "!};")
 
         def export_commit2table(self):
-            out(self._date + '&' + Str2Tex(self._message) + '&' + self._author.auth2Tex() + "\\\\")
+            out(self.date() + '&' + Str2Tex(self._message) + '&' + self._author.auth2Tex() + "\\\\")
 
         def export_path2tikz(self):
             for child in self._children.values():
@@ -216,6 +220,10 @@ class Repo:
        
         def __eq__(self,other):
             return self.hash() == other.hash()
+        
+        def __lt__(self,other):
+            return self._date < other._date
+
     class Branch:
         def __init__(self, line):
             words = list(filter(lambda x:x!='',line[2:].split(" ")))
index f939bdb16e11ca1e8b73492cf8f27d59d8bde26f..1a50c02b021f3ad747d267a09d1f38a1909b610c 100644 (file)
Binary files a/text-output.pdf and b/text-output.pdf differ