mcstasscript.instr_reader.read_uservars.UservarsReader

mcstasscript.instr_reader.read_uservars.UservarsReader

class mcstasscript.instr_reader.read_uservars.UservarsReader(Instr, write_file, product_filename, get_next_line, return_line)

Reads the uservars section of a McStas instrument file and adds the found parameters / functions / structs to the McStasScript Instr instance. The information can also be written to a python file for reproduction of a McStas instrument.

__init__(Instr, write_file, product_filename, get_next_line, return_line)

Methods

__init__(Instr, write_file, ...)

read_uservars_line(line)

Reads line of instrument uservars, returns bolean.

set_instr_name(name)

read_uservars_line(line)

Reads line of instrument uservars, returns bolean. If it encounters the end of the uservars section, it returns False, otherwise True.

The contents of the uservars section is written to the McStasScript Instr object.