Back to index

salome-paravis  6.5.0
Public Member Functions | Public Attributes
pythonIDL.DocstringVisitor Class Reference

List of all members.

Public Member Functions

def __init__
def output
def visitAST
def visitModule
def visitInterface
def visitOperation
def visitAttribute

Public Attributes

 docs
 st
 target_id
 target_node
 ok

Detailed Description

Definition at line 2150 of file pythonIDL.py.


Constructor & Destructor Documentation

def pythonIDL.DocstringVisitor.__init__ (   self,
  st 
)

Definition at line 2151 of file pythonIDL.py.

02151 
02152     def __init__(self, st):
02153         self.docs = []
02154         self.st   = st


Member Function Documentation

Definition at line 2155 of file pythonIDL.py.

02155 
02156     def output(self):
02157         if self.docs:
02158             self.st.out("""\
02159 #
02160 # Docstrings
02161 #
02162 """)
02163         for nsn, dsn in self.docs:
02164             nsn = fixupScopedName(nsn)
02165             dsn = fixupScopedName(dsn)
02166 
02167             self.st.out("@node@.__doc__ = @doc@",
02168                         node=dotName(nsn), doc=dotName(dsn))
02169             
02170         if self.docs:
02171             self.st.out("")

Here is the call graph for this function:

def pythonIDL.DocstringVisitor.visitAST (   self,
  node 
)

Definition at line 2172 of file pythonIDL.py.

02172 
02173     def visitAST(self, node):
02174         for n in node.declarations():
02175             if not output_inline and not n.mainFile(): continue
02176             
02177             d = docConst(n)
02178             if d:
02179                 ok = 0
02180                 for o in node.declarations():
02181                     if nodeId(o) == d:
02182                         self.docs.append((o.scopedName(), n.scopedName()))
02183                         if isinstance(o, idlast.Interface):
02184                             sn = o.scopedName()[:]
02185                             sn[-1] = "_objref_" + sn[-1]
02186                             self.docs.append((sn, n.scopedName()))
02187                         ok = 1
02188                         break
02189                 if not ok:
02190                     docWarning(n)
02191             n.accept(self)

Here is the call graph for this function:

def pythonIDL.DocstringVisitor.visitAttribute (   self,
  node 
)

Definition at line 2251 of file pythonIDL.py.

02251 
02252     def visitAttribute(self, node):
02253         for n in node.declarators():
02254             if n.identifier() == self.target_id:
02255                 sn = n.scopedName() + ["im_func"]
02256                 sn[-3] = "_objref_" + sn[-3]
02257                 sn[-2] = "_get_"    + sn[-2]
02258                 self.docs.append((sn, self.target_node.scopedName()))
02259                 if not node.readonly():
02260                     sn = sn[:]
02261                     sn[-2] = "_set_" + n.identifier()
02262                     self.docs.append((sn, self.target_node.scopedName()))
02263                 self.ok = 1
02264 

def pythonIDL.DocstringVisitor.visitInterface (   self,
  node 
)

Definition at line 2213 of file pythonIDL.py.

02213 
02214     def visitInterface(self, node):
02215         for n in node.declarations():
02216             d = docConst(n)
02217             if d:
02218                 if d == node.identifier():
02219                     self.docs.append((node.scopedName(), n.scopedName()))
02220                     sn = node.scopedName()[:]
02221                     sn[-1] = "_objref_" + sn[-1]
02222                     self.docs.append((sn, n.scopedName()))
02223                 else:
02224                     ok = 0
02225                     for o in node.declarations():
02226                         if nodeId(o) == d:
02227                             self.docs.append((o.scopedName(), n.scopedName()))
02228                             ok = 1
02229                             break
02230                                 
02231                     if ok:
02232                         continue
02233 
02234                     for o in node.callables():
02235                         self.target_id   = d
02236                         self.target_node = n
02237                         self.ok          = 0
02238                         o.accept(self)
02239                         if self.ok:
02240                             break
02241                     
02242                     if not self.ok:    
02243                         docWarning(n)

Here is the call graph for this function:

def pythonIDL.DocstringVisitor.visitModule (   self,
  node 
)

Definition at line 2192 of file pythonIDL.py.

02192 
02193     def visitModule(self, node):
02194         for n in node.definitions():
02195             d = docConst(n)
02196             if d:
02197                 if d == node.identifier():
02198                     self.docs.append((node.scopedName(), n.scopedName()))
02199                 else:
02200                     ok = 0
02201                     for o in node.definitions():
02202                         if nodeId(o) == d:
02203                             self.docs.append((o.scopedName(), n.scopedName()))
02204                             if isinstance(o, idlast.Interface):
02205                                 sn = o.scopedName()[:]
02206                                 sn[-1] = "_objref_" + sn[-1]
02207                                 self.docs.append((sn, n.scopedName()))
02208                             ok = 1
02209                             break
02210                     if not ok:
02211                         docWarning(n)
02212             n.accept(self)

Here is the call graph for this function:

def pythonIDL.DocstringVisitor.visitOperation (   self,
  node 
)

Definition at line 2244 of file pythonIDL.py.

02244 
02245     def visitOperation(self, node):
02246         if node.identifier() == self.target_id:
02247             sn = node.scopedName() + ["im_func"]
02248             sn[-3] = "_objref_" + sn[-3]
02249             self.docs.append((sn, self.target_node.scopedName()))
02250             self.ok = 1


Member Data Documentation

Definition at line 2152 of file pythonIDL.py.

Definition at line 2236 of file pythonIDL.py.

Definition at line 2153 of file pythonIDL.py.

Definition at line 2234 of file pythonIDL.py.

Definition at line 2235 of file pythonIDL.py.


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