Release Notes for P4Python, the Python interface to the Perforce SCM System GA Release 2007.3 February 14, 2008 Introduction This document lists all user-visible changes to P4Python from release 2007.3, the first supported P4Python release. Perforce numbers releases YYYY.R/CCCCC, for example, 2007.3/30547. YYYY is the year; R is the release of that year; CCCCC is the bugfix change level. Each bug fix in these release notes is marked by its change number. Any build includes all bug fixes of all previous releases and all bug fixes of the current release up to the bug fix change level. To display the version of P4Python you have installed, start Python and issue the following commands: >>> import P4 >>> print P4.P4.identify() Installing P4Python Windows users can download an installer for P4Python from the Perforce FTP site. Users on other platforms must build from source. Upgrading P4Python Before installing P4Python 2007.3, uninstall any older version of P4Python. Previous version of P4Python consisted of the following files: p4.py p4.pyc p4.pyo P4Client.pyd Building P4Python from Source 1. Download a suitable Perforce API build from the Perforce FTP site 2. Extract the API tarfile into an empty directory 3. Modify the file setup.cfg to reflect the location of the API p4_api= 3. Build P4Python with the following command: python setup.py build python p4test.py NOTE: The test harness requires that 'p4d' be installed and in the PATH 4. To install P4Python, run the following command. On Unix systems, this step should be run as root: python setup.py install Ensure that the umask is set correctly (typically 0022) before running the install. With a umask of 027, for example, the resulting installed files will only be accessable by user of group root. Compatibility Statements 1. Server Compatibility Unless stated otherwise you can intermix any release of P4Python with any release of the Perforce server later than 2001.1 2. API Compatibility The 2007.3 release of P4Python requires the 2007.3 Perforce API. Older releases (down to 2006.2) may also work, but they are not supported. 3. Python compatibility The 2007.3 release of P4Python has been build and tested with Python 2.5.1. 4. Platform compatibility This release is certified on the following platforms: Linux Solaris Windows FreeBSD 5. Compiler Compatibility To build P4Python from source, you MUST use a version of P4Python that has been compiled with the same compiler used to build the Perforce C++ API. For most platforms, this means gcc/g++. Attempting to use a different compiler or a different version of the compiler will probably result in linker errors due to differences in name handling between compilers. On Windows platforms, Python 2.5.1 and the P4Python installer are built with Visual Studio 2003. You can download the static version of the Perforce API for this compiler from the Perforce ftp site and build P4Python yourself. Visual Studio 2005 cannot be used to compile Python or P4Python. Use the P4Python Windows installer available from the Perforce web site. 6. Compatibility with Previous Releases There are no previous releases of P4Python from Perforce Software Inc. 7. Compatibility with the P4Python from the Public Depot Perforce P4Python is significantly different from the version of P4Python in the Perforce Public Depot. Perforce P4Python contains several improvements and interface changes intended to make P4Python consistent with the other scripting interfaces and with Python in general. Users migrating from Public Depot P4Python will need to edit their scripts in order to ensure that they comply with the new interface. For convenience, the differences are detailed below. New module name The P4Python module has been renamed from p4 to P4. For example: Old: >>> import p4 >>> p4c = p4.P4() New: >>> import P4 >>> p4 = P4.P4() By convention, Public Depot P4Python used 'p4c' as an instance variable because 'p4' was used as a module name. Now that the module has been renamed 'P4', you have the option of using 'p4' for your instance variables. All demos and tests use the new convention. Deleted methods The following methods have been deleted from the P4 class and are no longer available: dropped - Use connected() parse_forms - Form parsing is now always on tagged - See tagged attribute below. New methods The following methods are new to Perforce P4Python: connected - Returns True if the client is connected format_xxx - Converts a dict-based specification into a string (replace xxx with spec type, for example: format_client) identify - Returns information about P4Python parse_xxx - Converts a string into a P4.Spec object (replace xxx with spec type) run_filelog - Runs 'p4 filelog' and returns an array of P4.DepotFile objects run_login - Runs 'p4 login' using current password run_password - Runs 'p4 passwd' with old and new password run_submit - Runs 'p4 submit' Attributes Perforce P4Python provides the following attributes. Attributes may be set in the P4() constructor or using their 'setters and getters'. For example: >>> import P4 >>> p4 = P4.P4(client="myclient", port="1666") >>> p4.user = 'me' Most attributes can be set and read. Except where indicated, attributes are strings. api_level API compatibility level, INTEGER charset The charset to use. String, not a constant as in previous versions client Client to use (P4CLIENT) cwd Current Working Directory debug Debug level (for debugging P4Python), INTEGER errors Array of errors returned by the server (Read-Only), LIST exception_level Determines whether exceptions are thrown, INTEGER host Client Host input Input for next command, can be STRING, LIST or DICTIONARY maxlocktime MaxLockTime for commands, INTEGER maxresults MaxResults for commands, INTEGER maxscanrows MaxScanRows for commands, INTEGER p4config_file Returns the config file path (Read-Only) password Value of P4PASSWD port Value of P4PORT prog Name of the script, shown in the server log server_level Returns the server level (Read-Only) tagged Boolean value, determines whether to use tagged mode, INTEGER ticket_file Returns the name of the ticket file user Value of P4USER warnings Array of warnings returned by the server (Read-Only), LIST Tagged mode and form parsing In Perforce P4Python 2007.3, form parsing and tagged output are enabled by default. (In Public Depot P4Python, tagged output and form parsing mode were disabled by default, but most scripts enabled them immediately.) Form parsing cannot be disabled explicitly, but tagged output can be enabled or disabled by setting p4.tagged as follows: p4.tagged = False # Disabled p4.tagged = True # Enabled This method can be used to disable form parsing, because form parsing does not work when tagged output is disabled. * -- requires new p4python ** -- requires new p4d server program *** -- requires new P4API -------------------------------------------------------------------------------- Bugs Fixed since 2007.3 Beta #146024 * P4.Revision doesn't have a depot_file, or depotFile attribute as its counterparts in P4Perl and P4Ruby do.