Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Private Member Functions
pymake.data.RemakeRuleContext Class Reference

List of all members.

Public Member Functions

def __init__
def resolvedeps
def runcommands

Public Attributes

 target
 makefile
 rule
 deps
 targetstack
 avoidremakeloop
 running
 error
 depsremaining
 remake
 resolvecb
 didanything
 resolvelist
 runcb
 commands

Private Member Functions

def _weakdepfinishedserial
def _depfinishedserial
def _resolvedepsserial
def _startdepparallel
def _weakdepfinishedparallel
def _depfinishedparallel
def _resolvedepsparallel
def _commandcb

Detailed Description

Definition at line 586 of file data.py.


Constructor & Destructor Documentation

def pymake.data.RemakeRuleContext.__init__ (   self,
  target,
  makefile,
  rule,
  deps,
  targetstack,
  avoidremakeloop 
)

Definition at line 588 of file data.py.

00588 
00589                  targetstack, avoidremakeloop):
00590         self.target = target
00591         self.makefile = makefile
00592         self.rule = rule
00593         self.deps = deps
00594         self.targetstack = targetstack
00595         self.avoidremakeloop = avoidremakeloop
00596 
00597         self.running = False
00598         self.error = False
00599         self.depsremaining = len(deps) + 1
00600         self.remake = False


Member Function Documentation

def pymake.data.RemakeRuleContext._commandcb (   self,
  error 
) [private]

Definition at line 673 of file data.py.

00673 
00674     def _commandcb(self, error):
00675         assert error in (True, False)
00676 
00677         if error:
00678             self.runcb(error=True)
00679             return
00680 
00681         if len(self.commands):
00682             self.commands.pop(0)(self._commandcb)
00683         else:
00684             self.runcb(error=False)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.RemakeRuleContext._depfinishedparallel (   self,
  error,
  didanything 
) [private]

Definition at line 649 of file data.py.

00649 
00650     def _depfinishedparallel(self, error, didanything):
00651         assert error in (True, False)
00652 
00653         if error:
00654             print "<%s>: Found error" % self.target.target
00655             self.error = True
00656         if didanything:
00657             self.didanything = True
00658 
00659         self.depsremaining -= 1
00660         if self.depsremaining == 0:
00661             self.resolvecb(error=self.error, didanything=self.didanything)

Here is the caller graph for this function:

def pymake.data.RemakeRuleContext._depfinishedserial (   self,
  error,
  didanything 
) [private]

Definition at line 614 of file data.py.

00614 
00615     def _depfinishedserial(self, error, didanything):
00616         assert error in (True, False)
00617 
00618         if didanything:
00619             self.didanything = True
00620 
00621         if error:
00622             self.error = True
00623             if not self.makefile.keepgoing:
00624                 self.resolvecb(error=True, didanything=self.didanything)
00625                 return
00626         
00627         if len(self.resolvelist):
00628             dep, weak = self.resolvelist.pop(0)
00629             self.makefile.context.defer(dep.make,
00630                                         self.makefile, self.targetstack, weak and self._weakdepfinishedserial or self._depfinishedserial)
00631         else:
00632             self.resolvecb(error=self.error, didanything=self.didanything)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 662 of file data.py.

00662 
00663     def _resolvedepsparallel(self):
00664         self.depsremaining -= 1
00665         if self.depsremaining == 0:
00666             self.resolvecb(error=self.error, didanything=self.didanything)
00667             return
00668 
00669         self.didanything = False
00670 
00671         for d in self.deps:
00672             self.makefile.context.defer(self._startdepparallel, d)

Here is the call graph for this function:

Definition at line 633 of file data.py.

00633 
00634     def _resolvedepsserial(self):
00635         self.resolvelist = list(self.deps)
00636         self._depfinishedserial(False, False)

def pymake.data.RemakeRuleContext._startdepparallel (   self,
  d 
) [private]

Definition at line 637 of file data.py.

00637 
00638     def _startdepparallel(self, d):
00639         if self.makefile.error:
00640             depfinished(True, False)
00641         else:
00642             dep, weak = d
00643             dep.make(self.makefile, self.targetstack, weak and self._weakdepfinishedparallel or self._depfinishedparallel)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.RemakeRuleContext._weakdepfinishedparallel (   self,
  error,
  didanything 
) [private]

