Back to index

enigmail  1.4.3
Classes | Functions
pymake.util Namespace Reference

Classes

class  MakeError
class  _MostUsedItem
class  MostUsedCache

Functions

def normaljoin
def joiniter
def checkmsyscompat
def strpartition
def strrpartition
def any

Function Documentation

def pymake.util.any (   it)

Definition at line 87 of file util.py.

00087 
00088     def any(it):
00089         for i in it:
00090             if i:
00091                 return True
00092         return False

Here is the caller graph for this function:

For msys compatibility on windows, honor the SHELL environment variable,
and if $MSYSTEM == MINGW32, run commands through $SHELL -c instead of
letting Python use the system shell.

Definition at line 38 of file util.py.

00038 
00039 def checkmsyscompat():
00040     """For msys compatibility on windows, honor the SHELL environment variable,
00041     and if $MSYSTEM == MINGW32, run commands through $SHELL -c instead of
00042     letting Python use the system shell."""
00043     if 'SHELL' in os.environ:
00044         shell = os.environ['SHELL']
00045     elif 'MOZILLABUILD' in os.environ:
00046         shell = os.environ['MOZILLABUILD'] + '/msys/bin/sh.exe'
00047     elif 'COMSPEC' in os.environ:
00048         shell = os.environ['COMSPEC']
00049     else:
00050         raise DataError("Can't find a suitable shell!")
00051 
00052     msys = False
00053     if 'MSYSTEM' in os.environ and os.environ['MSYSTEM'] == 'MINGW32':
00054         msys = True
00055         if not shell.lower().endswith(".exe"):
00056             shell += ".exe"
00057     return (shell, msys)

def pymake.util.joiniter (   fd,
  it 
)
Given an iterator that returns strings, write the words with a space in between each.

Definition at line 24 of file util.py.

00024 
00025 def joiniter(fd, it):
00026     """
00027     Given an iterator that returns strings, write the words with a space in between each.
00028     """
00029     
00030     it = iter(it)
00031     for i in it:
00032         fd.write(i)
00033         break
00034 
00035     for i in it:
00036         fd.write(' ')
00037         fd.write(i)

def pymake.util.normaljoin (   path,
  suffix 
)
Combine the given path with the suffix, and normalize if necessary to shrink the path to avoid hitting path length limits

Definition at line 15 of file util.py.

00015 
00016 def normaljoin(path, suffix):
00017     """
00018     Combine the given path with the suffix, and normalize if necessary to shrink the path to avoid hitting path length limits
00019     """
00020     result = os.path.join(path, suffix)
00021     if len(result) > 255:
00022         result = os.path.normpath(result)
00023     return result

Python 2.4 compatible str.partition

Definition at line 59 of file util.py.

00059 
00060     def strpartition(str, token):
00061         return str.partition(token)

Here is the caller graph for this function:

Python 2.4 compatible str.rpartition

Definition at line 62 of file util.py.

00062 
00063     def strrpartition(str, token):
00064         return str.rpartition(token)
00065 
else:

Here is the call graph for this function: