code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def preorder(self, tree, visitor, *args): """Do preorder walk of tree using visitor""" self.visitor = visitor visitor.visit = self.dispatch self.dispatch(tree, *args) # XXX *args make sense?
Do preorder walk of tree using visitor
preorder
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/compiler/visitor.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/compiler/visitor.py
MIT
def _get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ # This function was copied from Lib/distutils/msvccompiler.py ...
Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6.
_get_build_version
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/util.py
MIT
def find_msvcrt(): """Return the name of the VC runtime dll""" version = _get_build_version() if version is None: # better be safe than sorry return None if version <= 6: clibname = 'msvcrt' else: clibname = 'msvcr%d' % (version * 1...
Return the name of the VC runtime dll
find_msvcrt
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/util.py
MIT
def _other_endian(typ): """Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types arrays and structures are supported. """ # check _OTHER_ENDIAN attribute (present i...
Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types arrays and structures are supported.
_other_endian
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/_endian.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/_endian.py
MIT
def create_string_buffer(init, size=None): """create_string_buffer(aString) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aString, anInteger) -> character array """ if isinstance(init, (str, unicode)): if size is None: size = len(init)...
create_string_buffer(aString) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aString, anInteger) -> character array
create_string_buffer
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/__init__.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/__init__.py
MIT
def CFUNCTYPE(restype, *argtypes, **kw): """CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a ca...
CFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a callable object: prototype(integer address) -...
CFUNCTYPE
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/__init__.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/__init__.py
MIT
def create_unicode_buffer(init, size=None): """create_unicode_buffer(aString) -> character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array """ if isinstance(init, (str, unicode)): if size is None: ...
create_unicode_buffer(aString) -> character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array
create_unicode_buffer
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/__init__.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/__init__.py
MIT
def ensure_utf8(s): """Not all of PyObjC and Python understand unicode paths very well yet""" if isinstance(s, unicode): return s.encode('utf8') return s
Not all of PyObjC and Python understand unicode paths very well yet
ensure_utf8
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/dyld.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/dyld.py
MIT
def dyld_image_suffix_search(iterator, env=None): """For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics""" suffix = dyld_image_suffix(env) if suffix is None: return iterator def _inject(iterator=iterator, suffix=suffix): for path in iterator: if path.endswith('.dy...
For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics
dyld_image_suffix_search
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/dyld.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/dyld.py
MIT
def dyld_find(name, executable_path=None, env=None): """ Find a library or framework using dyld semantics """ name = ensure_utf8(name) executable_path = ensure_utf8(executable_path) for path in dyld_image_suffix_search(chain( dyld_override_search(name, env), dyld_...
Find a library or framework using dyld semantics
dyld_find
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/dyld.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/dyld.py
MIT
def framework_find(fn, executable_path=None, env=None): """ Find a framework using dyld semantics in a very loose manner. Will take input such as: Python Python.framework Python.framework/Versions/Current """ try: return dyld_find(fn, executable_path=executable_path,...
Find a framework using dyld semantics in a very loose manner. Will take input such as: Python Python.framework Python.framework/Versions/Current
framework_find
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/dyld.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/dyld.py
MIT
def dylib_info(filename): """ A dylib name can take one of the following four forms: Location/Name.SomeVersion_Suffix.dylib Location/Name.SomeVersion.dylib Location/Name_Suffix.dylib Location/Name.dylib returns None if not found or a mapping equivalent to: dict( ...
A dylib name can take one of the following four forms: Location/Name.SomeVersion_Suffix.dylib Location/Name.SomeVersion.dylib Location/Name_Suffix.dylib Location/Name.dylib returns None if not found or a mapping equivalent to: dict( location='Location', ...
dylib_info
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/dylib.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/dylib.py
MIT
def framework_info(filename): """ A framework name can take one of the following four forms: Location/Name.framework/Versions/SomeVersion/Name_Suffix Location/Name.framework/Versions/SomeVersion/Name Location/Name.framework/Name_Suffix Location/Name.framework/Name returns No...
A framework name can take one of the following four forms: Location/Name.framework/Versions/SomeVersion/Name_Suffix Location/Name.framework/Versions/SomeVersion/Name Location/Name.framework/Name_Suffix Location/Name.framework/Name returns None if not found, or a mapping equival...
framework_info
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/ctypes/macholib/framework.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/ctypes/macholib/framework.py
MIT
def rectangle(win, uly, ulx, lry, lrx): """Draw a rectangle with corners at the provided upper-left and lower-right coordinates. """ win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1) win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1) win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1...
Draw a rectangle with corners at the provided upper-left and lower-right coordinates.
rectangle
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/curses/textpad.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/curses/textpad.py
MIT
def _end_of_line(self, y): """Go to the location of the first blank on the given line, returning the index of the last non-blank character.""" last = self.maxx while True: if curses.ascii.ascii(self.win.inch(y, last)) != curses.ascii.SP: last = min(self.maxx, ...
Go to the location of the first blank on the given line, returning the index of the last non-blank character.
_end_of_line
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/curses/textpad.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/curses/textpad.py
MIT
def gather(self): "Collect and return the contents of the window." result = "" for y in range(self.maxy+1): self.win.move(y, 0) stop = self._end_of_line(y) if stop == 0 and self.stripspaces: continue for x in range(self.maxx+1): ...
Collect and return the contents of the window.
gather
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/curses/textpad.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/curses/textpad.py
MIT
def edit(self, validate=None): "Edit in the widget window and collect the results." while 1: ch = self.win.getch() if validate: ch = validate(ch) if not ch: continue if not self.do_command(ch): break ...
Edit in the widget window and collect the results.
edit
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/curses/textpad.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/curses/textpad.py
MIT
def wrapper(func, *args, **kwds): """Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper()....
Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper().
wrapper
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/curses/wrapper.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/curses/wrapper.py
MIT
def _get_uid(name): """Returns an uid, given a user name.""" if getpwnam is None or name is None: return None try: result = getpwnam(name) except KeyError: result = None if result is not None: return result[2] return None
Returns an uid, given a user name.
_get_uid
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/archive_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/archive_util.py
MIT
def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0, owner=None, group=None): """Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "compress", "bzip2", or None. (compress will be deprecated in P...
Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "compress", "bzip2", or None. (compress will be deprecated in Python 3.2) 'owner' and 'group' can be used to define an owner and a group for the archive that is being built. If not...
make_tarball
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/archive_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/archive_util.py
MIT
def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default sear...
Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecErr...
make_zipfile
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/archive_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/archive_util.py
MIT
def check_archive_formats(formats): """Returns the first format from the 'format' list that is unknown. If all formats are known, returns None """ for format in formats: if format not in ARCHIVE_FORMATS: return format return None
Returns the first format from the 'format' list that is unknown. If all formats are known, returns None
check_archive_formats
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/archive_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/archive_util.py
MIT
def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None): """Create an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "ta...
Create an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "tar", "ztar", or "gztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir int...
make_archive
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/archive_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/archive_util.py
MIT
def _check_macro_definitions(self, definitions): """Ensures that every element of 'definitions' is a valid macro definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do nothing if all definitions are OK, raise TypeError otherwise. """ for defn in definitions: ...
Ensures that every element of 'definitions' is a valid macro definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do nothing if all definitions are OK, raise TypeError otherwise.
_check_macro_definitions
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def define_macro(self, name, value=None): """Define a preprocessor macro for all compilations driven by this compiler object. The optional parameter 'value' should be a string; if it is not supplied, then the macro will be defined without an explicit value and the exact outcome depends ...
Define a preprocessor macro for all compilations driven by this compiler object. The optional parameter 'value' should be a string; if it is not supplied, then the macro will be defined without an explicit value and the exact outcome depends on the compiler used (XXX true? does ANSI say...
define_macro
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def undefine_macro(self, name): """Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefini...
Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefinitions). If the macro is redefined/undefine...
undefine_macro
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra): """Process arguments and decide which source files to compile.""" if outdir is None: outdir = self.output_dir elif not isinstance(outdir, str): raise TypeError, "'output_dir...
Process arguments and decide which source files to compile.
_setup_compile
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def _fix_compile_args(self, output_dir, macros, include_dirs): """Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it...
Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it with 'self.macros'; ensures that 'include_dirs' is a list, and au...
_fix_compile_args
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def _fix_object_args(self, objects, output_dir): """Typecheck and fix up some arguments supplied to various methods. Specifically: ensure that 'objects' is a list; if output_dir is None, replace with self.output_dir. Return fixed versions of 'objects' and 'output_dir'. """ ...
Typecheck and fix up some arguments supplied to various methods. Specifically: ensure that 'objects' is a list; if output_dir is None, replace with self.output_dir. Return fixed versions of 'objects' and 'output_dir'.
_fix_object_args
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs): """Typecheck and fix up some of the arguments supplied to the 'link_*' methods. Specifically: ensure that all arguments are lists, and augment them with their permanent versions (eg. 'self.libraries' augments 'libra...
Typecheck and fix up some of the arguments supplied to the 'link_*' methods. Specifically: ensure that all arguments are lists, and augment them with their permanent versions (eg. 'self.libraries' augments 'libraries'). Return a tuple with fixed versions of all arguments.
_fix_lib_args
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def _need_link(self, objects, output_file): """Return true if we need to relink the files listed in 'objects' to recreate 'output_file'. """ if self.force: return 1 else: if self.dry_run: newer = newer_group (objects, output_file, missing='...
Return true if we need to relink the files listed in 'objects' to recreate 'output_file'.
_need_link
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def detect_language(self, sources): """Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job. """ if not isinstance(sources, list): sources = [sources] lang = None index = len(self.language_order) fo...
Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job.
detect_language
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def preprocess(self, source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None): """Preprocess a single C/C++ source file, named in 'source'. Output will be written to file named 'output_file', or stdout if 'output_file' not supplied. '...
Preprocess a single C/C++ source file, named in 'source'. Output will be written to file named 'output_file', or stdout if 'output_file' not supplied. 'macros' is a list of macro definitions as for 'compile()', which will augment the macros set with 'define_macro()' and 'undefine_macro(...
preprocess
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): """Compile one or more source files. 'sources' must be a list of filenames, most likely C/C++ files, but in reality anythi...
Compile one or more source files. 'sources' must be a list of filenames, most likely C/C++ files, but in reality anything that can be handled by a particular compiler and compiler class (eg. MSVCCompiler can handle resource files in 'sources'). Return a list of object filenames...
compile
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): """Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files s...
Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libra...
create_static_lib
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): """Link a bunch of stuff together...
Link a bunch of stuff together to create an executable or shared library file. The "bunch of stuff" consists of the list of object files supplied as 'objects'. 'output_filename' should be a filename. If 'output_dir' is supplied, 'output_filename' is relative to it (i.e. 'outpu...
link
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def has_function(self, funcname, includes=None, include_dirs=None, libraries=None, library_dirs=None): """Return a boolean indicating whether funcname is supported on the current platform. The optional arguments can be used to augment the compilation environment. ""...
Return a boolean indicating whether funcname is supported on the current platform. The optional arguments can be used to augment the compilation environment.
has_function
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def get_default_compiler(osname=None, platform=None): """ Determine the default compiler to use for the given platform. osname should be one of the standard Python OS names (i.e. the ones returned by os.name) and platform the common value returned by sys.platform for the platform in questio...
Determine the default compiler to use for the given platform. osname should be one of the standard Python OS names (i.e. the ones returned by os.name) and platform the common value returned by sys.platform for the platform in question. The default values are os.name and sys.platform i...
get_default_compiler
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def show_compilers(): """Print list of available compilers (used by the "--help-compiler" options to "build", "build_ext", "build_clib"). """ # XXX this "knows" that the compiler option it's describing is # "--compiler", which just happens to be the case for the three # commands that use it. ...
Print list of available compilers (used by the "--help-compiler" options to "build", "build_ext", "build_clib").
show_compilers
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0): """Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently o...
Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional...
new_compiler
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def gen_preprocess_options(macros, include_dirs): """Generate C pre-processor options (-D, -U, -I) as used by at least two types of compilers: the typical Unix compiler and Visual C++. 'macros' is the usual thing, a list of 1- or 2-tuples, where (name,) means undefine (-U) macro 'name', and (name,value)...
Generate C pre-processor options (-D, -U, -I) as used by at least two types of compilers: the typical Unix compiler and Visual C++. 'macros' is the usual thing, a list of 1- or 2-tuples, where (name,) means undefine (-U) macro 'name', and (name,value) means define (-D) macro 'name' to 'value'. 'include...
gen_preprocess_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries): """Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a li...
Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a list of command-line options suitable for use with some compiler (depending on the ...
gen_lib_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/ccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/ccompiler.py
MIT
def __init__(self, dist): """Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. """ # late import because of mutual dependence betwee...
Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated.
__init__
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def initialize_options(self): """Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies betwe...
Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_option...
initialize_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def finalize_options(self): """Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: ...
Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then...
finalize_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def run(self): """A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All...
A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and files...
run
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def debug_print(self, msg): """Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. """ from distutils.debug import DEBUG if DEBUG: print msg sys.stdout.flush()
Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true.
debug_print
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def ensure_string_list(self, option): """Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. """ val = getattr(self, o...
Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"].
ensure_string_list
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def ensure_filename(self, option): """Ensure that 'option' is the name of an existing file.""" self._ensure_tested_string(option, os.path.isfile, "filename", "'%s' does not exist or is not a file")
Ensure that 'option' is the name of an existing file.
ensure_filename
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def set_undefined_options(self, src_cmd, *option_pairs): """Set the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'in...
Set the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'initialize_options()' and 'finalize_options()'. Usually calle...
set_undefined_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def get_finalized_command(self, command, create=1): """Wrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object. """ ...
Wrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object.
get_finalized_command
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def get_sub_commands(self): """Determine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be ...
Determine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be run for the current distribution...
get_sub_commands
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1, link=None, level=1): """Copy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't...
Copy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't define it.)
copy_file
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def copy_tree(self, infile, outfile, preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1): """Copy an entire directory tree respecting verbose, dry-run, and force flags. """ return dir_util.copy_tree( infile, outfile, ...
Copy an entire directory tree respecting verbose, dry-run, and force flags.
copy_tree
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def spawn (self, cmd, search_path=1, level=1): """Spawn an external command respecting dry-run flag.""" from distutils.spawn import spawn spawn(cmd, search_path, dry_run= self.dry_run)
Spawn an external command respecting dry-run flag.
spawn
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def make_file(self, infiles, outfile, func, args, exec_msg=None, skip_msg=None, level=1): """Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a differe...
Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the...
make_file
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cmd.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cmd.py
MIT
def setup(**attrs): """The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options ...
The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to 'setup()' (as ...
setup
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/core.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/core.py
MIT
def run_setup(script_name, script_args=None, stop_after="run"): """Run a setup script in a somewhat controlled environment, and return the Distribution instance that drives things. This is useful if you need to find out the distribution meta-data (passed as keyword args from 'script' to 'setup()', or t...
Run a setup script in a somewhat controlled environment, and return the Distribution instance that drives things. This is useful if you need to find out the distribution meta-data (passed as keyword args from 'script' to 'setup()', or the contents of the config files or command-line. 'script_name'...
run_setup
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/core.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/core.py
MIT
def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. """ msc_pos = sys.version.find('MSC v.') if msc_pos != -1: msc_ver = sys.version[msc_pos+6:msc_pos+10] if msc_ver == '1300': # MSVC 7.0 return ['msvcr7...
Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.
get_msvcr
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cygwinccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cygwinccompiler.py
MIT
def check_config_h(): """Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOT...
Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good ...
check_config_h
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cygwinccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cygwinccompiler.py
MIT
def get_versions(): """ Try to find out the versions of gcc, ld and dllwrap. If not possible it returns None for it. """ from distutils.version import LooseVersion from distutils.spawn import find_executable import re gcc_exe = find_executable('gcc') if gcc_exe: out = os.pop...
Try to find out the versions of gcc, ld and dllwrap. If not possible it returns None for it.
get_versions
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cygwinccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cygwinccompiler.py
MIT
def is_cygwingcc(): '''Try to determine if the gcc that would be used is from cygwin.''' out = os.popen('gcc -dumpmachine', 'r') out_string = out.read() out.close() # out_string is the target triplet cpu-vendor-os # Cygwin's gcc sets the os to 'cygwin' return out_string.strip().endswith('cyg...
Try to determine if the gcc that would be used is from cygwin.
is_cygwingcc
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/cygwinccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/cygwinccompiler.py
MIT
def newer(source, target): """Tells if the target is newer than the source. Return true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Return false if both exist and 'target' is the same age or younger than 'source'. Raise DistutilsFileE...
Tells if the target is newer than the source. Return true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Return false if both exist and 'target' is the same age or younger than 'source'. Raise DistutilsFileError if 'source' does not exist. ...
newer
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dep_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dep_util.py
MIT
def newer_pairwise(sources, targets): """Walk two filename lists in parallel, testing if each source is newer than its corresponding target. Return a pair of lists (sources, targets) where source is newer than target, according to the semantics of 'newer()'. """ if len(sources) != len(targets):...
Walk two filename lists in parallel, testing if each source is newer than its corresponding target. Return a pair of lists (sources, targets) where source is newer than target, according to the semantics of 'newer()'.
newer_pairwise
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dep_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dep_util.py
MIT
def newer_group(sources, target, missing='error'): """Return true if 'target' is out-of-date with respect to any file listed in 'sources'. In other words, if 'target' exists and is newer than every file in 'sources', return false; otherwise return true. 'missing' controls what we do when a source f...
Return true if 'target' is out-of-date with respect to any file listed in 'sources'. In other words, if 'target' exists and is newer than every file in 'sources', return false; otherwise return true. 'missing' controls what we do when a source file is missing; the default ("error") is to blow up wi...
newer_group
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dep_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dep_util.py
MIT
def mkpath(name, mode=0777, verbose=1, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create som...
Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, b...
mkpath
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dir_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dir_util.py
MIT
def create_tree(base_dir, files, mode=0777, verbose=1, dry_run=0): """Create all the empty directories under 'base_dir' needed to put 'files' there. 'base_dir' is just the name of a directory which doesn't necessarily exist yet; 'files' is a list of filenames to be interpreted relative to 'base_dir...
Create all the empty directories under 'base_dir' needed to put 'files' there. 'base_dir' is just the name of a directory which doesn't necessarily exist yet; 'files' is a list of filenames to be interpreted relative to 'base_dir'. 'base_dir' + the directory portion of every file in 'files' will b...
create_tree
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dir_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dir_util.py
MIT
def copy_tree(src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does...
Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is created with 'mkpath()'. The end result of the copy is that every file in 'src' is copied to 'dst', and dir...
copy_tree
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dir_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dir_util.py
MIT
def remove_tree(directory, verbose=1, dry_run=0): """Recursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true). """ global _path_created if verbose >= 1: log.info("removing '%s' (and everything under it)", directory) ...
Recursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true).
remove_tree
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dir_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dir_util.py
MIT
def ensure_relative(path): """Take the full path 'path', and make it a relative path. This is useful to make 'path' the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) if path[0:1] == os.sep: path = drive + path[1:] return path
Take the full path 'path', and make it a relative path. This is useful to make 'path' the second argument to os.path.join().
ensure_relative
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dir_util.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dir_util.py
MIT
def __init__ (self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in ...
Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null va...
__init__
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def get_option_dict(self, command): """Get the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary. """ dict = self.command_opti...
Get the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary.
get_option_dict
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def find_config_files(self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are three ...
Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are three possible config files: distutils.cfg in ...
find_config_files
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def parse_command_line(self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution ...
Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately ...
parse_command_line
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def _get_toplevel_options(self): """Return the non-display options recognized at the top level. This includes options that are recognized *only* at the top level as well as options recognized for commands. """ return self.global_options + [ ("command-packages=", None...
Return the non-display options recognized at the top level. This includes options that are recognized *only* at the top level as well as options recognized for commands.
_get_toplevel_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def _parse_command_opts(self, parser, args): """Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options we are about to parse). Returns a new version of 'args' wi...
Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options we are about to parse). Returns a new version of 'args' with the next command at the front of the list; wi...
_parse_command_opts
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def finalize_options(self): """Set final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. """ for attr in ('keywords', 'platforms'): value = getattr(self.metadata, attr) if value is No...
Set final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects.
finalize_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def _show_help(self, parser, global_options=1, display_options=1, commands=[]): """Show help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the same ...
Show help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the same state, as its option table will be reset to make it generate the correct help text. If 'globa...
_show_help
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ from distutils.core import gen_...
If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false.
handle_display_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def print_command_list(self, commands, header, max_length): """Print a subset of the list of all commands -- used by 'print_commands()'. """ print(header + ":") for cmd in commands: klass = self.cmdclass.get(cmd) if not klass: klass = self...
Print a subset of the list of all commands -- used by 'print_commands()'.
print_command_list
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def print_commands(self): """Print out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The ...
Print out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command c...
print_commands
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def get_command_list(self): """Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command cl...
Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command class attribute 'description'.
get_command_list
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def get_command_packages(self): """Return a list of packages from which commands are loaded.""" pkgs = self.command_packages if not isinstance(pkgs, list): if pkgs is None: pkgs = '' pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != ''] ...
Return a list of packages from which commands are loaded.
get_command_packages
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def get_command_class(self, command): """Return the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command mo...
Return the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command module ("distutils.command." + command) and...
get_command_class
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def get_command_obj(self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return Non...
Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None.
get_command_obj
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def _set_command_options(self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_...
Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for thi...
_set_command_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def reinitialize_command(self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or su...
Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command...
reinitialize_command
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def run_command(self, command): """Do whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return silently without doing anything. If the command named by 'co...
Do whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return silently without doing anything. If the command named by 'command' doesn't even have a command ...
run_command
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def read_pkg_file(self, file): """Reads the metadata values from a file object.""" msg = message_from_file(file) def _read_field(name): value = msg[name] if value == 'UNKNOWN': return None return value def _read_list(name): ...
Reads the metadata values from a file object.
read_pkg_file
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def write_pkg_info(self, base_dir): """Write the PKG-INFO file into the release tree. """ pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w') try: self.write_pkg_file(pkg_info) finally: pkg_info.close()
Write the PKG-INFO file into the release tree.
write_pkg_info
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ version = '1.0' if (self.provides or self.requires or self.obsoletes or self.classifiers or self.download_url): version = '1.1' self._write_field(file, 'Metadata-Versi...
Write the PKG-INFO format data to a file object.
write_pkg_file
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def fix_help_options(options): """Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. """ new_options = [] for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options
Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt.
fix_help_options
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/dist.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/dist.py
MIT
def check_config_h(): """Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOT...
Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good ...
check_config_h
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/emxccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/emxccompiler.py
MIT
def get_versions(): """ Try to find out the versions of gcc and ld. If not possible it returns None for it. """ from distutils.version import StrictVersion from distutils.spawn import find_executable import re gcc_exe = find_executable('gcc') if gcc_exe: out = os.popen(gcc_e...
Try to find out the versions of gcc and ld. If not possible it returns None for it.
get_versions
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/emxccompiler.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/emxccompiler.py
MIT
def set_aliases (self, alias): """Set the aliases for this option parser.""" self._check_alias_dict(alias, "alias") self.alias = alias
Set the aliases for this option parser.
set_aliases
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT
def set_negative_aliases (self, negative_alias): """Set the negative aliases for this option parser. 'negative_alias' should be a dictionary mapping option names to option names, both the key and value must already be defined in the option table.""" self._check_alias_dict(negativ...
Set the negative aliases for this option parser. 'negative_alias' should be a dictionary mapping option names to option names, both the key and value must already be defined in the option table.
set_negative_aliases
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT
def _grok_option_table (self): """Populate the various data structures that keep tabs on the option table. Called by 'getopt()' before it can do anything worthwhile. """ self.long_opts = [] self.short_opts = [] self.short2long.clear() self.repeat = {} ...
Populate the various data structures that keep tabs on the option table. Called by 'getopt()' before it can do anything worthwhile.
_grok_option_table
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT
def getopt (self, args=None, object=None): """Parse command-line options in args. Store as attributes on object. If 'args' is None or not supplied, uses 'sys.argv[1:]'. If 'object' is None or not supplied, creates a new OptionDummy object, stores option values there, and returns a tupl...
Parse command-line options in args. Store as attributes on object. If 'args' is None or not supplied, uses 'sys.argv[1:]'. If 'object' is None or not supplied, creates a new OptionDummy object, stores option values there, and returns a tuple (args, object). If 'object' is supplied, it...
getopt
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT
def get_option_order (self): """Returns the list of (option, value) tuples processed by the previous run of 'getopt()'. Raises RuntimeError if 'getopt()' hasn't been called yet. """ if self.option_order is None: raise RuntimeError, "'getopt()' hasn't been called yet"...
Returns the list of (option, value) tuples processed by the previous run of 'getopt()'. Raises RuntimeError if 'getopt()' hasn't been called yet.
get_option_order
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT
def generate_help (self, header=None): """Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object. """ # Blithely assume the option table is good: probably wouldn't call # 'generate_help()' unless you've already c...
Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.
generate_help
python
mchristopher/PokemonGo-DesktopMap
app/pywin/Lib/distutils/fancy_getopt.py
https://github.com/mchristopher/PokemonGo-DesktopMap/blob/master/app/pywin/Lib/distutils/fancy_getopt.py
MIT