| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

Functions | Variables

# git_tag_packages Namespace Reference

## Functions
def | requirements
def | getPackVer
def | main
## Variables
string | __author__ = "Marco Clemencic <Marco.Clemencic@cern.ch>"

## Function Documentation

def git_tag_packages::getPackVer | ( |  | requirements ) |

    Extract package name and package version from a requirements file.

Definition at line 20 of file git_tag_packages.py.

    00021                             :
    00022     """
    00023     Extract package name and package version from a requirements file.
    00024     """
    00025     pattern = re.compile(r"^\s*(version|package)\s*(\S+)\s*$")
    00026     data = dict([m.groups()
    00027                  for m in map(pattern.match, open(requirements))
    00028                  if m])
    00029     return data.get("package", None), data.get("version", None)

def git_tag_packages::main | ( | ) |

Definition at line 30 of file git_tag_packages.py.

    00031           :
    00032     #from optparse import OptionParser
    00033     root = os.path.realpath(__file__)
    00034     root = os.path.dirname(root)
    00035     root = os.path.dirname(root)
    00036     root = os.path.dirname(root)
    00037     for p, v in map(getPackVer, requirements(root)):
    00038         if p and v:
    00039             cmd = ["git", "tag", "%s/%s" % (p, v)]
    00040             print " ".join(cmd) + ":",
    00041             git = Popen(cmd, stdout=PIPE, stderr=PIPE)
    00042             out, err = git .communicate()
    00043             if git.returncode == 0:
    00044                 print "done"
    00045             else:
    00046                 print "failed"
    00047         elif p:
    00048             print "WARNING: no version in package", p
    00049         elif v:
    00050             print "WARNING: found requirements with version (%s), but no package" % v

def git_tag_packages::requirements | ( |  | path ) |

    Generator yielding the paths of the requirements files in a tree.

Definition at line 11 of file git_tag_packages.py.

    00012                       :
    00013     """
    00014     Generator yielding the paths of the requirements files in a tree.
    00015     """
    00016     for root, dirs, files in os.walk(path):
    00017         if "requirements" in files:
    00018             dirs[:] = [] # no need to recurse if we have a 'requirements'
    00019             yield os.path.join(root, "requirements")

## Variable Documentation

string git_tag_packages::__author__ = "Marco Clemencic <Marco.Clemencic@cern.ch>"

Definition at line 5 of file git_tag_packages.py.

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines