Back to index

enigmail  1.4.3
Classes | Functions | Variables
pymake.data Namespace Reference

Classes

class  DataError
class  ResolutionError
class  StringExpansion
class  Expansion
class  Variables
class  Pattern
class  RemakeTargetSerially
class  RemakeTargetParallel
class  RemakeRuleContext
class  Target
class  _CommandWrapper
class  _NativeWrapper
class  Rule
class  PatternRuleInstance
class  PatternRule
class  _RemakeContext
class  Makefile

Functions

def withoutdups
def mtimeislater
def getmtime
def stripdotslash
def stripdotslashes
def getindent
def _if_else
def dirpart
def filepart
def setautomatic
def setautomaticvariables
def splitcommand
def findmodifiers
def getcommandsforrule

Variables

tuple _log = logging.getLogger('pymake.data')
int MAKESTATE_NONE = 0
int MAKESTATE_FINISHED = 1
int MAKESTATE_WORKING = 2

Detailed Description

A representation of makefile data structures.

Function Documentation

def pymake.data._if_else (   c,
  t,
  f 
) [private]

Definition at line 60 of file data.py.

00060 
00061 def _if_else(c, t, f):
00062     if c:
00063         return t()
00064     return f()

def pymake.data.dirpart (   p)

Definition at line 1093 of file data.py.

01093 
01094 def dirpart(p):
01095     d, s, f = util.strrpartition(p, '/')
01096     if d == '':
01097         return '.'
01098 
01099     return d

Here is the caller graph for this function:

def pymake.data.filepart (   p)

Definition at line 1100 of file data.py.

01100 
01101 def filepart(p):
01102     d, s, f = util.strrpartition(p, '/')
01103     return f

Here is the caller graph for this function:

def pymake.data.findmodifiers (   command)
Find any of +-@% prefixed on the command.
@returns (command, isHidden, isRecursive, ignoreErrors, isNative)

Definition at line 1144 of file data.py.

01144 
01145 def findmodifiers(command):
01146     """
01147     Find any of +-@% prefixed on the command.
01148     @returns (command, isHidden, isRecursive, ignoreErrors, isNative)
01149     """
01150 
01151     isHidden = False
01152     isRecursive = False
01153     ignoreErrors = False
01154     isNative = False
01155 
01156     realcommand = command.lstrip(' \t\n@+-%')
01157     modset = set(command[:-len(realcommand)])
01158     return realcommand, '@' in modset, '+' in modset, '-' in modset, '%' in modset

Here is the caller graph for this function:

def pymake.data.getcommandsforrule (   rule,
  target,
  makefile,
  prerequisites,
  stem 
)

Definition at line 1204 of file data.py.

01204 
01205 def getcommandsforrule(rule, target, makefile, prerequisites, stem):
01206     v = Variables(parent=target.variables)
01207     setautomaticvariables(v, makefile, target, prerequisites)
01208     if stem is not None:
01209         setautomatic(v, '*', [stem])
01210 
01211     env = makefile.getsubenvironment(v)
01212 
01213     for c in rule.commands:
01214         cstring = c.resolvestr(makefile, v)
01215         for cline in splitcommand(cstring):
01216             cline, isHidden, isRecursive, ignoreErrors, isNative = findmodifiers(cline)
01217             if (isHidden or makefile.silent) and not makefile.justprint:
01218                 echo = None
01219             else:
01220                 echo = "%s$ %s" % (c.loc, cline)
01221             if not isNative:
01222                 yield _CommandWrapper(cline, ignoreErrors=ignoreErrors, env=env, cwd=makefile.workdir, loc=c.loc, context=makefile.context,
01223                                       echo=echo, justprint=makefile.justprint)
01224             else:
01225                 f, s, e = v.get("PYCOMMANDPATH", True)
01226                 if e:
01227                     e = e.resolvestr(makefile, v, ["PYCOMMANDPATH"])
01228                 yield _NativeWrapper(cline, ignoreErrors=ignoreErrors,
01229                                      env=env, cwd=makefile.workdir,
01230                                      loc=c.loc, context=makefile.context,
01231                                      echo=echo, justprint=makefile.justprint,
01232                                      pycommandpath=e)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.getindent (   stack)

Definition at line 57 of file data.py.

00057 
00058 def getindent(stack):
00059     return ''.ljust(len(stack) - 1)

Here is the caller graph for this function:

def pymake.data.getmtime (   path)

Definition at line 40 of file data.py.

00040 
00041 def getmtime(path):
00042     try:
00043         s = os.stat(path)
00044         return s.st_mtime
00045     except OSError:
00046         return None

def pymake.data.mtimeislater (   deptime,
  targettime 
)
Is the mtime of the dependency later than the target?

Definition at line 29 of file data.py.

00029 
00030 def mtimeislater(deptime, targettime):
00031     """
00032     Is the mtime of the dependency later than the target?
00033     """
00034 
00035     if deptime is None:
00036         return True
00037     if targettime is None:
00038         return False
00039     return deptime > targettime

Here is the caller graph for this function:

def pymake.data.setautomatic (   v,
  name,
  plist 
)

Definition at line 1104 of file data.py.

01104 
01105 def setautomatic(v, name, plist):
01106     v.set(name, Variables.FLAVOR_SIMPLE, Variables.SOURCE_AUTOMATIC, ' '.join(plist))
01107     v.set(name + 'D', Variables.FLAVOR_SIMPLE, Variables.SOURCE_AUTOMATIC, ' '.join((dirpart(p) for p in plist)))
01108     v.set(name + 'F', Variables.FLAVOR_SIMPLE, Variables.SOURCE_AUTOMATIC, ' '.join((filepart(p) for p in plist)))

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.setautomaticvariables (   v,
  makefile,
  target,
  prerequisites 
)

Definition at line 1109 of file data.py.

01109 
01110 def setautomaticvariables(v, makefile, target, prerequisites):
01111     prtargets = [makefile.gettarget(p) for p in prerequisites]
01112     prall = [pt.vpathtarget for pt in prtargets]
01113     proutofdate = [pt.vpathtarget for pt in withoutdups(prtargets)
01114                    if target.realmtime is None or mtimeislater(pt.mtime, target.realmtime)]
01115     
01116     setautomatic(v, '@', [target.vpathtarget])
01117     if len(prall):
01118         setautomatic(v, '<', [prall[0]])
01119 
01120     setautomatic(v, '?', proutofdate)
01121     setautomatic(v, '^', list(withoutdups(prall)))
01122     setautomatic(v, '+', prall)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.splitcommand (   command)
Using the esoteric rules, split command lines by unescaped newlines.

Definition at line 1123 of file data.py.

01123 
01124 def splitcommand(command):
01125     """
01126     Using the esoteric rules, split command lines by unescaped newlines.
01127     """
01128     start = 0
01129     i = 0
01130     while i < len(command):
01131         c = command[i]
01132         if c == '\\':
01133             i += 1
01134         elif c == '\n':
01135             yield command[start:i]
01136             i += 1
01137             start = i
01138             continue
01139 
01140         i += 1
01141 
01142     if i > start:
01143         yield command[start:i]

Here is the caller graph for this function:

Definition at line 47 of file data.py.

00047 
00048 def stripdotslash(s):
00049     if s.startswith('./'):
00050         st = s[2:]
00051         return st if st != '' else '.'
00052     return s

Here is the caller graph for this function:

Definition at line 53 of file data.py.

00053 
00054 def stripdotslashes(sl):
00055     for s in sl:
00056         yield stripdotslash(s)

Here is the call graph for this function:

Definition at line 22 of file data.py.

00022 
00023 def withoutdups(it):
00024     r = set()
00025     for i in it:
00026         if not i in r:
00027             r.add(i)
00028             yield i

Here is the caller graph for this function:


Variable Documentation

tuple pymake.data._log = logging.getLogger('pymake.data')

Definition at line 9 of file data.py.

Definition at line 746 of file data.py.

Definition at line 745 of file data.py.

Definition at line 747 of file data.py.