This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys, re | |
| from handlers import * | |
| from util import * | |
| from rules import * | |
| class Parser: | |
| """ | |
| A Parser reads a text file, applying rules and controlling a | |
| handler. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Rule: | |
| """ | |
| Base class for all rules. | |
| """ | |
| def action(self, block, handler): | |
| handler.start(self.type) | |
| handler.feed(block) | |
| handler.end(self.type) | |
| return True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os, sys, shutil, re | |
| source_file = open(sys.argv[1]) | |
| source_name = sys.argv[1].rstrip(".egsinp") | |
| dst_file1_name = source_name + "_colli50mm.egsinp" | |
| dst_file2_name = source_name + "_colli40mm.egsinp" | |
| dst_file3_name = source_name + "_colli30mm.egsinp" | |
| dst_file4_name = source_name + "_colli25mm.egsinp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import matplotlib | |
| import numpy as np | |
| import matplotlib.cm as cm | |
| import matplotlib.mlab as mlab | |
| import matplotlib.pyplot as plt | |
| import sys,getopt | |
| #class dosedata: |
NewerOlder