#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* ------------------------------------------------------------------- #G* Please see the accompanying LICENSE file for further information. #H* ------------------------------------------------------------------- #I* Additional authors of this source file include: #-* #-* #-* #Z* ------------------------------------------------------------------- from chempy.models import Indexed,Connected from chempy import Storage,Atom,Bond # ad-hoc maestro file parser import re import copy strip_re = re.compile(r'\#.*\#') token_re = re.compile(r'"([^"]*)"|([^ ]+)') array_re = re.compile(r'(.*)\[([0-9]+)\]') coerce = { 's' : str, 'i' : int, 'r' : float } class MAEParser: def __init__(self,lst=None): self.i = 0 # index in list self.t = [] # token list self.d = [] # hiearchy of data read self.lst = lst self.lst_len = len(lst) def nxt_lin(self): if self.lst: if self.i