Changeset 9316609 in sasview for sansmodels/src/sans/models/c_models
- Timestamp:
- Oct 28, 2008 3:22:22 PM (16 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:
- 92320e5
- Parents:
- 89fef2c
- Location:
- sansmodels/src/sans/models/c_models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/WrapperGenerator.py
r96672c0 r9316609 109 109 # Catch Description 110 110 key = "[DESCRIPTION]" 111 find_description= False111 find_description= 0 112 112 temp="" 113 113 for line in lines: 114 114 if line.count(key)>0 : 115 find_description= True115 116 116 try: 117 find_description= 1 117 118 index = line.index(key) 118 119 toks = line[index:].split("=",1 ) 119 120 temp=toks[1].lstrip().rstrip() 120 121 text='text' 121 key2="<%s>"%text.lower 122 key2="<%s>"%text.lower() 122 123 if re.match(key2,temp)!=None: 123 index2 = line.index(key2) 124 temp=line[index:] 124 #index2 = line.index(key2) 125 #temp = temp[index2:] 126 toks2=temp.split(key2,1) 127 self.description=toks2[1] 128 text='text' 129 key2="</%s>"%text.lower() 130 if re.search(key2,toks2[1])!=None: 131 temp=toks2[1].split(key2,1) 132 self.description=temp[0] 133 break 134 #print self.description 125 135 else: 126 136 self.description=temp 137 break 127 138 except: 128 139 raise ValueError, "Could not parse file %s" % self.file 129 if find_description: 130 text='text' 131 key2="</%s>"%text.lower 132 if re.match(key2,temp)!=None: 133 index2 = line.index(key2) 134 temp=line[:index] 135 temp+=line 136 self.description= temp 140 elif find_description==1: 141 text='text' 142 key2="</%s>"%text.lower() 143 #print "second line",line,key2,re.search(key2,line) 144 if re.search(key2,line)!=None: 145 tok=line.split(key2,1) 146 temp=tok[0].split("//",1) 147 self.description+=tok[1].lstrip().rstrip() 148 break 149 else: 150 #if re.search("*",line)!=None: 151 # temp=line.split("*",1) 152 # self.description+='\n'+temp[1].lstrip().rstrip() 153 if re.search("//",line)!=None: 154 temp=line.split("//",1) 155 self.description+='\n\t\t'+temp[1].lstrip().rstrip() 156 157 else: 158 self.description+='\n\t\t'+line.lstrip().rstrip() 159 160 137 161 138 162 for line in lines: … … 235 259 newline = self.replaceToken(tmp_line, 236 260 "[PYTHONCLASS]", 'C'+self.pythonClass) 237 261 #Catch model description 262 newline = self.replaceToken(tmp_line, 263 "[DESCRIPTION]", self.description) 238 264 # Catch C model name 239 265 newline = self.replaceToken(newline, -
sansmodels/src/sans/models/c_models/modelTemplate.txt
r8809e48 r9316609 43 43 ## Name of the model 44 44 self.name = "[PYTHONCLASS]" 45 45 self.description ="""[DESCRIPTION]""" 46 46 [PAR_DETAILS] 47 47
Note: See TracChangeset
for help on using the changeset viewer.