pymensago/userprofile.py
def create_profile(self, name: str) -> RetVal:
		'''Creates a profile with the specified name.
		
		Parameters:
		  * name: name of the profile to create

		Returns: 
		  * profile: (Profile) management object of the newly-created profile
		
		Notes:
			The name given to this method is expected to be all lowercase and profile names
			will have capital letters squashed. Care should be used with spaces and special
			characters as the name is used directly as the directory name in the filesystem.
			The name `default` is reserved and may not be used.
		'''

		if not name:
			return RetVal(ErrEmptyData, "BUG: name may not be empty")
		
		name_squashed = name.casefold()
		if self._index_for_profile(name_squashed) >= 0:
			return RetVal(ErrExists, f"profile {name} already exists")

		new_profile_path = os.path.join(self.profile_folder, name_squashed)
		try:
			os.mkdir(new_profile_path)
		except Exception as e:
			return RetVal().wrap_exception(e)

		profile = Profile(new_profile_path)
		self.profiles.append(profile)

		if len(self.profiles) == 1:
			profile.set_default(True)
			self.default_profile = name
		
		return RetVal().set_value("profile", profile)
Creates a profile with the specified name.
		
		Parameters:
		  * name: name of the profile to create

		Returns: 
		  * profile: (Profile) management object of the newly-created profile
		
		Notes:
			The name given to this method is expected to be all lowercase and profile names
			will have capital letters squashed. Care should be used with spaces and special
			characters as the name is used directly as the directory name in the filesystem.
			The name `default` is reserved and may not be used.
		
Creates a profile with the specified name.
Creates a profile with the specified name .
def create_profile(self, name: str) -> RetVal:
		if not name:
			return RetVal(ErrEmptyData, "BUG: name may not be empty")
		name_squashed = name.casefold()
		if self._index_for_profile(name_squashed) >= 0:
			return RetVal(ErrExists, f"profile {name} already exists")
		new_profile_path = os.path.join(self.profile_folder, name_squashed)
		try:
			os.mkdir(new_profile_path)
		except Exception as e:
			return RetVal().wrap_exception(e)
		profile = Profile(new_profile_path)
		self.profiles.append(profile)
		if len(self.profiles) == 1:
			profile.set_default(True)
			self.default_profile = name
		return RetVal().set_value("profile", profile)
def create_profile ( self , name : str ) -> RetVal : if not name : return RetVal ( ErrEmptyData , "BUG: name may not be empty" ) name_squashed = name . casefold ( ) if self . _index_for_profile ( name_squashed ) >= 0 : return RetVal ( ErrExists , f"profile {name} already exists" ) new_profile_path = os . path . join ( self . profile_folder , name_squashed ) try : os . mkdir ( new_profile_path ) except Exception as e : return RetVal ( ) . wrap_exception ( e ) profile = Profile ( new_profile_path ) self . profiles . append ( profile ) if len ( self . profiles ) == 1 : profile . set_default ( True ) self . default_profile = name return RetVal ( ) . set_value ( "profile" , profile )
Creates a profile with the specified name.
Creates a profile with the specified name .
'''Creates a profile with the specified name.
		
		Parameters:
		  * name: name of the profile to create

		Returns: 
		  * profile: (Profile) management object of the newly-created profile
		
		Notes:
			The name given to this method is expected to be all lowercase and profile names
			will have capital letters squashed. Care should be used with spaces and special
			characters as the name is used directly as the directory name in the filesystem.
			The name `default` is reserved and may not be used.
		'''
(Profile) management object of the newly-created profile
( Profile ) management object of the newly - created profile
self
name
str
* name
name of the profile to create
name of the profile to create