Back to index

python3.2  3.2.2
Classes | Functions
distutils.command.install_egg_info Namespace Reference

Classes

class  install_egg_info

Functions

def safe_name
def safe_version
def to_filename

Detailed Description

distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.

Function Documentation

Convert an arbitrary string to a standard distribution name

Any runs of non-alphanumeric/. characters are replaced with a single '-'.

Definition at line 55 of file install_egg_info.py.

00055 
00056 def safe_name(name):
00057     """Convert an arbitrary string to a standard distribution name
00058 
00059     Any runs of non-alphanumeric/. characters are replaced with a single '-'.
00060     """
00061     return re.sub('[^A-Za-z0-9.]+', '-', name)
00062 

Here is the call graph for this function:

Here is the caller graph for this function:

Convert an arbitrary string to a standard version string

Spaces become dots, and all other non-alphanumeric characters become
dashes, with runs of multiple dashes condensed to a single dash.

Definition at line 63 of file install_egg_info.py.

00063 
00064 def safe_version(version):
00065     """Convert an arbitrary string to a standard version string
00066 
00067     Spaces become dots, and all other non-alphanumeric characters become
00068     dashes, with runs of multiple dashes condensed to a single dash.
00069     """
00070     version = version.replace(' ','.')
00071     return re.sub('[^A-Za-z0-9.]+', '-', version)
00072 

Here is the call graph for this function:

Here is the caller graph for this function:

Convert a project or version name to its filename-escaped form

Any '-' characters are currently replaced with '_'.

Definition at line 73 of file install_egg_info.py.

00073 
00074 def to_filename(name):
00075     """Convert a project or version name to its filename-escaped form
00076 
00077     Any '-' characters are currently replaced with '_'.
00078     """
00079     return name.replace('-','_')

Here is the caller graph for this function: