~jml/+junk/bzr-establish

« back to all changes in this revision

Viewing changes to establish/__init__.py

  • Committer: Jonathan Lange
  • Date: 2008-09-07 08:01:50 UTC
  • Revision ID: jml@canonical.com-20080907080150-fzrsemgow98b4ff1
Add a couple of simple utility methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
 
58
58
def get_project_name(name):
59
 
    return name[3:]
 
59
    """Return the name of the project directory given 'name'."""
 
60
    lp_prefix = 'lp:'
 
61
    if name.startswith(lp_prefix):
 
62
        return name[len(lp_prefix):]
 
63
    return name
 
64
 
 
65
 
 
66
def get_trunk_url(name, trunk_url=None):
 
67
    lp_prefix = 'lp:'
 
68
    if name.startswith(lp_prefix):
 
69
        return name
 
70
    return trunk_url
60
71
 
61
72
 
62
73
class Project(object):