Пример #1
0
# --------------------------------------------------------------------------- #
# Extract code from PDF/XML files
# --------------------------------------------------------------------------- #

# Create class instances:
s = structures.Structures()
c = commands.Commands()
h = spt_routines_header_files.SptRoutinesHeaderFiles()
r = spt_routines.SptRoutines()
a = spt_routines_annex.SptRoutinesAnnex()

file_handler = FileHandling()

# Extract code:
print "Reading " + settings.TPM20_SPEC_STRUCTURES
structures_file = file_handler.get_fd(settings.TPM20_SPEC_STRUCTURES)
print ""
s.extract(structures_file)

print ""
print "Reading " + settings.TPM20_SPEC_COMMANDS
sys.stdout.flush()
commands_file = file_handler.get_fd(settings.TPM20_SPEC_COMMANDS)
print ""
c.extract(commands_file, dict_sections_commands)

print ""
print "Reading " + settings.TPM20_SPEC_SUPPORTING_ROUTINES
sys.stdout.flush()
support_file = file_handler.get_fd(settings.TPM20_SPEC_SUPPORTING_ROUTINES)
print ""
Пример #2
0
# --------------------------------------------------------------------------- #
# Extract code from PDF/XML files
# --------------------------------------------------------------------------- #

# Create class instances:
s = structures.Structures()
c = commands.Commands()
h = spt_routines_header_files.SptRoutinesHeaderFiles()
r = spt_routines.SptRoutines()
a = spt_routines_annex.SptRoutinesAnnex()

file_handler = FileHandling()

# Extract code:
print "Reading " + settings.TPM20_SPEC_STRUCTURES
structures_file = file_handler.get_fd(settings.TPM20_SPEC_STRUCTURES)
print ""
s.extract(structures_file)

print ""
print "Reading " + settings.TPM20_SPEC_COMMANDS
commands_file = file_handler.get_fd(settings.TPM20_SPEC_COMMANDS)
print ""
c.extract(commands_file, dict_sections_commands)

print ""
print "Reading " + settings.TPM20_SPEC_SUPPORTING_ROUTINES
support_file = file_handler.get_fd(settings.TPM20_SPEC_SUPPORTING_ROUTINES)
print ""
h.extract(support_file, dict_sections_spt_routines_header_files)
r.extract(support_file, dict_sections_spt_routines)