Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width50%

On This page

Table of Contents
Column
width5%
 
Column
width45%

On Related Pages

Page Tree
root@self
startDepth3

...

Python

...

  1. Make sure you are running the right version of easy_install http://superuser.com/questions/256717/easy-install-the-wrong-version-of-python-modules-mac-os
  2. From the shell:

    Code Block
    
    ~/platform/trunk>easy_install progressbar
    Searching for progressbar
    Reading http://pypi.python.org/simple/progressbar/
    Reading http://code.google.com/p/python-progressbar/
    Reading http://code.google.com/p/python-progressbar
    Best match: progressbar 2.3
    Downloading http://python-progressbar.googlecode.com/files/progressbar-2.3.tar.gz
    Processing progressbar-2.3.tar.gz
    Running progressbar-2.3/setup.py -q bdist_egg --dist-dir /var/folders/h0/h0pR5063FtCMCzzo1bt2WU+++TI/-Tmp-/easy_install-a29dGI/progressbar-2.3/egg-dist-tmp-3Dwzuw
    zip_safe flag not set; analyzing archive contents...
    Adding progressbar 2.3 to easy-install.pth file
    
    Installed /Library/Python/2.7/site-packages/progressbar-2.3-py2.7.egg
    Processing dependencies for progressbar
    Finished processing dependencies for progressbar
    

Python Examples for Perl programmers

  1. Example: empty dictionary, add values to it

    Code Block
    
    layer = {}
    layer["type"] = row[1]
    layer["status"] = row[2]
    layer["name"] = row[3]
    layer["numSamples"] = row[4]
    layer["platform"] = row[5]
    layer["version"] = row[6]
    layer["qcBy"] = row[11]
    
  2. Example: empty two level dictionary, add values to it

    Code Block
    
    layer = {}
    layer['foo'] = {}
    layer['foo']['bar'] = 3
    layer['hello'] = {}
    layer['hello']['world'] = 42
    
  3. Example: create a populated dictionary

    Code Block
    
    CSV_TO_PRIMARY_FIELDS = {
        'name': 'name',
        'description': 'description',
        'Investigator': 'creator',
        'Creation Date': 'creationDate',
        'Status': 'status',
        'date_released': 'releaseDate',
        'version':'version'
        }
  4. Example: create a populated two-level dictionary

    Code Block
    
    MY_FAKE_LAYER = {'foo': {'bar': 3}, 'hello': {'world': 42}}
    
  5. Example: empty array, add values to it

    Code Block
    
    stringAnnotations = []
        stringAnnotations.append("foo")
    
  6. Example: create a populated array

    Code Block
    
    CSV_SKIP_FIELDS = ["db_id","user_agreement_file_path", "readme_file_path"];
    

...

How to Set Up Merge Tracking

  1. Download svnmerge.py
  2. Make a branch directory for yourself (you'll only need to do this once)

    Code Block
    
    svn mkdir https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux
    
  3. Make a new branch from trunk

    Code Block
    
    svn copy https://sagebionetworks.jira.com/svn/PLFM/trunk https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
    
  4. Have both trunk and your new branch on your local hard drive, this assumes you already have trunk checked out in directory ~/platform

    Code Block
    
    cd ~/platform
    svn update trunk
    svn checkout https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
    
  5. Initialize merge tracking

    Code Block
    
    cd trunk
    svnmerge.py init ../automatedIntegrationTesting
    svn commit -F svnmerge-commit-message.txt
    cd ../automatedIntegrationTesting
    svnmerge.py init ../trunk
    svn commit -F svnmerge-commit-message.txt
    

Alternative: Initialize merge tracking and switch to your new branch

Code Block

cd trunk
svnmerge.py init https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/sts
svn commit -F svnmerge-commit-message.txt
svn switch https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/sts
svnmerge.py init https://sagebionetworks.jira.com/svn/PLFM/trunk
svn commit -F svnmerge-commit-message.txt

...

  1. Ensure the branch is working and committed to SVN.
  2. To see what changes and/or branches are available for importing, use this command from the branch distribution:

    Code Block
    
    python svnmerge.py avail -l
    
    • Windows Users: One of the results should be '/PLFM/trunk'.
  3. import the changes from trunk into the branch:
    • to merge all changes

      Code Block
      
      python svnmerge.py merge -S /PLFM/trunk
      
    • to merge one or more particular changes

      Code Block
      
      python svnmerge.py merge -r #,#,# -S /PLFM/trunk
      
  4. Resolve conflicts, compile, test and commit EVERYTHING in the branch.

    Code Block
    
    svn ci -F svnmerge-commit-message.txt
    

...

  1. Go to an up-to-date local distribution of trunk.
  2. From the trunk distribution use the 'avail' command (above) to find the branch of interest.
  3. Use the following command to find the revision(s) of interest:

    Code Block
    
    python svnmerge.py avail -S <your branch>
    
  4. Import the changes from the branch into trunk:
    1. For all changes

      Code Block
      
      python svnmerge.py merge -S <your branch>
      
    2. For particular changes

      Code Block
      
      python svnmerge.py merge -r <your revisions comma separated> -S <your branch>
      
  5. Resolve conflicts, compile, test and commit.

...