WeeChat DevCenter

Tag - python

Entries feed

Tuesday, July 2 2019

Python 3 by default

As scheduled in the Python 3 transition page, since July 1st 2019, the "python" plugin is now compiled with Python 3 by default.

The changes:

  • If Python 3 is found, the "python" plugin is compiled with Python 3.
  • If Python 3 is not found, the "python" plugin is not built at all (even if Python 2 is installed).

The CMake option "ENABLE_PYTHON3" has been renamed to "ENABLE_PYTHON2" (configure option "--enable-python2"). If this option is enabled, the "python" plugin is built with Python 2 (if found), with a fallback on Python 3.

The development packages for Debian and Ubuntu are now compiled with Python 3 (it should be available soon for Raspbian). The future stable versions (≥ 2.6) will be compiled with Python 3 as well.

Friday, March 16 2012

SameGame

A new script samegame.py is now available! More info about this game is available at http://en.wikipedia.org/wiki/SameGame.

If you are using weeget, just do: /weeget install samegame.py

Mouse is required, so you must have WeeChat >= 0.3.6.

For help: /help samegame.

Screenshot (click for full size):

SameGame

Enjoy!

Tuesday, January 3 2012

Support of Python 3

WeeChat can now compile with Python 3.x (successfully tested with Python 3.1 and 3.2).
This is still experimental and recommended Python for WeeChat remains version 2.7.

Some scripts (including weeget.py) have been updated for Python 3.x, they have tag "py3k-ok" on the scripts page: https://weechat.org/scripts/stable/tag/py3k-ok/

Python versions supported by WeeChat:

  • 2.5: many scripts require at least 2.6 - NOT recommended
  • 2.6: all scripts should work fine
  • 2.7: recommended version (all scripts are guaranteed to work with this version)
  • 3.x: experimental, should be used only for tests

Note that "python" plugin in WeeChat can support only one version, so it can be a 2.x or 3.x, not both at same time.

Updated on 2019-07-01: Python 3 is now compiled by default and therefore the recommended version, see the post: Python 3 by default.

Sunday, December 25 2011

QWeeChat - Python/Qt GUI

Christmas gift: "QWeeChat", the first remote interface for WeeChat. It is written in Python, using Qt toolkit.

This is an alpha version of this interface, only some features are implemented, but it's usable as-is.

The source code is available on download page, and requires latest development version of WeeChat.
New versions will follow, as well as interfaces for other systems like mobile devices (first should be Android).

A screenshot of QWeeChat in action (click for full size):

Urlserver

Merry Christmas and happy new year 2012 with WeeChat and QWeeChat!

Monday, October 31 2011

Shorten URLs with own HTTP server

Don't panic with long URLs and don't give your private URLs any more to shortening services!
A new script urlserver.py has been added. This script shortens URLs displayed and serve them using own HTTP server, which can be used to display a list of all URLs as well.

Many options are available to customize shortening of URLs, display in WeeChat and HTML page (see /help urlserver and /set plugins.var.python.urlserver.*).

The URLs are saved into ~/.weechat/urlserver_list.txt when script is unloaded, so that URLs are persistent when you restart WeeChat.

A screenshot of HTML page with list of URLs (click for full size):

Urlserver

Sunday, October 2 2011

Game Minesweeper

A new script minesweeper.py is now available, the famous Minesweeper game!

If you are using weeget, just do: /weeget install minesweeper.py

256 colors mode is highly recommended, and mouse support (with WeeChat >= 0.3.6). If you have 16 colors or less, you can do: /minesweeper 16col

For help: /help minesweeper.

Screenshot (click for full size):

Minesweeper

Enjoy!

Saturday, August 20 2011

Game Flood'it

A new script floodit.py is now available! You can now play to Flood'it inside WeeChat, with following features:

  • single mode
  • versus mode (play vs computer)
  • demo mode
  • 3 different board sizes.

If you are using weeget, just do: /weeget install floodit.py

For help: /help floodit.

Note: mouse is supported with latest devel version of WeeChat (0.3.6-dev).

Screenshot (click for full size):

Flood'it

Enjoy!

Monday, May 16 2011

Script cmd_help.py

A new script cmd_help.py is now available. It displays contextual help on command line like:

  • commands:
    • list of commands if you type a non-complete command name, for example: /serv
    • help about command arguments if you type command (and optionally arguments), for example with /server add you'll see arguments for adding an IRC server
  • options:
    • list of options if you type a non-complete option name with command /set, for example: /set weechat
    • help about option if you type a complete or unique option name with command /set, for example: /set weechat.look.command_chars

Note: this script requires version 0.3.5 of WeeChat.

Screenshot (click for full size):

cmd_help.py

Wednesday, August 4 2010

Script jabber.py

A new script jabber.py is now available. You can connect to jabber servers and chat with buddies.

Quick start:

  • add server: /jabber add jabberfr myname@jabber.fr mypassword
  • connect: /jabber connect jabberfr
  • chat: /jchat nick

Commands provided by script:

  • /jabber
  • /jchat
  • /jmsg

Configuration file is jabber.conf.

Currently, MUCs are not supported, and you can't manage your account, like create/update account, add/remove buddies in roster (nicklist).

Enjoy Jabber!

Monday, July 26 2010

Script cron.py

A new script cron.py is now available. It can schedule jobs or message like system commands cron and at.

