Hi Andreas,

you are looking for:
pymol.invocation.options.incentive_product

Cheers,
 Thomas

On 03 Oct 2014, at 10:05, Andreas Warnecke <4ndreas.warne...@gmail.com> wrote:
> Hi,
> 
> interesting!
> 
> I noticed that using:
> 'print cmd.get_version()' in Python/PyMOL
> vs.
> 'get_version' in PyMOL
> yields two distinct outputs:
> 
> PyMOL>print cmd.get_version()
> ('1.7.0.5', 1.705, 1705, 1399913511, 
> '3070a0a1f405c02c919f62ea8bd67c5a55b0adfd', 0)
> PyMOL>get_version
> version: 1.7.0.5 (1.705) 1705, Incentive Product
> 
> So I assume there is a cryptic way of translating the latter entries into 
> Open-source vs. Incentive?
> 
> I also need to revise the script before (as it still buggy and fails in the 
> open() line ), but the idea is to intercept the output and simply not print 
> it.
> 
> Thanks for pointing this out,
> 
> Andreas
> 
> 
> 
> On Fri, Oct 3, 2014 at 3:18 PM, Gianluca Santoni <gianluca.sant...@ibs.fr> 
> wrote:
> I get this output from cmd.get_version
> 
> Open pymol:
> 
> version: 1.7.0.0 (1.700) 1700, Open-Source
> 
> Incentive pymol:
> version: 1.7 (1.700) 1700, Incentive Product
> 
> 
> You could ude this, or not?
> 
> On 10/3/14 3:06 PM, Andreas Warnecke wrote:
> Hi all,
> 
> just to specify the issue: the problem is not the crash, because the
> script continues due to the try statement. The issue is that PyMOL
> handles and prints the exception from the 'alter' command into the
> console. I would like to avoid that, either by testing incentive vs.
> open-source, or by preventing PyMOL from printing the exception.
> 
> The cmd.get_version() command can be used to test the version of PyMOL,
> but does to my knowledge not give information on the
> incentive/open-source build (?).
> 
> It would be useful to have a way of testing this, though. Ideas anyone?
> 
> Currently, I solved the issue with the printing like this now, but I
> feel it is inferior to actually testing the incentive/open-source state:
> 
> try:
>     originalstdout = sys.stdout # hijack the output
>     sys.stdout = sys.stdout = open('/dev/null', 'w') # dump
>     cmd.alter('...') # longer command omitted here - error usually
> printed here
>     sys.stdout = originalstdout # reinstate the output
> except: pass
> 
> Thanks for the suggestions,
> 
> Andreas
> 
> On Fri, Oct 3, 2014 at 2:59 PM, Gianluca Santoni
> <gianluca.sant...@ibs.fr> wrote:
> 
>    Version number is printed in the startup message, so it has to be stored
>    somewere related to this function.
> 
>    On 10/3/14 2:23 PM, Tsjerk Wassenaar wrote:
>> Hi Andreas,
>> 
>> Ah, I think the problem is PyMOL handling the error. It probably prints
>> the exception and then continuous anyway. So it actually doesn't allow
>> you to catch it off. So you would indeed need to get access to the
>> version. I don't know where that is stored from the top of my head.
>> Maybe Thomas knows.
>> 
>> Cheers,
>> 
>> Tsjerk
>> 
>> On Fri, Oct 3, 2014 at 2:09 PM, Andreas Warnecke
>> <4ndreas.warne...@gmail.com> wrote:
>> 
>>    Hi,
>> 
>>    Thanks for the reply. I'm just having the issue that even if I place
>>    the code in a try statement the error output shows in the PyMOL
>>    console, but the script proceeds anyhow.
>>    Is there anyway of intercepting/silencing this output?
>> 
>>    Thanks,
>> 
>>    Andreas
>> 
>>    On Fri, Oct 3, 2014 at 1:46 PM, Tsjerk Wassenaar <tsje...@gmail.com> 
>> wrote:
>> 
>>        Hi Andreas,
>> 
>>        A try/except block is actually a very pythonic way of dealing
>>        with such issues. You can catch the error with an except clause,
>>        that allows executing some code in case the other thing didn't
>>        work out. Make sure to only catch the error that is raised by
>>        what you're trying, otherwise you may interfere with the normal
>>        functioning of things (like catching a termination signal).
>> 
>>        Hope it helps,
>> 
>>        Tsjerk
>> 
>>        On Fri, Oct 3, 2014 at 1:35 PM, Andreas Warnecke
>>        <4ndreas.warne...@gmail.com>
>>        wrote:
>> 
>>            Dear PyMOL users,
>> 
>>            I am wondering if there is any way of testing whether a
>>            PyMOL version is open-source or incentive for use in
>>            scripts. I'm thinking of something similar to
>>            'cmd.get_version()'.
>> 
>>            The reason for this is that I am e.g. using the 'alter'
>>            command on custom properties in scripts, which is a feature
>>            that may not be available in all PyMOL versions. At the
>>            moment I avoid a crash by placing the code within a 'try'
>>            statement, but this will yield an error message. If I could
>>            actually test the incentive/open-source state this would
>>            allow me to use an 'if' statement instead and avoid the
>>            error message.
>> 
>>            I would welcome suggestions on how to approach this.
>> 
>>            Thanks,
>> 
>>            Andreas

-- 
Thomas Holder
PyMOL Developer
Schrödinger, Inc.


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to