Plugin for Rainmeter enabling Python 3 scripting. is a fork of jblume/rainmeter-python which seems to be deleted.
Go to file
Johannes Blume a1021d3afa Update README.md 2013-03-03 01:41:45 +01:00
.gitignore Initial commit 2013-03-02 08:22:06 -08:00
LICENSE initial commit 2013-03-02 19:54:45 +01:00
PyRainmeter.cpp increase refcount to PyRainmeter type to prevent crashes on finalization 2013-03-03 00:53:02 +01:00
PythonPlugin.cpp ignore errors in Python script and clear exceptions 2013-03-02 23:09:12 +01:00
PythonPlugin.rc initial commit 2013-03-02 19:54:45 +01:00
README.md Update README.md 2013-03-03 01:41:45 +01:00
RainmeterPython.sln link statically to MSVCRT 2013-03-03 00:04:49 +01:00
RainmeterPython.vcxproj link statically to MSVCRT 2013-03-03 00:04:49 +01:00
RainmeterPython.vcxproj.filters initial commit 2013-03-02 19:54:45 +01:00

README.md

rainmeter-python

Plugin for Rainmeter enabling Python 3 scripting

Installation

Binaries: x86-32 and x86-64

Simply copy the appropriate file to the 'Plugins' folder of your Rainmeter installation.

For this plugin to function, you need to install the Python 3.3 distribution matching your Rainmeter's architecture. The corresponding 'python33.dll' needs to be in your DLL search path; all standard installers of Python 3.3 automatically put the DLL into your System32 directory, so this should normally be the case.

Example (Simple)

[Measure]
Measure=Plugin
Plugin=Plugins\Python.dll
PythonHome=c:\Python33
ScriptPath=default.py
ClassName=Measure
UpdateDivider=1
class Measure:
  def Reload(self, rm, maxValue):
    rm.RmLog(rm.LOG_NOTICE, "Reload called")

  def Update(self):
    return 1.0

  def GetString(self):
    return 'Test'

  def ExecuteBang(self, args):
    pass

  def Finalize(self):
    pass

Example (IMAP Unread Mail Count)

[Measure]
Measure=Plugin
Plugin=Plugins\Python.dll
ScriptPath=IMAP.py
PythonHome=c:\Python33
ClassName=Measure
UpdateDivider=60
Username=username
Password=password
Host=mail.com
import imaplib

class Measure:
    def Reload(self, rm, maxValue):
        self.host = rm.RmReadString('Host', 'example.com', False)
        self.username = rm.RmReadString('Username', 'user', False)
        self.password = rm.RmReadString('Password', 'pass', False)

    def Update(self):
        con = imaplib.IMAP4(self.host)
        con.starttls()
        con.login(self.username, self.password)
        con.select('INBOX', True)
        _, msgnums = con.search(None, '(UNSEEN)')
        con.close()
        con.logout()
        return float(len(msgnums[0].split()))