Commit 7df025d8 authored by Michael Büsch's avatar Michael Büsch

project: Remove files counts

Signed-off-by: Michael Büsch's avatarMichael Buesch <[email protected]>
parent dedfae39
......@@ -3,9 +3,7 @@ file_version=0
date=1990-01-01 00:00:00.000000
[CPU]
nr_awl_files=1
awl_file_0=EXAMPLE.awl
[SYMBOLS]
nr_sym_tab_files=1
sym_tab_file_0=EXAMPLE.csv
......@@ -81,11 +81,9 @@ class Project(object):
(version, expectedVersion))
# CPU section
nrAwl = p.getint("CPU", "nr_awl_files")
if nrAwl < 0 or nrAwl > 0xFFFF:
raise AwlSimError("Project file: Invalid number of "\
"AWL files: %d" % nrAwl)
for i in range(nrAwl):
for i in range(0xFFFF):
if not p.has_option("CPU", "awl_file_%d" % i):
break
path = p.get("CPU", "awl_file_%d" % i)
awlFiles.append(cls.__generic2path(path, projectDir))
if p.has_option("CPU", "mnemonics"):
......@@ -96,11 +94,9 @@ class Project(object):
cpuSpecs.setNrAccus(nrAccus)
# SYMBOLS section
nrSymTab = p.getint("SYMBOLS", "nr_sym_tab_files")
if nrSymTab < 0 or nrSymTab > 0xFFFF:
raise AwlSimError("Project file: Invalid number of "
"symbol table files: %d" % nrSymTab)
for i in range(nrSymTab):
for i in range(0xFFFF):
if not p.has_option("SYMBOLS", "sym_tab_file_%d" % i):
break
path = p.get("SYMBOLS", "sym_tab_file_%d" % i)
symTabFiles.append(cls.__generic2path(path, projectDir))
......@@ -149,7 +145,6 @@ class Project(object):
lines.append("date=%s" % str(datetime.datetime.utcnow()))
lines.append("")
lines.append("[CPU]")
lines.append("nr_awl_files=%d" % len(self.awlFiles))
for i, awlFile in enumerate(self.awlFiles):
path = self.__path2generic(awlFile, projectDir)
lines.append("awl_file_%d=%s" % (i, path))
......@@ -157,7 +152,6 @@ class Project(object):
lines.append("nr_accus=%d" % self.cpuSpecs.nrAccus)
lines.append("")
lines.append("[SYMBOLS]")
lines.append("nr_sym_tab_files=%d" % len(self.symTabFiles))
for i, symTabFile in enumerate(self.symTabFiles):
path = self.__path2generic(symTabFile, projectDir)
lines.append("sym_tab_file_%d=%s" % (i, symTabFile))
......
......@@ -3,9 +3,7 @@ file_version=0
date=1990-01-01 00:00:00.000000
[CPU]
nr_awl_files=1
awl_file_0=binaeruntersetzer.awl
[SYMBOLS]
nr_sym_tab_files=1
sym_tab_file_0=binaeruntersetzer.asc
......@@ -3,10 +3,8 @@ file_version=0
date=1990-01-01 00:00:00.000000
[CPU]
nr_awl_files=1
awl_file_0=startup_OB100.awl
mnemonics=0
nr_accus=4
[SYMBOLS]
nr_sym_tab_files=0
......@@ -3,10 +3,8 @@ file_version=0
date=1990-01-01 00:00:00.000000
[CPU]
nr_awl_files=1
awl_file_0=startup_OB102.awl
mnemonics=0
nr_accus=4
[SYMBOLS]
nr_sym_tab_files=0
......@@ -3,9 +3,7 @@ file_version=0
date=1990-01-01 00:00:00.000000
[CPU]
nr_awl_files=1
awl_file_0=symbols.awl
[SYMBOLS]
nr_sym_tab_files=1
sym_tab_file_0=symbols.csv
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment