<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Molecules can not be subclassed (it is
a Python wrapper around a C++ class), but they can be extended
with custom methods and attributes by adding those methods and
attributes to the Python Molecule class. You can see some
examples of that in chimera/__init__.py, Molecule.sequence is from
another module, and Molecule.metalComplexGroup is defined within
the file. Unfortunately, it is not possible to extend Molecule's
__init__ function.<br>
<br>
HTH,<br>
<br>
Greg<br>
<br>
On 06/12/2014 09:33 AM, Jaime Rodríguez-Guerra wrote:<br>
</div>
<blockquote
cite="mid:CAM2AJuKS01AAwk-k7ysJ=3HDEVkATKJkNCfhVWkY9Gwt8Cz4cQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I am trying to extend the chimera.Molecule class() to add a
few methods and attributes, but the followin error arises:</div>
<div><br>
</div>
<div>
<div>TypeError: Error when calling the metaclass bases</div>
<div> type '_molecule.Molecule' is not an acceptable base
type</div>
<div><br>
</div>
<div> File "/home/jr/x/gaudi/gaudi/molecule.py", line 51, in
<module></div>
<div> class Compound(chimera.Molecule):</div>
</div>
<div><br>
</div>
<div>Is there any workaround? I want my Compound objects to
behave like standard chimera Molecules (with all their
attributes and stuff), and also be able to call custom methods
on that Molecule.</div>
<div><br>
</div>
<div>Thanks in advance,</div>
<div>Jaime.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>