Definition at line 644 of file data.py.

00644 
00645     def _weakdepfinishedparallel(self, error, didanything):
00646         if error:
00647             self.remake = True
00648         self._depfinishedparallel(False, didanything)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.RemakeRuleContext._weakdepfinishedserial (   self,
  error,
  didanything 
) [private]

Definition at line 609 of file data.py.

00609 
00610     def _weakdepfinishedserial(self, error, didanything):
00611         if error:
00612             self.remake = True
00613         self._depfinishedserial(False, didanything)

Here is the call graph for this function:

Here is the caller graph for this function:

def pymake.data.RemakeRuleContext.resolvedeps (   self,
  serial,
  cb 
)

Definition at line 601 of file data.py.

00601 
00602     def resolvedeps(self, serial, cb):
00603         self.resolvecb = cb
00604         self.didanything = False
00605         if serial:
00606             self._resolvedepsserial()
00607         else:
00608             self._resolvedepsparallel()

def pymake.data.RemakeRuleContext.runcommands (   self,
  indent,
  cb 
)

Definition at line 685 of file data.py.

00685 
00686     def runcommands(self, indent, cb):
00687         assert not self.running
00688         self.running = True
00689 
00690         self.runcb = cb
00691 
00692         if self.rule is None or not len(self.rule.commands):
00693             if self.target.mtime is None:
00694                 self.target.beingremade()
00695             else:
00696                 for d, weak in self.deps:
00697                     if mtimeislater(d.mtime, self.target.mtime):
00698                         self.target.beingremade()
00699                         break
00700             cb(error=False)
00701             return
00702 
00703         if self.rule.doublecolon:
00704             if len(self.deps) == 0:
00705                 if self.avoidremakeloop:
00706                     _log.info("%sNot remaking %s using rule at %s because it would introduce an infinite loop.", indent, self.target.target, self.rule.loc)
00707                     cb(error=False)
00708                     return
00709 
00710         remake = self.remake
00711         if remake:
00712             _log.info("%sRemaking %s using rule at %s: weak dependency was not found.", indent, self.target.target, self.rule.loc)
00713         else:
00714             if self.target.mtime is None:
00715                 remake = True
00716                 _log.info("%sRemaking %s using rule at %s: target doesn't exist or is a forced target", indent, self.target.target, self.rule.loc)
00717 
00718         if not remake:
00719             if self.rule.doublecolon:
00720                 if len(self.deps) == 0:
00721                     _log.info("%sRemaking %s using rule at %s because there are no prerequisites listed for a double-colon rule.", indent, self.target.target, self.rule.loc)
00722                     remake = True
00723 
00724         if not remake:
00725             for d, weak in self.deps:
00726                 if mtimeislater(d.mtime, self.target.mtime):
00727                     _log.info("%sRemaking %s using rule at %s because %s is newer.", indent, self.target.target, self.rule.loc, d.target)
00728                     remake = True
00729                     break
00730 
00731         if remake:
00732             self.target.beingremade()
00733             self.target.didanything = True
00734             try:
00735                 self.commands = [c for c in self.rule.getcommands(self.target, self.makefile)]
00736             except util.MakeError, e:
00737                 print e
00738                 sys.stdout.flush()
00739                 cb(error=True)
00740                 return
00741 
00742             self._commandcb(False)
00743         else:
00744             cb(error=False)


Member Data Documentation

Definition at line 594 of file data.py.

Definition at line 734 of file data.py.

Definition at line 592 of file data.py.

Definition at line 598 of file data.py.

Definition at line 603 of file data.py.

Definition at line 597 of file data.py.

Definition at line 590 of file data.py.

Definition at line 599 of file data.py.

Definition at line 602 of file data.py.

Definition at line 634 of file data.py.

Definition at line 591 of file data.py.

Definition at line 689 of file data.py.

Definition at line 596 of file data.py.

Definition at line 589 of file data.py.

Definition at line 593 of file data.py.


The documentation for this class was generated from the following file: