Ejemplo n.º 1
0
	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"
Ejemplo n.º 2
0
 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"
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
	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 )