pymensago/userprofile.py
def activate(self) -> RetVal:
		'''Connects the profile to its associated database.
		
		Returns:
		  * connection: (sqlite3.Connection) a Sqlite3 database connection instance
		
		Notes:
			If the database file for the profile doesn't already exist, it is created and
			initialized.
		'''

		pathlist = [
			self.path,
			os.path.join(self.path, 'temp')
		]
		for pathitem in pathlist:
			if not os.path.exists(pathitem):
				try:
					os.mkdir(pathitem)
				except Exception as e:
					return RetVal().wrap_exception(e)
		
		dbpath = os.path.join(self.path, 'storage.db')
		if os.path.exists(dbpath):
			self.db = sqlite3.connect(dbpath)
			config.load(dbpath)
			return RetVal().set_value('connection', self.db)
		
		return self.reset_db()
Connects the profile to its associated database.
		
		Returns:
		  * connection: (sqlite3.Connection) a Sqlite3 database connection instance
		
		Notes:
			If the database file for the profile doesn't already exist, it is created and
			initialized.
		
Connects the profile to its associated database.
Connects the profile to its associated database .
def activate(self) -> RetVal:
		pathlist = [
			self.path,
			os.path.join(self.path, 'temp')
		]
		for pathitem in pathlist:
			if not os.path.exists(pathitem):
				try:
					os.mkdir(pathitem)
				except Exception as e:
					return RetVal().wrap_exception(e)
		dbpath = os.path.join(self.path, 'storage.db')
		if os.path.exists(dbpath):
			self.db = sqlite3.connect(dbpath)
			config.load(dbpath)
			return RetVal().set_value('connection', self.db)
		return self.reset_db()
def activate ( self ) -> RetVal : pathlist = [ self . path , os . path . join ( self . path , 'temp' ) ] for pathitem in pathlist : if not os . path . exists ( pathitem ) : try : os . mkdir ( pathitem ) except Exception as e : return RetVal ( ) . wrap_exception ( e ) dbpath = os . path . join ( self . path , 'storage.db' ) if os . path . exists ( dbpath ) : self . db = sqlite3 . connect ( dbpath ) config . load ( dbpath ) return RetVal ( ) . set_value ( 'connection' , self . db ) return self . reset_db ( )
Connects the profile to its associated database.
Connects the profile to its associated database .
'''Connects the profile to its associated database.
		
		Returns:
		  * connection: (sqlite3.Connection) a Sqlite3 database connection instance
		
		Notes:
			If the database file for the profile doesn't already exist, it is created and
			initialized.
		'''
(sqlite3.Connection) a Sqlite3 database connection instance
( sqlite3 . Connection ) a Sqlite3 database connection instance
self