Ejemplo n.º 1
0
	def login( self, event = None ):

		password = self.passin.get()

		if aes.check_pass( password ):

			data = {}
			config = {}
			if isfile(home+'/Dropbox/.pwman/data'):

				with open(home+'/Dropbox/.pwman/data') as f:
					datastring = aes.decrypt( f.read(), password )

				if datastring.strip() != '':
					try:
						data,config = cPickle.loads( datastring )
					except ValueError:
						data = cPickle.loads( datastring )

			self.app.set_data( data, password, config )
			self.app.change_state( mainMenu )

		else:
			self.login_fail()

		return
Ejemplo n.º 2
0
	def save(self, event=None ):

		self.app.warning_manager.clear_all()

		if self.pass_in.get() != self.pass_in2.get():
			self.app.warning_manager.display_warning(name='noMatch',text='Passwords do not match!')
			return

		if not aes.check_pass( self.oldpass_in.get() ):
			self.app.warning_manager.display_warning(name='badPass',text='Old password incorrect!')
			return 

		newpass = self.pass_in.get()

		aes.save_master_pass( newpass )
		self.app.password = newpass
		self.app.save_data()

		self.app.change_state( mainMenu )

		self.app.warning_manager.display_warning(name='success',text='Successfully changed\nmaster password.')

		pass