Package perforce :: Package async :: Module connection
[frames] | no frames]

Module connection



perforce.async.connection - Asynchronous Perforce connection API.

The asynchronous API uses Twisted to handle asynchronous notification of operations.

Classes
  ConnectionFailed
  ConnectionDropped
  Connection
A Perforce connection that allows asynchronous running of commands.
Functions
Connection
connectPerforce(port=None, host=None, language=None, charset=None, cwd=None, client=None, user=None, password=None, ticketFile=None, ignorePassword=False, prog=None, version=None, api=None)
Connect to a Perforce server asynchronously.
Function Details

connectPerforce(port=None, host=None, language=None, charset=None, cwd=None, client=None, user=None, password=None, ticketFile=None, ignorePassword=False, prog=None, version=None, api=None)

 

Connect to a Perforce server asynchronously.

Accepts a number of parameters that let you specify the default values to use for Perforce environment variables for this connection. Some of these variables may also be overridden on a per-command basis via the Connection.run() method.
Parameters:
  • port (str or unicode) - The Perforce server host and port string. If not specified then the P4PORT environment variable will be used. eg 'perforce:1666'
  • host (str or unicode) - The local client's host name if it needs to be overridden. If not specified then the P4HOST environment variable or the machine name will be used.
  • language (str or unicode) - The language to use for returned Perforce messages. If not specified then the P4LANGUAGE environment variable will be used.
  • charset (perforce.api.CharSet, str, unicode or None) - The character set to be used for encoding data sent to/from the Perforce server. Required to be set if connecting to a Unicode enabled server. If not set then the P4CHARSET environment variable will be used.
  • cwd (str or unicode) - The current working directory to use for commands on this connection. If not set then the process' current working directory will be used.
  • client (str or unicode) - The Perforce client to use for commands on this connection. If not set then the P4CLIENT environment variable will be used.
  • user (str or unicode) - The Perforce username to use for this connection. If not set then the P4USER environment variable will be used.
  • password (str or unicode) - The password to authenticate the Perforce user with. If not set then the P4PASSWD environment variable will be used. May also be the value of a ticket returned from a 'p4 login' command if the server supports tickets.
  • prog (str or unicode) - The program name to identify the connection with. This shows up on the 'p4 monitor' command and Perforce server logs.
  • version (str or unicode) - The program version to identify the connection with. This shows up on the 'p4 monitor' command and Perforce server logs. Only supported for Perforce 2005.2 or later clients.
  • ticketFile (str or unicode) - The path of the ticket file to use for this connection. All tickets used for authentication will be stored and retrieved from this file.
  • ignorePassword (boolean) - Flag indicating whether passwords retrieved from the environment, registry or P4CONFIG file should be ignored.
  • api (str) - The preferred Perforce protocol version to use for this connection. Setting this parameter can help to insulate code against protocol changes due to server upgrades.
Returns: Connection
A deferred that fires with the connection object once the connection has been established.
Raises: