Grammalecte  Check-in [5dd255e81e]

Overview
Comment:[graphspell] fix date generation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 5dd255e81e39f3942c8f919e702ff52dfedcd9d34c2e6a026acf19316d603055
User & Date: olr on 2018-02-12 12:55:12
Other Links: manifest | tags
Context
2018-02-12
13:37
[graphspell][js][bug] ibdawg: fix getJSON() check-in: c7ead17f10 user: olr tags: graphspell, trunk
12:55
[graphspell] fix date generation check-in: 5dd255e81e user: olr tags: graphspell, trunk
12:29
[graphspell][js] ibdawg: getJSON() function + [fx] update: lexicon editor check-in: ec5393a4f1 user: olr tags: fx, graphspell, trunk
Changes

Modified graphspell-js/dawg.js from [0b803fa3ec] to [efda06dcfb].

   396    396           };
   397    397           return oJSON;
   398    398       }
   399    399   
   400    400       _getDate () {
   401    401           let oDate = new Date();
   402    402           let sMonth = (oDate.getMonth() + 1).toString().padStart(2, "0"); // Month+1: Because JS always sucks somehow.
   403         -        let sDay = (oDate.getDay()).toString().padStart(2, "0");
          403  +        let sDay = (oDate.getDate()).toString().padStart(2, "0");
   404    404           let sHours = (oDate.getHours()).toString().padStart(2, "0");
   405    405           let sMinutes = (oDate.getMinutes()).toString().padStart(2, "0");
   406    406           return `${oDate.getFullYear()}-${sMonth}-${sDay}, ${sHours}:${sMinutes}`;
   407    407       }
   408    408   }
   409    409   
   410    410   

Modified graphspell/dawg.py from [485e7076d7] to [96443fe4a2].

   500    500               elif nCompressionMethod == 3:
   501    501                   hDst.write(self.oRoot.convToBytes3(self.nBytesArc, self.nBytesNodeAddress, self.nBytesOffset))
   502    502                   for oNode in self.lSortedNodes:
   503    503                       hDst.write(oNode.convToBytes3(self.nBytesArc, self.nBytesNodeAddress, self.nBytesOffset))
   504    504               hDst.close()
   505    505   
   506    506       def _getDate (self):
   507         -        return time.strftime("%Y.%m.%d %H:%M")
          507  +        return time.strftime("%Y.%m.%d, %H:%M")
   508    508   
   509    509       def _writeNodes (self, sPathFile, nCompressionMethod):
   510    510           "for debugging only"
   511    511           print(" > Write nodes")
   512    512           with open(sPathFile+".nodes."+str(nCompressionMethod)+".txt", 'w', encoding='utf-8', newline="\n") as hDst:
   513    513               if nCompressionMethod == 1:
   514    514                   hDst.write(self.oRoot.getTxtRepr1(self.nBytesArc, self.nBytesNodeAddress, self.lArcVal)+"\n")

Modified graphspell/ibdawg.py from [a42b8fee36] to [6527ad55bf].

   189    189                   hDst.write('// JavaScript\n// Generated data (do not edit)\n\n"use strict";\n\nconst dictionary = ')
   190    190               hDst.write(json.dumps({
   191    191                               "sHeader": "/pyfsa/",
   192    192                               "sLangCode": self.sLangCode,
   193    193                               "sLangName": self.sLangName,
   194    194                               "sDicName": self.sDicName,
   195    195                               "sFileName": self.sFileName,
   196         -                            "sDate": time.strftime("%Y.%m.%d %H:%M"),
          196  +                            "sDate": self.sDate,
   197    197                               "nEntry": self.nEntry,
   198    198                               "nChar": self.nChar,
   199    199                               "nAff": self.nAff,
   200    200                               "nTag": self.nTag,
   201    201                               "cStemming": self.cStemming,
   202    202                               "dChar": self.dChar,
   203    203                               "nNode": self.nNode,