Skip to content
Snippets Groups Projects
Commit bc6a61ab authored by Mikkel Strange's avatar Mikkel Strange
Browse files

recognize ulm fileformat

parent b0638bd7
Branches
Tags
No related merge requests found
...@@ -18,12 +18,12 @@ object GpawParser2 extends SimpleExternalParserGenerator( ...@@ -18,12 +18,12 @@ object GpawParser2 extends SimpleExternalParserGenerator(
}(breakOut): List[(String, jn.JString)]) }(breakOut): List[(String, jn.JString)])
)) :: Nil )) :: 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 // 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? // How do we do this in scala?
mainFileTypes = Seq("application/x-bin"), 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", cmd = Seq(lab.DefaultPythonInterpreter.pythonExe(), "${envDir}/parsers/gpaw/parser/parser-gpaw/parser2.py",
"${mainFilePath}"), "${mainFilePath}"),
resList = Seq( resList = Seq(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment