Commit 09b98bb7 authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

fixing table parsing

parent c887a594
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ _RE_COMMENT = re.compile(r'^c\s') # comments start with c an
_RE_TOKEN    = re.compile(r'[\w\d\.+-][\w\d\.\/+-]*') # tokens (ignore , = and whitespace)
_RE_KEYWORD  = re.compile(r'(^|\s)([A-z_]\w*)')       # keyword a token that starts with a letter


_ARRAYS_TO_IGNORE = ['qTable', 'dqxTable', 'dqyTable', 'hklTable','dhklyTable', 'dhklzTable' ]

class AttrDict(OrderedDict):
    "my better attribute dictionary"
    #def __init__(self, *args, **kwargs):
@@ -178,6 +181,9 @@ def parse_tables(lines, delchars=None, delwords=None, to_array=True):
        if len(newline) == 1:
            newline = newline[0]
        result[keyword].append(newline)
    if keyword in _ARRAYS_TO_IGNORE: # FIXME
        logging.getLogger().debug(f"dropping table {keyword}")
        return {}
    result = _cleanup(result, to_array=to_array)
    return result

+2 −2
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ PySEN revision module
"""
import sys
__version__  = "1.4"
__release__  = "b4"
__date__     = "June 17"
__release__  = "b5"
__date__     = "Aug 9, 2024"

def version(full=False):
    "get pysen version number"
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ def setup_logger(loglevel=logging.WARNING, filename=None):

class NseConnection:
    """nse control program connection
    more description:



    nsett python equivalent
    """