Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(96)  |  Call(45)  |  Derive(0)  |  Import(51)
Perform shell/Perl-style variable substitution on 'string'.  Every
occurrence of '$' followed by a name is considered a variable, and
variable is substituted by the value found in the 'local_vars'
dictionary, or in 'os.environ' if it's not in 'local_vars'.
'os.environ' is first checked/augmented to guarantee that it contains
certain values: see 'check_environ()'.  Raise ValueError for any
variables not found in either 'local_vars' or 'os.environ'.

        def subst_vars (s, local_vars):
    """Perform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    """
    check_environ()
    def _subst (match, local_vars=local_vars):
        var_name = match.group(1)
        if var_name in local_vars:
            return str(local_vars[var_name])
        else:
            return os.environ[var_name]

    try:
        return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
    except KeyError, var:
        raise ValueError, "invalid variable '$%s'" % var
        


src/p/y/python-nss-0.14.1/setup.py   python-nss(Download)
from distutils import log
from distutils.filelist import FileList
from distutils.util import subst_vars, change_root
from distutils.command.build_py import build_py as _build_py
from distutils.command.sdist import sdist as _sdist
    """
 
        if src_root is not None: src_root = subst_vars(src_root, substitutions)
        if dst_root is not None: dst_root = subst_vars(dst_root, substitutions)
 
 
        for manifest_template, dst_xforms, dst_dir in install_specs:
            if dst_dir is not None: dst_dir = subst_vars(dst_dir, substitutions)
 
            filelist.files = [] # reinitialize to empty
 
            for line in manifest_template:
                filelist.process_template_line(subst_vars(line, substitutions))

src/d/d/ddocker-HEAD/bin/pex.venv/lib/python2.7/site-packages/setuptools/command/easy_install.py   ddocker(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/4/s/4Suite-XML-1.0.2/Ft/Lib/DistExt/ModuleFinder.py   4Suite-XML(Download)
 
import os
from distutils.util import convert_path, subst_vars
 
from Ft import GetConfigVar
        if module in modules:
            for filespec in DATA_FILES[module]:
                source = subst_vars(convert_path(filespec), source_vars)
                if use_resources:
                    resource = ImportUtil.OsPathToResource(source)
                    source = ImportUtil.GetResourceFilename(module, resource)
                target = subst_vars(convert_path(filespec), target_vars)[1:]

src/w/i/wizlang-HEAD/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py   wizlang(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/r/o/rolf-HEAD/ve/lib/python2.7/site-packages/setuptools/command/easy_install.py   rolf(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/setuptools/command/easy_install.py   antisocial(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/h/e/heroku-buildpack-python-HEAD/vendor/setuptools-2.1/setuptools/command/easy_install.py   heroku-buildpack-python(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/g/o/GoogleMusic.bundle-HEAD/Contents/Libraries/Shared/setuptools/command/easy_install.py   GoogleMusic.bundle(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/n/u/nupic-linux64-HEAD/setuptools-1.0/setuptools/command/easy_install.py   nupic-linux64(Download)
 
from distutils.util import get_platform
from distutils.util import convert_path, subst_vars
from distutils.errors import DistutilsArgError, DistutilsOptionError, \
    DistutilsError, DistutilsPlatformError
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)
 
                    setattr(self,attr,val)
 
        from distutils.util import subst_vars
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                val = subst_vars(val, config_vars)

src/d/i/distribute-0.7.3/setuptools/command/easy_install.py   distribute(Download)

  1 | 2 | 3 | 4 | 5  Next