From bc6a61ab5cb4146e7daa2d69afff61b7b6663df7 Mon Sep 17 00:00:00 2001 From: "Strange, Mikkel (smikk)" <mikst@fysik.dtu.dk> Date: Tue, 4 Jul 2017 18:27:18 +0200 Subject: [PATCH] recognize ulm fileformat --- src/main/scala/eu/nomad_lab/parsers/GpawParser2.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/eu/nomad_lab/parsers/GpawParser2.scala b/src/main/scala/eu/nomad_lab/parsers/GpawParser2.scala index e0921b4..a50b718 100644 --- a/src/main/scala/eu/nomad_lab/parsers/GpawParser2.scala +++ b/src/main/scala/eu/nomad_lab/parsers/GpawParser2.scala @@ -18,12 +18,12 @@ object GpawParser2 extends SimpleExternalParserGenerator( }(breakOut): List[(String, jn.JString)]) )) :: Nil ), - // output file is binary and first 16 bytes is a string: 'AFFormatGPAW ' + // output file is binary and first 16 bytes is a string containing: 'GPAW' // In python the check is like this - // is_gpw_file = open('H2.gpw', 'r').read(16).strip()=='AFFormatGPAW' + // is_gpw_file = 'GPAW' in str(open('file.gpw', 'rb').read(16)) // How do we do this in scala? mainFileTypes = Seq("application/x-bin"), - mainFileRe = "".r, + mainFileRe = "- of UlmGPAW|AFFormatGPAW".r, cmd = Seq(lab.DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/gpaw/parser/parser-gpaw/parser2.py", "${mainFilePath}"), resList = Seq( -- GitLab