Two commands are provided by this script:

  • /cron: schedule job like system command 'cron'
  • /at: schedule job for only one execution, in near future, like system command 'at'.

You can get more help with /help cron and /help at.

You can setup some options with /set:

  • /set plugins.var.python.cron.auto_reload on/off (default: on)
  • /set plugins.var.python.cron.auto_save on/off (default: on)
  • /set plugins.var.python.cron.filename "path" (default: "%h/cron.txt")
  • /set plugins.var.python.cron.quiet_exec on/off (default: off)
  • /set plugins.var.python.cron.quiet_load on/off (default: off)
  • /set plugins.var.python.cron.quiet_save on/off (default: on)

Thursday, October 15 2009

Script translate.py

A new script translate.py is now available. It can translate words with a command or in input (whole input or last word).

Base and target languages can be customized and given as argument of command, or at beginning of input if you're using a key calling command.

Example of keys you can bind to use script:

  • translate input with Alt+t, Alt+t (using default from_to): /key bind meta-tmeta-t /translate
  • translate input with Alt+t, Alt+r (reverse of from_to): /key bind meta-tmeta-r /translate !
  • translate last word in input with Alt+t, Alt+w (using default from_to): /key bind meta-tmeta-w /translate +
  • restore input as it was before last translation with Alt+t, Alt+u: /key bind meta-tmeta-u /translate <

Other examples:

  • reverse languages (english to french by default): /translate ! this is a test
  • english to italian: /translate en_it I want this string in italian

Recommended alias:

/alias tr /translate

You can get more help with /help translate.

Monday, October 5 2009

Script hlpvitem.py

A new script hlpvitem.py is now available. It displays item in a bar (like status) with highlight or private message, from an hidden buffer. So you will see content of message before switching to that buffer.

You must add item in a bar, like status, with this command:

/set weechat.bar.status.items

then press "Tab" and complete string by adding for example (without quotes): ",[hlpv]"

Screenshot: WeeChat hlpvitem

You can setup some options with /set:

  • /set plugins.var.python.hlpvitem.showallbuffers on/off (default: off)
  • /set plugins.var.python.hlpvitem.buffer_number on/off (default: on)
  • /set plugins.var.python.hlpvitem.buffershortname on/off (default: on)
  • /set plugins.var.python.hlpvitem.highlight on/off (default: on)
  • /set plugins.var.python.hlpvitem.private on/off (default: on)
  • /set plugins.var.python.hlpvitem.string_highlight "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_private "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_delimiter "string" (default: " > ")
  • /set plugins.var.python.hlpvitem.colorstringhighlight color (default: empty)
  • /set plugins.var.python.hlpvitem.colorstringprivate color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffernumber color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffername color (default: "default")
  • /set plugins.var.python.hlpvitem.color_prefix color (default: "white")
  • /set plugins.var.python.hlpvitem.color_delimiter color (default: "cyan")
  • /set plugins.var.python.hlpvitem.color_message color (default: "default")
  • /set plugins.var.python.hlpvitem.visible_seconds N (default: 7)

Tuesday, April 7 2009

Script weeget.py, a script manager!

A new script weeget.py is now available. It is a scripts manager: you can install, remove, upgrade your scripts using command /weeget.

Following actions are available :

  • update local cache (list of scripts, which automatically expires after one hour by default),
  • show detailed info about scripts,
  • install scripts,
  • remove scripts,
  • upgrade all obsolete scripts,
  • check status of local scripts.

Weeget uses its own configuration file, called wg.conf.

You can setup some options with /set:

  • /set wg.color.installed color (default: yellow)
  • /set wg.color.language color (default: lightblue)
  • /set wg.color.obsolete color (default: lightmagenta)
  • /set wg.color.running color (default: lightgreen)
  • /set wg.color.script color (default: cyan)
  • /set wg.color.unknown color (default: lightred)
  • /set wg.scripts.cache_expire time (default: 60)
  • /set wg.scripts.dir directory (default: %h/weeget)
  • /set wg.scripts.url url (default: http://www.weechat.org/files/plugins.xml.gz)

Updated on 2012-09-29: since version 0.3.9, weeget.py has been replaced by a C plugin called "script" (command /script), see Scripts manager.

Screenshot: WeeChat weeget

Sunday, March 8 2009

Script vdm.py

A new script vdm.py is now available. With that script, you can read fmylife.com and viedemerde.fr websites in WeeChat, using command /vdm.
Help is available with /help vdm when script is loaded.

You can setup some options with /set:

  • /set plugins.var.python.vdm.auto_switch on/off (default: on)
  • /set plugins.var.python.vdm.blank_line on/off (default: on)
  • /set plugins.var.python.vdm.color_number color (default: cyan)
  • /set plugins.var.python.vdm.colors color1;color2;... (default: default;green;brown)
  • /set plugins.var.python.vdm.lang fr/en (default: en)
  • /set plugins.var.python.vdm.numberasprefix on/off (default: on)
  • /set plugins.var.python.vdm.reverse on/off (default: off)
  • /set plugins.var.python.vdm.url url (default: http://api.betacie.com/view/%s?key=readonly&language=%s)

Screenshot: WeeChat vdm

Sunday, February 8 2009

Script go.py

A new script go.py is now available. With that script, you can quickly jump to other buffers, by typing some letters. You can use Tab and shift-Tab keys to select next/previous buffer in list.
Help is available with /help go when script is loaded.

Screenshot: WeeChat go