cgl.plugins.perforce.utils package¶
Submodules¶
cgl.plugins.perforce.utils.config module¶
- cgl.plugins.perforce.utils.config.get_perforce_user_name() str[source]¶
function to get the perforce user name defaults to alchemy username
cgl.plugins.perforce.utils.depot module¶
- cgl.plugins.perforce.utils.depot.create_depot(company, project, world='world')[source]¶
Creates a new depot in perforce
- Parameters:
project – Name of the project
world – Name of the world
depot_name – Name of the new depot
- Returns:
True if depot is created, False if depot is not created
- cgl.plugins.perforce.utils.depot.delete_depot(company, project, world)[source]¶
Deletes a depot in perforce
- Parameters:
depot_name – Name of depot to be deleted
project
world
- Returns:
False if depot does not exist, returns the output of the p4 delete command if the depot does exist
- cgl.plugins.perforce.utils.depot.depot_exists(company, project, world)[source]¶
Checks to see if a specific depot exists in perforce name
- Parameters:
depot_name – Name of depot to query
exists (True if depot)
exist (False if depot does not)
- cgl.plugins.perforce.utils.depot.get_depot_name(company, project, world)[source]¶
- Parameters:
company
project
world
Returns:
- cgl.plugins.perforce.utils.depot.get_depots()[source]¶
Gets a list of all depot names registered in Perforce.
- Returns:
all depot names (e.g. [“DP_jhcs_ttas_test”, “DP_dev_xyz”])
- Return type:
list[str]
- cgl.plugins.perforce.utils.depot.get_depots_for_project(company: str, project: str) List[str][source]¶
- Return list of depot names matching pattern:
Depot <depotname> … where depotname follows DP_{company}_{project}_{location}
cgl.plugins.perforce.utils.environment module¶
- cgl.plugins.perforce.utils.environment.check_perforce_environment_variables()[source]¶
Ensures that the p4 environment is setup properly Returns:
cgl.plugins.perforce.utils.git_operations module¶
- cgl.plugins.perforce.utils.git_operations.ask_for_overwrite(company, project, world)[source]¶
- Parameters:
company
project
world
Returns:
- cgl.plugins.perforce.utils.git_operations.check_out_depot(company, project, depot_name, location_name=None)[source]¶
Creates a local copy of the depot and opens it in Unreal :param project: :param depot_name:
Returns:
- cgl.plugins.perforce.utils.git_operations.commit(company, project, world)[source]¶
Commit all files within specified folder
- Parameters:
project – Name of project
world – Name of world
folder – Absolute file path to folder to be committed
- cgl.plugins.perforce.utils.git_operations.pull(company, project, location, check_for_writable=True)[source]¶
Pulls world from depot
- Parameters:
compay – Name of company world belongs to
project – Naame of project world belongs to
location –
Name of world to be pulled
- Returns:
True if pull is successful, False if pull is not successful
cgl.plugins.perforce.utils.user module¶
cgl.plugins.perforce.utils.workspace module¶
- cgl.plugins.perforce.utils.workspace.create_workspace(company, project, location)[source]¶
Create a workspace for the current perforce user
- Parameters:
depot_name – name of the depot that this workspace is mapped to
workspace_name – Name of the workspace to be created
company
project
- Returns:
The path to the workspace directory on disk
- cgl.plugins.perforce.utils.workspace.delete_workspace(path_object=False, workspace_name='')[source]¶
Delete workspace
- Parameters:
path_object – Path object for the current project
workspace_name – Name of workspace to be deleted
- Returns:
Output of the p4 delete command
- cgl.plugins.perforce.utils.workspace.get_all_workspaces()[source]¶
Gets a list of all workspaces registered in perforce
- Returns:
List of workspace names
- cgl.plugins.perforce.utils.workspace.get_current_workspace()[source]¶
Gets the current workspace in perforce
- Returns:
Name of the current workspace
- cgl.plugins.perforce.utils.workspace.get_workspace_path(company, project, world)[source]¶
Get the path to the current workspace
- Parameters:
project – Name of the project