hello_there_andy hello_there_andy - 1 year ago 64
Python Question

ETE2 .phonehome() Is it an Easter Egg?

ETE2 (a Python Environment for phylogenetic Tree Exploration) has a method

which can be called on tree/node class objects. This returns:

== Calling home... Got answer!

He11o alien,
How is everything in the Earth?
We miss you in Brodo Asogi.

I see you are in shape.
No updates are available.

== Do you want to leave any message?
(Press enter to finish)

If you want to test this for yourself, try:

from ete2 import Tree
t = Tree() # generate random Tree
t.phonehome() # communicate with Aliens!

Is this an easter egg?

Answer Source

The project logo is:

ETE2 logo

So you could call it an easter egg. But it also has a real purpose, as it is the projects version check method, named with a pinch of humor:

''' I use this module to check for newer versions of ETE '''


def call():
    print "  == Calling home...",
        f = url.urlopen('http://ete.cgenomics.org/et_phone_home.php?VERSION=%s&ID=%s' 
                %(__VERSION__, __ETEID__))


if not latest:
    print "I could not find data about your version [%s]" %module_name
    print "Are you ok?"
elif not current:
    print "I could not determine your version [%s]" %module_name
    print "Are you ok?"
    print "Latest stable ETE version is", latest
elif latest > current:
    print "You look a bit old."
    print "A newer version is available: rev%s" %latest
    print "Use 'easy_install -U %s' to upgrade" %module_name
    print "I see you are in shape."
    print "No updates are available." 

See the source code of the ete2._ph module; phonehome() calls ete2._ph.call().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download