예제 #1
0
파일: __init__.py 프로젝트: yaleman/Andy
	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"
예제 #2
0
파일: __init__.py 프로젝트: yaleman/Andy
 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"
예제 #3
0
파일: __init__.py 프로젝트: yaleman/Andy
    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)
예제 #4
0
파일: __init__.py 프로젝트: yaleman/Andy
	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 )