def add( self, text ): """ adds a new note, won't allow you to add duplicates """ if( text.strip() != "" ): notehash = toolbox.md5( text ) if notehash not in self._data: self._data[notehash] = { 'contents' : text, 'time' : time.time() } self._save() return "Added" return "Note already exists"
def add(self, text): """ adds a new note, won't allow you to add duplicates """ if (text.strip() != ""): notehash = toolbox.md5(text) if notehash not in self._data: self._data[notehash] = {'contents': text, 'time': time.time()} self._save() return "Added" return "Note already exists"
def _genhash(self, fileref): """ generates a hash based on the fileref - md5 for now, and a placeholder in case something else comes along """ return toolbox.md5(fileref)
def _genhash( self, fileref ): """ generates a hash based on the fileref - md5 for now, and a placeholder in case something else comes along """ return toolbox.md5( fileref )