Package ccm
[hide private]
[frames] | no frames]

Package ccm

source code

CM/Synergy Python toolkit.

Submodules [hide private]
  • ccm.conflict: CCM conflict detection module.
  • ccm.extra: Library that contains custom Synergy functionnlities: e.g * Snapshotter that can snapshot unfrozen baselines * Threaded snapshotter.

Classes [hide private]
  CCMException
Base exception that should be raised by methods of this framework.
  Result
Class that abstracts ccm call result handling.
  ProjectCheckoutResult
Project checkout output parser.
  ProjectPurposeResult
Parses purpose query output.
  ConflictsResult
Parses purpose query output.
  FinduseResult
Parses finduse query output.
  UpdateTemplateInformation
Parse update template information output.
  UpdatePropertiesRefreshResult
Parse update template refresh output.
  UpdateResultSimple
Parse update output.
  UpdateResult
Parse update output.
  WorkAreaInfoResult
Parse work area info output.
  CreateNewTaskResult
  AttributeNameListResult
Class that abstract ccm call result handling.
  ObjectListResult
Parses an object list Synergy output.
  DataMapperListResult
Parses an object list Synergy output.
  FolderCopyResult
Parses a folder copy result
  AbstractSession
An abstract Synergy session.
  Session
A Synergy session.
  SessionPool
Session that transparently handled several subsession, to easily enable multithreaded application.
  Query
This object wrap a synergy query, it takes a query as input as well as the attribute you want as output, and get them translated using the model configuration.
  InvalidFourPartNameException
Badly formed Synergy four-part name.
  FourPartName
This class handle four part name parsing and validation.
  CCMObject
Base class for any Synergy object.
  File
Wrapper for any Synergy file object
  Project
Wrapper class for Synergy project object.
  Dir
Wrapper class for Synergy dir object
  Releasedef
Wrapper class for Synergy releasedef object
  Folder
Wrapper class for Synergy folder object
  Task
Wrapper class for Synergy task object
  UpdateTemplate
Allow to access Update Template property using Release and Purpose.
Functions [hide private]
 
_execute(command, timeout=None)
Runs a command and returns the result data.
source code
 
log_result(result, rules, logger=None)
Rules it a list of tuple defining a regular expression and an log level.
source code
 
read_ccmwaid_info(filename)
Read data from a ccmwaid file.
source code
 
create_project_from_path(session, path)
Uses the (_|.)ccmwaid.inf file to create a Project object.
source code
 
open_session(username=None, password=None, engine=None, dbpath=None, database=None, reuse=True)
Provides a Session object.
source code
 
get_role_for_purpose(session, purpose)
return role needed to modify project with checkout for purpose.
source code
 
get_role_for_status(session, status)
return role needed to modify project with a specific status.
source code
 
running_sessions(database=None)
Return the list of synergy session currently available on the local machine.
source code
 
session_exists(sessionid, database=None) source code
Variables [hide private]
  _logger = logging.getLogger("ccm")
  VALID_OBJECT_STATES = 'working', 'checkpoint', 'public', 'prep...
  STATIC_OBJECT_STATES = 'integrate', 'sqa', 'test', 'released'
  CCM_SESSION_LOCK = os.path.join(os.environ ['TEMP'], "ccm_sess...
  CHECKOUT_LOG_RULES = [[r'^Derive failed for', logging.ERROR], ...
  UPDATE_LOG_RULES = [[r'^Update failed.', logging.ERROR], [r'^S...
  CONFLICTS_LOG_RULES = [[r'^\w+#\d+\s+Implicit', logging.WARNIN...
  SYNC_LOG_RULES = [[r'^\s+0\s+Conflict\(s\) for project', loggi...
  CCM_BIN = fileutils.which("ccm.exe")
Function Details [hide private]

read_ccmwaid_info(filename)

source code 
Read data from a ccmwaid file. This method is an helper to retreive a project from a physical location.

open_session(username=None, password=None, engine=None, dbpath=None, database=None, reuse=True)

source code 

Provides a Session object.

Attempts to return a Session, based either on existing Synergy sessions or by creating a new one.

  • If a .netrc file can be found on the user's personal drive, that will be read to obtain Synergy login information if it is defined there. This will be used to fill in any missing parameters not passed in the call to open_session().

    The format of the .netrc file entries should be:

    machine synergy login USERNAME password foobar account DATABASE_PATH@SERVER

    If the details refer to a specific database, the machine can be the database name, instead of "synergy".

  • If an existing session is running that matches the supplied parameters, it will reuse that.

running_sessions(database=None)

source code 
Return the list of synergy session currently available on the local machine. If database is given then it tries to update the router address.

Variables Details [hide private]

VALID_OBJECT_STATES

Value:
'working', 'checkpoint', 'public', 'prep', 'integrate', 'sqa', 'test',\
 'released'

CCM_SESSION_LOCK

Value:
os.path.join(os.environ ['TEMP'], "ccm_session.lock")

CHECKOUT_LOG_RULES

Value:
[[r'^Derive failed for', logging.ERROR], [r'^Serious:', logging.ERROR]\
, [r'^Warning: .* failed.', logging.ERROR], [r'^Warning:', logging.WAR\
NING],]

UPDATE_LOG_RULES

Value:
[[r'^Update failed.', logging.ERROR], [r'^Serious:', logging.ERROR], [\
r'^\s+Failed to', logging.ERROR], [r'^\d+ failures to', logging.ERROR]\
, [r"^Warning: This work area '.+' cannot be reused", logging.ERROR], \
[r'^Rebind of .* failed', logging.ERROR], [r'^Warning: .* failed.', lo\
gging.ERROR], [r'^Skipping \'.*\'\.  You do not have permission to mod\
ify this project.', logging.ERROR], [r'^Work area conflict exists for \
file', logging.ERROR], [r'^Warning:  No candidates found for directory\
 entry', logging.ERROR], [r'^Warning:', logging.WARNING],]

CONFLICTS_LOG_RULES

Value:
[[r'^\w+#\d+\s+Implicit', logging.WARNING], [r'^(.*)\s+(\w+#\d+)\s+(.+\
)', logging.ERROR],]

SYNC_LOG_RULES

Value:
[[r'^\s+0\s+Conflict\(s\) for project', logging.INFO], [r'^\s+\d+\s+Co\
nflict\(s\) for project', logging.ERROR], [r'^Project \'.*\' does not \
maintain a workarea.', logging.ERROR], [r'^Work area conflict exists f\
or file', logging.ERROR], [r'^Warning: Conflicts detected during synch\
ronization. Check your logs.', logging.ERROR], [r'^Warning:', logging.\
WARNING],]