def fileKey(self, fileName, content, requireEncodedString=False): ''' Compute the hash of fileName and content. fileName may be unicode, content must be bytes (or plain string in Python 2.x). ''' m = hashlib.md5() if g.isUnicode(fileName): fileName = g.toEncodedString(fileName) if g.isUnicode(content): if requireEncodedString: g.internalError('content arg must be str/bytes') content = g.toEncodedString(content) # New in Leo 5.6: Use the git branch name in the key. branch = g.gitBranchName() branch = g.toEncodedString(branch) # Fix #475. m.update(branch) m.update(fileName) m.update(content) return "fcache/" + m.hexdigest()
def fileKey(self, fileName, content, requireEncodedString=False): ''' Compute the hash of fileName and content. fileName may be unicode, content must be bytes (or plain string in Python 2.x). ''' trace = False and not g.unitTesting m = hashlib.md5() if g.isUnicode(fileName): fileName = g.toEncodedString(fileName) if g.isUnicode(content): if requireEncodedString: g.internalError('content arg must be str/bytes') content = g.toEncodedString(content) # New in Leo 5.6: Use the git branch name in the key. branch = g.gitBranchName() # g.trace(type(branch), repr(branch)) branch = g.toEncodedString(branch) # Fix #475. m.update(branch) m.update(fileName) m.update(content) if trace: g.trace(m.hexdigest()) return "fcache/" + m.hexdigest()
# Leo 4.8 final: November 26, 2010. # Leo 4.9 final: June 21, 2011. # Leo 4.10 final: March 29, 2012. # Leo 4.11 final: November 6, 2013. # Leo 5.0 final: November 24, 2014. # Leo 5.1 final: April 17, 2015. # Leo 5.2 final: March 18, 2016. # Leo 5.3 final: May 2, 2016. # Leo 5.4 final: October 22, 2016. # Leo 5.5 final: March 23, 2017. # Leo 5.6 final: September 27, 2017. #@-<< version dates >> #@+<< about install hooks >> #@+node:ekr.20150409201910.1: ** << about install hooks >> #@@nocolor-node #@+at # # Developers should copy commit-msg & pre-commit from leo/extentions/hooks to # leo-editor/.git/hooks. # # These hooks cause Leo to update commit_timestamp.json automatically. # # The install_hooks.py script copies these two files to leo-editor/.git/hooks. #@-<< about install hooks >> version = "5.6" date, build = g.jsonCommitInfo() branch = g.gitBranchName() #@@language python #@@tabwidth -4 #@-leo
# Leo 4.7.1 final: February 26, 2010. # Leo 4.8 final: November 26, 2010. # Leo 4.9 final: June 21, 2011. # Leo 4.10 final: March 29, 2012. # Leo 4.11 final: November 6, 2013. # Leo 5.0 final: November 24, 2014. # Leo 5.1 final: April 17, 2015. # Leo 5.2 final: March 18, 2016. # Leo 5.3 final: May 2, 2016. # Leo 5.4 final: October 22, 2016. # Leo 5.5 final: March 23, 2017. #@-<< version dates >> #@+<< about install hooks >> #@+node:ekr.20150409201910.1: ** << about install hooks >> #@@nocolor-node #@+at # # Developers should copy commit-msg & pre-commit from leo/extentions/hooks to # leo-editor/.git/hooks. # # These hooks cause Leo to update commit_timestamp.json automatically. # # The install_hooks.py script copies these two files to leo-editor/.git/hooks. #@-<< about install hooks >> version = "5.5" date, build = g.jsonCommitInfo() branch = g.gitBranchName() #@@language python #@@tabwidth -4 #@-leo