Commit fb62433c authored by Markus Scheidgen's avatar Markus Scheidgen

Adapted to nomad-fair.

parent 7e8420af
# Copyright 2018-2018 Berk Onat
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -14,6 +14,7 @@
import logging
import os
import metainfo
PARSERNAME = "CHARMM"
PROGRAMNAME = "charmm"
......@@ -22,13 +23,13 @@ PARSERMETANAME = PARSERNAME.lower()
PARSERTAG = 'x_' + PARSERMETANAME
PARSER_INFO_DEFAULT = {
'name' : PARSERMETANAME+'-parser',
'name' : PARSERMETANAME+'-parser',
'version': PARSERVERSION
}
META_INFO_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"../../../../nomad-meta-info/meta_info/nomad_meta_info/"+PARSERMETANAME+".nomadmetainfo.json"))
os.path.dirname(os.path.abspath(metainfo.__file__)),
PARSERMETANAME+".nomadmetainfo.json"))
LOGGER = logging.getLogger("nomad."+PROGRAMNAME+"Parser")
......
......@@ -20,11 +20,14 @@ import re
import sys
import datetime
import io
from nomadcore.simple_parser import mainFunction
############################################################
# This is the parser for the main file of CHARMM.
############################################################
parser = None
TEXTCHARS = bytearray({7,8,9,10,12,13,27} | set(range(0x20, 0x100)) - {0x7f})
def is_file_binary(fName, checkBytes=None):
......@@ -4016,6 +4019,7 @@ class CharmmParserInterface():
backend = self.backend_factory("charmm.nomadmetainfo.json")
parserInfo = {'name': 'charmm-parser', 'version': '1.0'}
context = CHARMMParser()
context.coverageIgnore = re.compile(r"^(?:" + r"|".join(context.coverageIgnoreList) + r")$")
with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]):
mainFunction(
mainFileDescription=context.mainFileDescription(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment