def test(): import clean clean.screen() p = Path() for attr in dir(p): a = getattr(p, attr) if type(a) is str: print('p.{} = {}'.format(attr, a))
def fcn(): start = time.perf_counter() caller = os.path.realpath(inspect.stack()[1][1]) os.chdir(os.path.dirname(caller)) # Remove old log file log_file = caller[:-3] + '.log' if os.path.isfile(log_file): os.remove(log_file) # First time logging configure for tests logging.basicConfig(level=logging.NOTSET) clean.screen() method() clean.cache() log_time_delta(start, log_file)
TYPE=ELEMENT: 'surf3: [(1, S1), (2, S1), ...]' 'surf4: [(elset1, S2), (elset2, S2), ...]' """ def __init__(self, name, items, stype=None): self.name = name self.items = items if stype: self.type = stype else: self.type = 'ELEMENT' # Test mesh parser on all CalculiX examples if __name__ == '__main__': clean.screen() os.chdir(os.path.dirname(__file__)) start_time = time.perf_counter() print = tests.print # Prepare logging log_file = __file__[:-3] + '.log' h = tests.myHandler(log_file) logging.getLogger().addHandler(h) logging.getLogger().setLevel(logging.INFO) limit = 3000 # how many files to process examples_dir = '../../../../examples/ccx_2.16.test' counter = 0 print(log_file, 'MESH PARSER TEST\n\n')