Skip to content
Snippets Groups Projects
Commit 61d2f59d authored by jacques Grelet's avatar jacques Grelet
Browse files

__skip_header is realy private

parent 9b00e2f2
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ class FileExtractor:
self.FillValue = 1e36
# private:
self.skip_header = skip_header
self.__skip_header = skip_header
self.__header = {}
self.__data = {}
# overloading operators
......@@ -103,13 +103,10 @@ class FileExtractor:
n = 0
m = 0
#print(device, cfg[device.lower()])
print(device)
# set skip_header is declared in toml section, 0 by default
if 'skikHeader' in cfg[device.lower()]:
self.skip_header = cfg[device.lower()]['skipHeader']
#
logging.debug(self.skip_header)
# set skipHeader is declared in toml section, 0 by default
if 'skipHeader' in cfg[device.lower()]:
self.__skip_header = cfg[device.lower()]['skipHeader']
logging.debug(self.__skip_header)
# get the dictionary from toml block, device must be is in lower case
hash = cfg['split'][device.lower()]
......@@ -124,7 +121,7 @@ class FileExtractor:
with fileinput.input(
file, openhook=fileinput.hook_encoded("ISO-8859-1")) as f:
for line in f:
if f.filelineno() < self.skip_header + 1:
if f.filelineno() < self.__skip_header + 1:
continue
if line[0] == '#' or line[0] == '*':
continue
......@@ -138,6 +135,7 @@ class FileExtractor:
# debug info
str += "{:>{width}}".format(
p[hash[key]], width=8)
logging.debug(str)
logging.debug(str)
# increment m indice (the line number)
......
......@@ -88,7 +88,6 @@ if __name__ == "__main__":
# read config Toml file and get the physical parameter list (Roscop code) for the specified instrument
cfg = toml.load(args.config)
device = str(args.instrument) # convert one element list to str
print(device)
keys = cfg['split'][device.lower()].keys()
# test arguements from sys.argv, args is never to None with default option set
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment