Changeset d62f422 in sasview for sansmodels/src/python_wrapper
- Timestamp:
- Jan 4, 2012 5:36:38 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- dbddbf5
- Parents:
- ef93acb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/python_wrapper/WrapperGenerator.py
ra1d1b90 rd62f422 69 69 self.inStruct = False 70 70 self.foundCPP = False 71 self.inParDefs = False 71 72 ## Name of struct for the c object 72 73 self.structName = None … … 213 214 if line.count("class")>0: 214 215 # We are entering a class definition 215 self.in Struct= True216 self.inParDefs = True 216 217 self.foundCPP = True 217 class_name = line.replace('}','')218 class_name = class_name.replace('class','')219 self.inStruct = class_name.strip()220 221 if self.inStruct and line.count("}")>0:222 # We are exiting a struct block223 self.inStruct = False224 218 225 219 # Old-Style C struct definition 226 220 if line.count("typedef struct")>0: 227 221 # We are entering a struct block 222 self.inParDefs = True 228 223 self.inStruct = True 229 224 230 if self.in Structand line.count("}")>0:225 if self.inParDefs and line.count("}")>0: 231 226 # We are exiting a struct block 232 self.inStruct = False 233 234 # Catch the name of the struct 235 index = line.index("}") 236 #toks = string.split(line[index+1:],";") 237 toks = line[index+1:].split(";") 238 # Catch pointer definition 239 #toks2 = string.split(toks[0],',') 240 toks2 = toks[0].split(',') 241 self.structName = toks2[0].lstrip().rstrip() 242 243 227 self.inParDefs = False 228 229 if self.inStruct: 230 self.inStruct = False 231 # Catch the name of the struct 232 index = line.index("}") 233 toks = line[index+1:].split(";") 234 # Catch pointer definition 235 toks2 = toks[0].split(',') 236 self.structName = toks2[0].lstrip().rstrip() 244 237 245 238 # Catch struct content 246 239 key = "[DEFAULT]" 247 if self.in Structand line.count(key)>0:240 if self.inParDefs and line.count(key)>0: 248 241 # Found a new parameter 249 242 try:
Note: See TracChangeset
for help on using the changeset viewer.