Subversion Repositories HomeAutomation

Rev

Rev 1126 | Rev 1259 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1126 Rev 1258
Line 156... Line 156...
156
	pcints = 0
156
	pcints = 0
157
		
157
		
158
	for moduleName, moduleSection in moduleSections.iteritems():
158
	for moduleName, moduleSection in moduleSections.iteritems():
159
		c = 0
159
		c = 0
160
		for line in moduleSection:
160
		for line in moduleSection:
-
 
161
			if line[0] != '#':
161
			if line.find("<ID>") != -1:
162
				if line.find("<ID>") != -1:
162
				line = line.replace("<ID>", getFreeModuleId(moduleName))
163
					line = line.replace("<ID>", getFreeModuleId(moduleName))
163
			elif line.find("<TIMER>") != -1:
164
				elif line.find("<TIMER>") != -1:
164
				line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
165
					line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
165
				timers += 1
166
					timers += 1
166
			elif line.find("<PCINT>") != -1:
167
				elif line.find("<PCINT>") != -1:
167
				line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
168
					line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
168
				pcints += 1
169
					pcints += 1
169
	
170
	
170
			moduleSection[c] = line;
171
			moduleSection[c] = line;
171
			c += 1
172
			c += 1
172
	
173
	
173
	c = 0
174
	c = 0
174
	for line in applicationSection:
175
	for line in applicationSection:
-
 
176
		if line[0] != '#':
175
		if line.find("<TIMER>") != -1:
177
			if line.find("<TIMER>") != -1:
176
			line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
178
				line = line[:line.find("=")+1] + hex(timers) + " /* <TIMER> -- DO NOT REMOVE THIS COMMENT -- */"
177
			timers += 1
179
				timers += 1
178
		elif line.find("TIMER_NUM_TIMERS=") != -1:
180
			elif line.find("TIMER_NUM_TIMERS=") != -1:
179
			line = "TIMER_NUM_TIMERS=" + hex(timers)
181
				line = "TIMER_NUM_TIMERS=" + hex(timers)
180
		elif line.find("NUMBER_OF_MODULES=") != -1:
182
			elif line.find("NUMBER_OF_MODULES=") != -1:
181
			line = "NUMBER_OF_MODULES=" + hex(len(modules))
183
				line = "NUMBER_OF_MODULES=" + hex(len(modules))
182
		elif line.find("<PCINT>") != -1:
184
			elif line.find("<PCINT>") != -1:
183
			line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
185
				line = line[:line.find("=")+1] + hex(pcints) + " /* <PCINT> -- DO NOT REMOVE THIS COMMENT -- */"
184
			pcints += 1
186
				pcints += 1
185
		elif line.find("PCINT_NUM_PCINTS=") != -1:
187
			elif line.find("PCINT_NUM_PCINTS=") != -1:
186
			line = "PCINT_NUM_PCINTS=" + hex(pcints)
188
				line = "PCINT_NUM_PCINTS=" + hex(pcints)
187
		applicationSection[c] = line;
189
		applicationSection[c] = line;
188
		c += 1
190
		c += 1
189
		
191
		
190
	config_inc = open('config.inc', 'w')
192
	config_inc = open('config.inc', 'w')
191
	
193