diff --git a/easybuild/easyblocks/a/atlas.py b/easybuild/easyblocks/a/atlas.py index 24f93a78fc..d4235a35fd 100644 --- a/easybuild/easyblocks/a/atlas.py +++ b/easybuild/easyblocks/a/atlas.py @@ -35,7 +35,7 @@ from easybuild.tools.modules import get_software_root -class ATLAS(Application): +class EB_ATLAS(Application): """ Support for building ATLAS - configure (and check if it failed due to CPU throttling being enabled) diff --git a/easybuild/easyblocks/b/binary.py b/easybuild/easyblocks/b/binary.py index 84855b4cdb..32936246ad 100644 --- a/easybuild/easyblocks/b/binary.py +++ b/easybuild/easyblocks/b/binary.py @@ -33,7 +33,7 @@ from easybuild.framework.application import Application -class Binary(Application): +class EB_Binary(Application): """Support for installing a binary package. Just copy it's sources to the installdir""" diff --git a/easybuild/easyblocks/b/blacs.py b/easybuild/easyblocks/b/blacs.py index 3fb3d3944d..fd69355078 100644 --- a/easybuild/easyblocks/b/blacs.py +++ b/easybuild/easyblocks/b/blacs.py @@ -50,7 +50,7 @@ def det_interface(log, path): log.error("Failed to determine interface, output for xintface: %s" % out) -class BLACS(Application): +class EB_BLACS(Application): """ Support for building/installing BLACS - configure: symlink BMAKES/Bmake.MPI-LINUX to Bmake.inc diff --git a/easybuild/easyblocks/c/cp2k.py b/easybuild/easyblocks/c/cp2k.py index 236ceff89a..b82d572e91 100644 --- a/easybuild/easyblocks/c/cp2k.py +++ b/easybuild/easyblocks/c/cp2k.py @@ -41,7 +41,7 @@ from easybuild.tools.modules import get_software_root, get_software_version -class CP2K(Application): +class EB_CP2K(Application): """ Support for building CP2K - prepare module include files if required diff --git a/easybuild/easyblocks/c/cplex.py b/easybuild/easyblocks/c/cplex.py index 28f4150213..bba69a2174 100644 --- a/easybuild/easyblocks/c/cplex.py +++ b/easybuild/easyblocks/c/cplex.py @@ -30,7 +30,7 @@ from easybuild.tools.filetools import run_cmd_qa -class CPLEX(Binary): +class EB_CPLEX(Binary): """ Support for installing CPLEX. Version 12.2 has a self-extracting package with a Java installer diff --git a/easybuild/easyblocks/d/doxygen.py b/easybuild/easyblocks/d/doxygen.py index 2156c04394..e9d7790c3b 100644 --- a/easybuild/easyblocks/d/doxygen.py +++ b/easybuild/easyblocks/d/doxygen.py @@ -30,7 +30,7 @@ from easybuild.tools.filetools import run_cmd -class Doxygen(Application): +class EB_Doxygen(Application): """Support for building/installing Doxygen""" def configure(self): diff --git a/easybuild/easyblocks/f/fsl.py b/easybuild/easyblocks/f/fsl.py index 55c7b28668..f6c51bfefe 100644 --- a/easybuild/easyblocks/f/fsl.py +++ b/easybuild/easyblocks/f/fsl.py @@ -32,7 +32,7 @@ from easybuild.tools.filetools import run_cmd -class FSL(Application): +class EB_FSL(Application): """Support for building and installing FSL.""" def __init__(self,*args,**kwargs): diff --git a/easybuild/easyblocks/g/g2clib.py b/easybuild/easyblocks/g/g2clib.py index a0879f27bb..6b5b53cd7c 100644 --- a/easybuild/easyblocks/g/g2clib.py +++ b/easybuild/easyblocks/g/g2clib.py @@ -34,7 +34,7 @@ from easybuild.tools.modules import get_software_root -class G2clib(Application): +class EB_g2clib(Application): """Support for building g2clib GRIB2 C library.""" def configure(self): diff --git a/easybuild/easyblocks/g/g2lib.py b/easybuild/easyblocks/g/g2lib.py index b9887e581a..51ce554160 100644 --- a/easybuild/easyblocks/g/g2lib.py +++ b/easybuild/easyblocks/g/g2lib.py @@ -33,7 +33,7 @@ from easybuild.tools.modules import get_software_root -class G2lib(Application): +class EB_g2lib(Application): """Support for building g2clib GRIB2 library.""" def configure(self): diff --git a/easybuild/easyblocks/g/gcc.py b/easybuild/easyblocks/g/gcc.py index 4d0633eea8..dfdbaabae9 100644 --- a/easybuild/easyblocks/g/gcc.py +++ b/easybuild/easyblocks/g/gcc.py @@ -41,7 +41,7 @@ from easybuild.tools.systemtools import get_kernel_name, get_shared_lib_ext, get_platform_name -class GCC(Application): +class EB_GCC(Application): """ Self-contained build of GCC. Uses system compiler for initial build, then bootstraps. diff --git a/easybuild/easyblocks/h/hdf5.py b/easybuild/easyblocks/h/hdf5.py index 463ccc1a64..64a970b3a9 100644 --- a/easybuild/easyblocks/h/hdf5.py +++ b/easybuild/easyblocks/h/hdf5.py @@ -32,7 +32,7 @@ from easybuild.tools.modules import get_software_root -class HDF5(Application): +class EB_HDF5(Application): """Support for building/installing HDF5""" def configure(self): diff --git a/easybuild/easyblocks/h/hpl.py b/easybuild/easyblocks/h/hpl.py index 3aeb94e316..152a932ab8 100644 --- a/easybuild/easyblocks/h/hpl.py +++ b/easybuild/easyblocks/h/hpl.py @@ -33,7 +33,7 @@ from easybuild.tools.filetools import run_cmd -class HPL(Application): +class EB_HPL(Application): """ Support for building HPL (High Performance Linpack) - create Make.UNKNOWN diff --git a/easybuild/easyblocks/i/icc.py b/easybuild/easyblocks/i/icc.py index a838fa31a7..467a46babb 100644 --- a/easybuild/easyblocks/i/icc.py +++ b/easybuild/easyblocks/i/icc.py @@ -32,7 +32,7 @@ from easybuild.easyblocks.i.intelbase import IntelBase -class Icc(IntelBase): +class EB_icc(IntelBase): """Support for installing icc - tested with 11.1.046 diff --git a/easybuild/easyblocks/i/ifort.py b/easybuild/easyblocks/i/ifort.py index 303328ad03..dd89307d87 100644 --- a/easybuild/easyblocks/i/ifort.py +++ b/easybuild/easyblocks/i/ifort.py @@ -31,7 +31,7 @@ from easybuild.easyblocks.i.icc import Icc, IntelBase -class Ifort(Icc): +class EB_ifort(Icc): """ Class that can be used to install ifort - tested with 11.1.046 diff --git a/easybuild/easyblocks/i/imkl.py b/easybuild/easyblocks/i/imkl.py index 1ee437ee8e..1098448115 100644 --- a/easybuild/easyblocks/i/imkl.py +++ b/easybuild/easyblocks/i/imkl.py @@ -39,7 +39,7 @@ from easybuild.tools.modules import Modules -class Imkl(IntelBase): +class EB_imkl(IntelBase): """ Class that can be used to install mkl - tested with 10.2.1.017 diff --git a/easybuild/easyblocks/i/impi.py b/easybuild/easyblocks/i/impi.py index 8c6ae8ab68..b3dd7f498d 100644 --- a/easybuild/easyblocks/i/impi.py +++ b/easybuild/easyblocks/i/impi.py @@ -33,7 +33,7 @@ from easybuild.tools.filetools import run_cmd -class Impi(IntelBase): +class EB_impi(IntelBase): """ Support for installing Intel MPI library """ diff --git a/easybuild/easyblocks/i/intelbase.py b/easybuild/easyblocks/i/intelbase.py index b6410da40e..bc83bdc046 100644 --- a/easybuild/easyblocks/i/intelbase.py +++ b/easybuild/easyblocks/i/intelbase.py @@ -35,7 +35,7 @@ from easybuild.tools.filetools import run_cmd -class IntelBase(Application): +class EB_intelBase(Application): """ Base class for Intel software - no configure/make : binary release diff --git a/easybuild/easyblocks/i/ipp.py b/easybuild/easyblocks/i/ipp.py index d7ff219fa2..f931be3343 100644 --- a/easybuild/easyblocks/i/ipp.py +++ b/easybuild/easyblocks/i/ipp.py @@ -29,7 +29,7 @@ from easybuild.easyblocks.i.intelbase import IntelBase -class Ipp(IntelBase): +class EB_ipp(IntelBase): def sanitycheck(self): diff --git a/easybuild/easyblocks/i/itac.py b/easybuild/easyblocks/i/itac.py index ab61fcda0a..052e3547f8 100644 --- a/easybuild/easyblocks/i/itac.py +++ b/easybuild/easyblocks/i/itac.py @@ -33,7 +33,7 @@ from easybuild.tools.filetools import run_cmd -class Itac(IntelBase): +class EB_itac(IntelBase): """ Class that can be used to install itac - tested with Intel Trace Analyzer and Collector 7.2.1.008 diff --git a/easybuild/easyblocks/l/lapack.py b/easybuild/easyblocks/l/lapack.py index 01118e8258..efc3d56a01 100644 --- a/easybuild/easyblocks/l/lapack.py +++ b/easybuild/easyblocks/l/lapack.py @@ -61,7 +61,7 @@ def get_blas_lib(log): return blaslib -class LAPACK(Application): +class EB_LAPACK(Application): """ Support for building LAPACK - read make.inc.example and replace BLAS line with configtops diff --git a/easybuild/easyblocks/l/libsmm.py b/easybuild/easyblocks/l/libsmm.py index 45b06b8192..64468a044d 100644 --- a/easybuild/easyblocks/l/libsmm.py +++ b/easybuild/easyblocks/l/libsmm.py @@ -38,7 +38,7 @@ from easybuild.tools.modules import get_software_root, get_software_version -class Libsmm(Application): +class EB_libsmm(Application): """ Support for the CP2K small matrix library Notes: - build can take really really long, and no real rebuilding needed for each version diff --git a/easybuild/easyblocks/m/maple.py b/easybuild/easyblocks/m/maple.py index 489b8711c1..e09b4be15d 100644 --- a/easybuild/easyblocks/m/maple.py +++ b/easybuild/easyblocks/m/maple.py @@ -33,7 +33,7 @@ from easybuild.tools.filetools import run_cmd_qa -class Maple(Application): +class EB_Maple(Application): """Support for installing Maple.""" def unpack_src(self): diff --git a/easybuild/easyblocks/m/mrbayes.py b/easybuild/easyblocks/m/mrbayes.py index 3eabb898e3..11cec923ac 100644 --- a/easybuild/easyblocks/m/mrbayes.py +++ b/easybuild/easyblocks/m/mrbayes.py @@ -36,7 +36,7 @@ from easybuild.tools.modules import get_software_root -class MrBayes(Application): +class EB_MrBayes(Application): """Support for building/installing MrBayes.""" def configure(self): diff --git a/easybuild/easyblocks/m/mvapich2.py b/easybuild/easyblocks/m/mvapich2.py index eb6b3676c7..fa00784bda 100644 --- a/easybuild/easyblocks/m/mvapich2.py +++ b/easybuild/easyblocks/m/mvapich2.py @@ -33,7 +33,7 @@ from easybuild.framework.easyconfig import CUSTOM -class MVAPICH2(Application): +class EB_MVAPICH2(Application): """ Support for building the MVAPICH2 MPI library. - some compiler dependent configure options diff --git a/easybuild/easyblocks/n/ncl.py b/easybuild/easyblocks/n/ncl.py index 26f196d4b4..daaaa4105d 100644 --- a/easybuild/easyblocks/n/ncl.py +++ b/easybuild/easyblocks/n/ncl.py @@ -37,7 +37,7 @@ from easybuild.tools.modules import get_software_root, get_software_version -class NCL(Application): +class EB_NCL(Application): """Support for building/installing NCL.""" def configure(self): diff --git a/easybuild/easyblocks/n/netcdf.py b/easybuild/easyblocks/n/netcdf.py index ed2babf71d..f04089cec9 100644 --- a/easybuild/easyblocks/n/netcdf.py +++ b/easybuild/easyblocks/n/netcdf.py @@ -35,7 +35,7 @@ from easybuild.tools.modules import get_software_root, get_software_version -class NetCDF(Application): +class EB_netCDF(Application): """Support for building/installing netCDF""" def configure(self): diff --git a/easybuild/easyblocks/n/netcdf_fortran.py b/easybuild/easyblocks/n/netcdf_fortran.py index c69bd64061..10054015c0 100644 --- a/easybuild/easyblocks/n/netcdf_fortran.py +++ b/easybuild/easyblocks/n/netcdf_fortran.py @@ -33,7 +33,7 @@ from easybuild.framework.application import Application -class NetCDF_Fortran(Application): +class EB_netCDF_Fortran(Application): """Support for building/installing the netCDF-Fortran library""" def configure(self): diff --git a/easybuild/easyblocks/o/openfoam.py b/easybuild/easyblocks/o/openfoam.py index 555bef8ff2..c4ace2dce3 100644 --- a/easybuild/easyblocks/o/openfoam.py +++ b/easybuild/easyblocks/o/openfoam.py @@ -36,7 +36,7 @@ from easybuild.tools.modules import get_software_root -class OpenFOAM(Application): +class EB_OpenFOAM(Application): """Support for building and installing OpenFOAM.""" def __init__(self,*args,**kwargs): diff --git a/easybuild/easyblocks/p/packedbinary.py b/easybuild/easyblocks/p/packedbinary.py index 79d8a256be..59f84d668b 100644 --- a/easybuild/easyblocks/p/packedbinary.py +++ b/easybuild/easyblocks/p/packedbinary.py @@ -27,7 +27,7 @@ from easybuild.easyblocks.b.binary import Binary -class PackedBinary(Binary, Application): +class EB_PackedBinary(Binary, Application): """Support for installing a packed binary package. Just unpack its source in the installdir """ diff --git a/easybuild/easyblocks/p/pasha.py b/easybuild/easyblocks/p/pasha.py index e9406bef8f..28583fabd2 100644 --- a/easybuild/easyblocks/p/pasha.py +++ b/easybuild/easyblocks/p/pasha.py @@ -29,7 +29,7 @@ from easybuild.tools.modules import get_software_root -class Pasha(Application): +class EB_Pasha(Application): """Support for building and installing Pasha""" def configure(self): diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index e25d7f4c13..709445145f 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -35,7 +35,7 @@ from easybuild.tools.modules import get_software_root -class Python(Application): +class EB_Python(Application): """Support for building/installing Python - default configure/make/make install works fine @@ -51,10 +51,10 @@ def extra_packages_pre(self): """ We set some default configs here for packages included in python """ - #insert new packages by building them with DefaultPythonPackage + #insert new packages by building them with EB_DefaultPythonPackage self.log.debug("setting extra packages options") - # use __name__ here, since this is the module where DefaultPythonPackage is defined - self.setcfg('pkgdefaultclass', (__name__, "DefaultPythonPackage")) + # use __name__ here, since this is the module where EB_DefaultPythonPackage is defined + self.setcfg('pkgdefaultclass', (__name__, "EB_DefaultPythonPackage")) self.setcfg('pkgfilter', ('python -c "import %(name)s"', "")) def make_install(self): @@ -71,7 +71,7 @@ def make_install(self): self.log.error("Failed to symlink %s to %s: %s" % err) -class DefaultPythonPackage(ApplicationPackage): +class EB_DefaultPythonPackage(ApplicationPackage): """ Easyblock for python packages to be included in the python installation. """ @@ -189,10 +189,10 @@ def getcfg(self, *args, **kwargs): return self.mself.getcfg(*args, **kwargs) -class Nose(DefaultPythonPackage): +class EB_nose(EB_DefaultPythonPackage): """nose package""" def __init__(self, mself, pkg, pkginstalldeps): - DefaultPythonPackage.__init__(self, mself, pkg, pkginstalldeps) + EB_DefaultPythonPackage.__init__(self, mself, pkg, pkginstalldeps) # use extra unpack options to avoid problems like # 'tar: Ignoring unknown extended header keyword `SCHILY.nlink' @@ -200,8 +200,8 @@ def __init__(self, mself, pkg, pkginstalldeps): self.unpack_options = ' --pax-option="delete=SCHILY.*" --pax-option="delete=LIBARCHIVE.*" ' -class FortranPythonPackage(DefaultPythonPackage): - """Extends DefaultPythonPackage to add a Fortran compiler to the make call""" +class EB_FortranPythonPackage(EB_DefaultPythonPackage): + """Extends EB_DefaultPythonPackage to add a Fortran compiler to the make call""" def make(self): comp_fam = self.toolkit().comp_family() @@ -227,11 +227,11 @@ def make(self): run_cmd(cmd, log_all=True, simple=True) -class Numpy(FortranPythonPackage): +class EB_numpy(EB_FortranPythonPackage): """numpy package""" def __init__(self, mself, pkg, pkginstalldeps): - FortranPythonPackage.__init__(self, mself, pkg, pkginstalldeps) + EB_FortranPythonPackage.__init__(self, mself, pkg, pkginstalldeps) self.pkgcfgs = mself.getcfg('pkgcfgs') if self.pkgcfgs.has_key('numpysitecfglibsubdirs'): @@ -302,7 +302,7 @@ def make_install(self): """Install numpy package We remove the numpy build dir here, so scipy doesn't find it by accident """ - FortranPythonPackage.make_install(self) + EB_FortranPythonPackage.make_install(self) builddir = os.path.join(self.builddir, "numpy") if os.path.isdir(builddir): shutil.rmtree(builddir) @@ -310,11 +310,11 @@ def make_install(self): self.log.debug("build dir %s already clean" % builddir) -class Scipy(FortranPythonPackage): +class EB_scipy(EB_FortranPythonPackage): """scipy package""" def __init__(self, mself, pkg, pkginstalldeps): - FortranPythonPackage.__init__(self, mself, pkg, pkginstalldeps) + EB_FortranPythonPackage.__init__(self, mself, pkg, pkginstalldeps) # disable testing test = False diff --git a/easybuild/easyblocks/s/scalapack.py b/easybuild/easyblocks/s/scalapack.py index 2a48212901..1b1ccc601d 100644 --- a/easybuild/easyblocks/s/scalapack.py +++ b/easybuild/easyblocks/s/scalapack.py @@ -37,7 +37,7 @@ from easybuild.tools.modules import get_software_root -class ScaLAPACK(Application): +class EB_ScaLAPACK(Application): """ Support for building and installing ScaLAPACK, both versions 1.x and 2.x """ diff --git a/easybuild/easyblocks/t/tarball.py b/easybuild/easyblocks/t/tarball.py index 7e60633a0c..31ba7f8440 100644 --- a/easybuild/easyblocks/t/tarball.py +++ b/easybuild/easyblocks/t/tarball.py @@ -32,7 +32,7 @@ from easybuild.framework.application import Application -class Tarball(Application): +class EB_Tarball(Application): """ Precompiled software packaged as tarball: - will unpack binary and copy it to the install dir diff --git a/easybuild/easyblocks/t/tbb.py b/easybuild/easyblocks/t/tbb.py index b4602852a8..a4a439b455 100644 --- a/easybuild/easyblocks/t/tbb.py +++ b/easybuild/easyblocks/t/tbb.py @@ -33,7 +33,7 @@ from easybuild.easyblocks.i.intelbase import IntelBase -class Tbb(IntelBase): +class EB_tbb(IntelBase): """EasyBlock for tbb, threading building blocks""" def make_install(self): diff --git a/easybuild/easyblocks/t/toolkit.py b/easybuild/easyblocks/t/toolkit.py index 8de48b911b..822c6b1193 100644 --- a/easybuild/easyblocks/t/toolkit.py +++ b/easybuild/easyblocks/t/toolkit.py @@ -29,7 +29,7 @@ from easybuild.framework.application import Application -class Toolkit(Application): +class EB_Toolkit(Application): """ Compiler toolkit: generate module file only, nothing to make/install """ diff --git a/easybuild/easyblocks/w/wps.py b/easybuild/easyblocks/w/wps.py index a26c4e6800..e2eb7a9b42 100644 --- a/easybuild/easyblocks/w/wps.py +++ b/easybuild/easyblocks/w/wps.py @@ -43,7 +43,7 @@ from easybuild.tools.modules import get_software_root, get_software_version -class WPS(Application): +class EB_WPS(Application): """Support for building/installing WPS.""" def __init__(self, *args, **kwargs): diff --git a/easybuild/easyblocks/w/wrf.py b/easybuild/easyblocks/w/wrf.py index a41c1d97b2..8e083ae789 100644 --- a/easybuild/easyblocks/w/wrf.py +++ b/easybuild/easyblocks/w/wrf.py @@ -40,7 +40,7 @@ from easybuild.tools.modules import get_software_root -class WRF(Application): +class EB_WRF(Application): """Support for building/installing WRF.""" def __init__(self,*args,**kwargs): diff --git a/easybuild/framework/application.py b/easybuild/framework/application.py index 646d62a8de..2ccc14f6c8 100644 --- a/easybuild/framework/application.py +++ b/easybuild/framework/application.py @@ -45,7 +45,7 @@ from easybuild.framework.easyconfig import EasyConfig from easybuild.tools.build_log import EasyBuildError, initLogger, removeLogHandler,print_msg from easybuild.tools.config import source_path, buildPath, installPath -from easybuild.tools.filetools import unpack, patch, run_cmd, convertName +from easybuild.tools.filetools import unpack, patch, run_cmd, convertName, encode_class_name from easybuild.tools.module_generator import ModuleGenerator from easybuild.tools.modules import Modules, get_software_root from easybuild.tools.toolkit import Toolkit @@ -1401,7 +1401,7 @@ def extra_packages(self): allclassmodule = pkgdefaultclass[0] defaultClass = pkgdefaultclass[1] for pkg in self.pkgs: - name = pkg['name'][0].upper() + pkg['name'][1:] # classnames start with a capital + name = encode_class_name(pkg['name']) # Use the same encoding as get_class self.log.debug("Starting package %s" % name) try: @@ -1566,8 +1566,8 @@ def get_class(easyblock, log, name=None): name = "UNKNOWN" modulepath = module_path_for_easyblock(name) - # don't use capitalize, as it changes 'GCC' into 'Gcc', we want to keep the capitals that are there already - class_name = name[0].upper() + name[1:].replace('-','_') + # The following is a generic way to calculate unique class names for any funny package title + class_name = encode_class_name(name) # try and find easyblock easyblock_found = False diff --git a/easybuild/tools/filetools.py b/easybuild/tools/filetools.py index 0ee01a0d04..cdbb98b6e7 100644 --- a/easybuild/tools/filetools.py +++ b/easybuild/tools/filetools.py @@ -717,3 +717,68 @@ def patch_perl_script_autoflush(path): except IOError, err: log.error("Failed to patch Perl configure script: %s" % err) + + +def encode_string(name): + """ + This encoding function handles funky package names ad infinitum, like: + example: '0_foo+0x0x#-$__' + becomes: '0_underscore_foo_plus_0x0x_hash__minus__dollar__underscore__underscore_' + The intention is to have a robust escaping mechanism for names like c++, C# et al + + It has been inspired by the concepts seen at, but in lowercase style: + * http://fossies.org/dox/netcdf-4.2.1.1/escapes_8c_source.html + * http://celldesigner.org/help/CDH_Species_01.html + * http://research.cs.berkeley.edu/project/sbp/darcsrepo-no-longer-updated/src/edu/berkeley/sbp/misc/ReflectiveWalker.java + and can be extended freely as per ISO/IEC 10646:2012 / Unicode 6.1 names: + * http://www.unicode.org/versions/Unicode6.1.0/ + For readability of >2 words, it is suggested to use _CamelCase_ style. + So, yes, '_GreekSmallLetterEtaWithPsiliAndOxia_' *could* indeed be a fully + valid package name; package "electron" in the original spelling anyone? ;-) + + """ + + charmap = { + ' ': "_space_", + '!': "_exclamation_", + '"': "_quotation_", + '#': "_hash_", + '$': "_dollar_", + '%': "_percent_", + '&': "_ampersand_", + '(': "_leftparen_", + ')': "_rightparen_", + '*': "_asterisk_", + '+': "_plus_", + ',': "_comma_", + '-': "_minus_", + '.': "_period_", + '/': "_slash_", + ':': "_colon_", + ';': "_semicolon_", + '<': "_lessthan_", + '=': "_equals_", + '>': "_greaterthan_", + '?': "_question_", + '@': "_atsign_", + '[': "_leftbracket_", + '\'': "_apostrophe_", + '\\': "_backslash_", + ']': "_rightbracket_", + '^': "_circumflex_", + '_': "_underscore_", + '`': "_backquote_", + '{': "_leftcurly_", + '|': "_verticalbar_", + '}': "_rightcurly_", + '~': "_tilde_" + } + + # do the character remapping, return same char by default + result = ''.join(map(lambda x: charmap.get(x, x), name)) + return result + +def encode_class_name(name): + """return encoded version of class name""" + return "EB_" + encode_string(name) +