Nektar++
|
Classes | |
class | CellMLValidator |
class | LxmlRelaxngValidator |
class | RvpRelaxngValidator |
class | ValidatorError |
Functions | |
def | quit (self) |
def del(self): """ Tell our RVP process to quit. More... | |
def | validate (self, stream) |
def | get_validation_errors (self) |
def | _error_found (self, line, col, msg) |
def | _start_tag_open (self, cur, name) |
def | _attribute (self, cur, name, val) |
def | _start_tag_close (self, cur, name) |
def | _end_tag (self, cur, name) |
def | _textonly (self, cur, text) |
def | _mixed (self, cur, text) |
def | _start (self, grammar='0') |
def | _send (self, s) |
def | _recv (self) |
def | _resp (self) |
def | _flush_text (self) |
def | _start_element (self, name, attrs) |
def | _end_element (self, name) |
def | _characters (self, data) |
def | check_repo (repo_dir='../../models/all_from_repository', model_suffix='xml', invalid_if_warnings=False, compare=True) |
Convenience functions #. More... | |
def | compare_output_files (new_stream, old_filename) |
def | get_options (args) |
For running as an executable #. More... | |
def | run () |
Variables | |
pycml_path = os.path.dirname(os.path.realpath(__file__)) | |
list | __version__ = "$Revision: 25790 $"[11:-2] |
string | profile_name = '/tmp/pycml-profile-%f-%d' % (time.time(), os.getpid()) |
_text | |
_error_messages | |
_prevcol | |
_pat | |
_parser | |
_errors | |
_ismixed | |
Copyright (c) 2005-2016, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of Oxford nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
private |
Definition at line 339 of file validator.py.
|
private |
Definition at line 432 of file validator.py.
|
private |
Definition at line 428 of file validator.py.
|
private |
Definition at line 345 of file validator.py.
|
private |
Definition at line 330 of file validator.py.
|
private |
Apparently Expat doesn't concatenate text nodes, so we do it manually; the CharDataHandler collects the text, and this method passes it to the validator.
Definition at line 408 of file validator.py.
|
private |
In mixed content, whitespace is discarded, and any non-whitespace is counted as equal.
Definition at line 351 of file validator.py.
|
private |
Receive a zero-terminated response from RVP; drop zero byte.
Definition at line 371 of file validator.py.
|
private |
Get a reply from RVP. If an error occurs, log the message. Return the current pattern value.
Definition at line 382 of file validator.py.
|
private |
Terminate string with zero, encode in UTF-8 and send to RVP.
Definition at line 366 of file validator.py.
|
private |
Definition at line 361 of file validator.py.
|
private |
Definition at line 420 of file validator.py.
|
private |
Definition at line 342 of file validator.py.
|
private |
Definition at line 336 of file validator.py.
|
private |
Definition at line 348 of file validator.py.
def CellMLToNektar.validator.check_repo | ( | repo_dir = '../../models/all_from_repository' , |
|
model_suffix = 'xml' , |
|||
invalid_if_warnings = False , |
|||
compare = True |
|||
) |
Convenience functions #.
Validate every model in the CellML repository, and return a list of invalid models. If compare is False, writes errors & warnings to log files in the same folder as the models, otherwise compares the output to log files already present, and notes differences. Displays total run time.
Definition at line 444 of file validator.py.
References CellMLToNektar.validator.compare_output_files().
def CellMLToNektar.validator.compare_output_files | ( | new_stream, | |
old_filename | |||
) |
Definition at line 507 of file validator.py.
Referenced by CellMLToNektar.validator.check_repo().
def CellMLToNektar.validator.get_options | ( | args | ) |
For running as an executable #.
get_options(args): Process our command-line options. args is a list of options & positional arguments.
Definition at line 554 of file validator.py.
Referenced by CellMLToNektar.validator.run().
def CellMLToNektar.validator.get_validation_errors | ( | self | ) |
Return the list of all errors found while validating the current file.
Definition at line 323 of file validator.py.
def CellMLToNektar.validator.quit | ( | self | ) |
def del(self): """ Tell our RVP process to quit.
This doesn't work well, since del isn't necessarily called at program exit. Hence, there is a manual quit() method. """ self.quit()
Call this method when the validator is finished with. It terminates the associated RVP process cleanly. Failure to do so will probably result in an error when your program exits.
Definition at line 288 of file validator.py.
def CellMLToNektar.validator.run | ( | ) |
Definition at line 610 of file validator.py.
References CellMLToNektar.utilities.close_output_stream(), CellMLToNektar.validator.get_options(), and CellMLToNektar.utilities.open_output_stream().
def CellMLToNektar.validator.validate | ( | self, | |
stream | |||
) |
Validate an XML document, returning a boolean. stream should be a file-like object containing the document to be validated. Returns True iff the document was valid.
Definition at line 296 of file validator.py.
Referenced by CellMLToNektar.translators.CellMLTranslator.translate().
|
private |
Definition at line 56 of file validator.py.
|
private |
Definition at line 305 of file validator.py.
|
private |
Definition at line 318 of file validator.py.
|
private |
Definition at line 421 of file validator.py.
|
private |
Definition at line 313 of file validator.py.
|
private |
Definition at line 307 of file validator.py.
|
private |
Definition at line 306 of file validator.py.
|
private |
Definition at line 304 of file validator.py.
string CellMLToNektar.validator.profile_name = '/tmp/pycml-profile-%f-%d' % (time.time(), os.getpid()) |
Definition at line 669 of file validator.py.
CellMLToNektar.validator.pycml_path = os.path.dirname(os.path.realpath(__file__)) |
Definition at line 49 of file validator.py.