request: howto create Desklet/Screenlet ? (eve online)

Questions about applications and software
Forum rules
Before you post please read this

request: howto create Desklet/Screenlet ? (eve online)

Postby molakay on Wed Nov 26, 2008 6:04 am

Hi and hello.

This is a real simple question really.. I have a conky script wich call's python script to check status of my EVE-online account. (sort of EVEmon for those who are familiar) Just in plain text.

Is it any "easy" way to put that into a desklet/screenlet ? Since i have the python scripts etc ?

Python script is making a xml file.. wich conky shows on desktop i assume..

It's a total of 6 python scripts who will get info from eve-online account. charname, race, skilltraining, wallet etc..

Here is an example of the skilltraining python script

Code: Select all
#!/usr/bin/python
from xml.dom import minidom
import time
import datetime
import os

doc = minidom.parse("/home/"+os.environ["USERNAME"]+"/Conky/eve/skills.xml")
refdoc = minidom.parse("/home/"+os.environ["USERNAME"]+"/Conky/eve/skilltree.xml")

skillsInTraining = doc.getElementsByTagName("skillInTraining")[0].childNodes[0].nodeValue

def skilltimeleft(endtimestring):
   thistime = datetime.datetime.now()
   endtime = datetime.datetime.strptime(endtimestring, "%Y-%m-%d %H:%M:%S")
   timediff = endtime - thistime
   
   if endtime > thistime:
      weeksleft, daysleft = divmod(timediff.days, 7)
      minutesleft, secondsleft = divmod(timediff.seconds, 60)
      hoursleft, minutesleft = divmod(minutesleft, 60)
   else:
      return 0
   
   return "%dw %dd %dh %dm" % (weeksleft, daysleft, hoursleft, minutesleft)

def skillname(refid):
   found = False
   for refnode in refdoc.getElementsByTagName("row"):
      if refnode.hasChildNodes() == True and refnode.attributes.length == 3:
         if refnode.attributes.item(2).value == refid:
            found = True
            return refnode.attributes.item(0).value
         else:
            found = False
      else:
         found = False
   
   if found == False:
      return "unknown skill"

if int(skillsInTraining) > 0:
   if skilltimeleft(doc.getElementsByTagName("trainingEndTime")[0].childNodes[0].nodeValue) != 0:
      print skillsInTraining + " skill in training",
      print "(" + skillname(doc.getElementsByTagName("trainingTypeID")[0].childNodes[0].nodeValue),
      print "level",
      print doc.getElementsByTagName("trainingToLevel")[0].childNodes[0].nodeValue + ",",
      print skilltimeleft(doc.getElementsByTagName("trainingEndTime")[0].childNodes[0].nodeValue) + ")",
   else:
      print "0 skills in training"
else:
   print "0 skills in training",


And here is the xml file

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>

<eveapi version="2">

  <currentTime>2008-11-10 20:20:55</currentTime>

  <result>

    <currentTQTime offset="0">2008-11-10 20:20:55</currentTQTime>

    <trainingEndTime>2008-11-23 16:04:26</trainingEndTime>

    <trainingStartTime>2008-11-07 00:56:08</trainingStartTime>

    <trainingTypeID>3419</trainingTypeID>

    <trainingStartSP>135765</trainingStartSP>

    <trainingDestinationSP>768000</trainingDestinationSP>

    <trainingToLevel>5</trainingToLevel>

    <skillInTraining>1</skillInTraining>

  </result>

  <cachedUntil>2008-11-10 20:30:30</cachedUntil>

</eveapi>
Image
molakay
Level 1
Level 1
 
Posts: 10
Joined: Sun Nov 09, 2008 7:08 pm

Linux Mint is funded by ads and donations.
 

Re: request: howto create Desklet/Screenlet ? (eve online)

Postby zebra9000 on Fri Nov 28, 2008 1:25 am

install wine doors or use pkg mgr, or search google install> " EDESKLETS " maby they will help..they work on my mint..
zebra9000
 


Return to Software & Applications

Who is online

Users browsing this forum: Google [Bot], konrad and 23 guests