pymensago/userprofile.py
def delete_profile(self, name: str) -> RetVal:
		'''Deletes the named profile and all files on disk contained in it.

		Parameters:
		  * name: the name of the profile to delete
		
		Returns:
		  * no additional fields
		'''

		if name == 'default':
			return RetVal(ErrBadValue, "'default' is reserved")
		
		if not name:
			return RetVal(ErrEmptyData, "BUG: profile name may not be empty")
		
		name_squashed = name.casefold()
		itemindex = self._index_for_profile(name_squashed)
		if itemindex < 0:
			return RetVal(ErrNotFound, "%s doesn't exist" % name)

		profile = self.profiles.pop(itemindex)
		if os.path.exists(profile.path):
			try:
				shutil.rmtree(profile.path)
			except Exception as e:
				return RetVal.wrap_exception(e)
		
		if profile.is_default() and self.profiles:
			self.profiles[0].set_default(True)
		
		return RetVal()
Deletes the named profile and all files on disk contained in it.

		Parameters:
		  * name: the name of the profile to delete
		
		Returns:
		  * no additional fields
		
Deletes the named profile and all files on disk contained in it.
Deletes the named profile and all files on disk contained in it .
def delete_profile(self, name: str) -> RetVal:
		if name == 'default':
			return RetVal(ErrBadValue, "'default' is reserved")
		if not name:
			return RetVal(ErrEmptyData, "BUG: profile name may not be empty")
		name_squashed = name.casefold()
		itemindex = self._index_for_profile(name_squashed)
		if itemindex < 0:
			return RetVal(ErrNotFound, "%s doesn't exist" % name)
		profile = self.profiles.pop(itemindex)
		if os.path.exists(profile.path):
			try:
				shutil.rmtree(profile.path)
			except Exception as e:
				return RetVal.wrap_exception(e)
		if profile.is_default() and self.profiles:
			self.profiles[0].set_default(True)
		return RetVal()
def delete_profile ( self , name : str ) -> RetVal : if name == 'default' : return RetVal ( ErrBadValue , "'default' is reserved" ) if not name : return RetVal ( ErrEmptyData , "BUG: profile name may not be empty" ) name_squashed = name . casefold ( ) itemindex = self . _index_for_profile ( name_squashed ) if itemindex < 0 : return RetVal ( ErrNotFound , "%s doesn't exist" % name ) profile = self . profiles . pop ( itemindex ) if os . path . exists ( profile . path ) : try : shutil . rmtree ( profile . path ) except Exception as e : return RetVal . wrap_exception ( e ) if profile . is_default ( ) and self . profiles : self . profiles [ 0 ] . set_default ( True ) return RetVal ( )
Deletes the named profile and all files on disk contained in it.
Deletes the named profile and all files on disk contained in it .
'''Deletes the named profile and all files on disk contained in it.

		Parameters:
		  * name: the name of the profile to delete
		
		Returns:
		  * no additional fields
		'''
no additional fields
no additional fields
self
name
str
* name
the name of the profile to delete
the name of the profile to delete