13 Commits

Author SHA1 Message Date
Sebastien Helleu
591b111891 weercd.py: major code cleanup, full PEP8 compliance, replace %-formatting with .format()
All changes:
- import the new division operator and the print function
- replace the %-formatting with .format()
- full PEP8 compliance
- major code cleanup: new function send_cmd() to send an IRC command,
  split flood() function into many functions.

The messages sent from a file (or stdin) are formatted with
".format(self=self)", so that attributes from class Client are replaced
with their values. You can use for example these attributes:

  {self.nick}     current client nick
  {self.name}     the server name ('weercd')
  {self.version}  the server version (version of weercd.py)
2013-11-02 08:47:59 +01:00
Sebastien Helleu
4af78fa4aa weercd.py: use argparse module to parse command line arguments, remove config file
The configuration file weercd.conf has been removed. Instead, default options
can be set in an environment variable called "WEERCD_OPTIONS".
A file with options can be used, then name must be given as option with a
leading "@", for example: python weercd.py @args.txt

The option "action" has been removed. Default behavior is still to flood the
client. Actions "user" and "file" have been merged into a single option
-f/--file, which accepts a file, or special value "-" to read stdin.

The script now requires python >= 2.7 (because the argparse module is not
available in python 2.6 and older versions).
2013-10-27 16:58:46 +01:00
Sebastien Helleu
996da2f662 core: rename binary and man page from "weechat-curses" to "weechat" (task #11027)
A symbolic link weechat-curses -> weechat is now created (by both cmake and
configure), so that the /upgrade will work from an old version.

However, if you upgrade from an old version, it is recommended to force the use
of the new binary name with the command: `/upgrade /path/to/weechat` (replace
the path accordingly).
2013-08-02 08:54:16 +02:00
Sebastien Helleu
f97598b4aa core: update copyright dates 2013-01-01 13:12:49 +01:00
Sebastien Helleu
d403d7b79b weercd.py: add action "file" and option "file" 2012-10-17 16:19:45 +02:00
Sebastien Helleu
7aaac8d698 weercd.py: add option "nickused" (send some messages 433 before accepting nick) 2012-08-22 19:19:49 +02:00
Sebastien Helleu
47e4a03be6 core: update copyright dates 2012-01-08 18:59:50 +01:00
Sebastien Helleu
bce12fd38c weercd.py: fix typo, add action in weercd.conf 2011-05-07 18:29:53 +02:00
Sebastien Helleu
705dff4a00 weercd.py: add option "action": "flood" = flood client, "user" = send custom messages to client 2011-05-06 16:34:18 +02:00
Sebastien Helleu
b6be2adedd weercd.py: read PART command sent by client 2011-03-05 09:21:04 +01:00
Sebastien Helleu
17ae0dc592 weercd.py: fix read of config file with python 3.x 2011-02-22 19:30:01 +01:00
Sebastien Helleu
d41e202d76 Remove unneeded spaces 2011-02-07 18:38:47 +01:00
Sebastien Helleu
6295d631b7 Add weercd.py, the WeeChat flood irc server 2011-01-23 09:53:20 +01:00