Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Private Attributes
pymake.parserdata.SetVariable Class Reference
Inheritance diagram for pymake.parserdata.SetVariable:
Inheritance graph
[legend]
Collaboration diagram for pymake.parserdata.SetVariable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def execute
def dump

Public Attributes

 vnameexp
 token
 value
 valueloc
 targetexp
 source

Static Private Attributes

tuple __slots__ = ('vnameexp', 'token', 'value', 'valueloc', 'targetexp', 'source')

Detailed Description

Definition at line 219 of file parserdata.py.


Constructor & Destructor Documentation

def pymake.parserdata.SetVariable.__init__ (   self,
  vnameexp,
  token,
  value,
  valueloc,
  targetexp,
  source = None 
)

Definition at line 222 of file parserdata.py.

00222 
00223     def __init__(self, vnameexp, token, value, valueloc, targetexp, source=None):
00224         assert isinstance(vnameexp, (data.Expansion, data.StringExpansion))
00225         assert isinstance(value, str)
00226         assert targetexp is None or isinstance(targetexp, (data.Expansion, data.StringExpansion))
00227 
00228         if source is None:
00229             source = data.Variables.SOURCE_MAKEFILE
00230 
00231         self.vnameexp = vnameexp
00232         self.token = token
00233         self.value = value
00234         self.valueloc = valueloc
00235         self.targetexp = targetexp
00236         self.source = source


Member Function Documentation

def pymake.parserdata.SetVariable.dump (   self,
  fd,
  indent 
)

Definition at line 278 of file parserdata.py.

00278 
00279     def dump(self, fd, indent):
00280         print >>fd, "%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value)

Here is the caller graph for this function:

def pymake.parserdata.SetVariable.execute (   self,
  makefile,
  context 
)

Definition at line 237 of file parserdata.py.

00237 
00238     def execute(self, makefile, context):
00239         vname = self.vnameexp.resolvestr(makefile, makefile.variables)
00240         if len(vname) == 0:
00241             raise data.DataError("Empty variable name", self.vnameexp.loc)
00242 
00243         if self.targetexp is None:
00244             setvariables = [makefile.variables]
00245         else:
00246             setvariables = []
00247 
00248             targets = [data.Pattern(t) for t in data.stripdotslashes(self.targetexp.resolvesplit(makefile, makefile.variables))]
00249             for t in targets:
00250                 if t.ispattern():
00251                     setvariables.append(makefile.getpatternvariables(t))
00252                 else:
00253                     setvariables.append(makefile.gettarget(t.gettarget()).variables)
00254 
00255         for v in setvariables:
00256             if self.token == '+=':
00257                 v.append(vname, self.source, self.value, makefile.variables, makefile)
00258                 continue
00259 
00260             if self.token == '?=':
00261                 flavor = data.Variables.FLAVOR_RECURSIVE
00262                 oldflavor, oldsource, oldval = v.get(vname, expand=False)
00263                 if oldval is not None:
00264                     continue
00265                 value = self.value
00266             elif self.token == '=':
00267                 flavor = data.Variables.FLAVOR_RECURSIVE
00268                 value = self.value
00269             else:
00270                 assert self.token == ':='
00271 
00272                 flavor = data.Variables.FLAVOR_SIMPLE
00273                 d = parser.Data.fromstring(self.value, self.valueloc)
00274                 e, t, o = parser.parsemakesyntax(d, 0, (), parser.iterdata)
00275                 value = e.resolvestr(makefile, makefile.variables)
00276 
00277             v.set(vname, flavor, self.source, value)


Member Data Documentation

Definition at line 220 of file parserdata.py.

Definition at line 235 of file parserdata.py.

Definition at line 234 of file parserdata.py.

Definition at line 231 of file parserdata.py.

Definition at line 232 of file parserdata.py.

Definition at line 233 of file parserdata.py.

Definition at line 230 of file parserdata.py.


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