|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 | #
|
3 |
| -# Copyright (C) 2010-2012 Sebastien Helleu <[email protected]> |
| 3 | +# Copyright (C) 2010-2021 Sébastien Helleu <[email protected]> |
4 | 4 | #
|
5 | 5 | # This program is free software; you can redistribute it and/or modify
|
6 | 6 | # it under the terms of the GNU General Public License as published by
|
|
22 | 22 | #
|
23 | 23 | # History:
|
24 | 24 | #
|
25 |
| -# 2012-01-03, Sebastien Helleu <[email protected]>: |
| 25 | +# 2021-05-02, Sébastien Helleu <[email protected]>: |
| 26 | +# version 0.5: add compatibility with WeeChat >= 3.2 (XDG directories) |
| 27 | +# 2012-01-03, Sébastien Helleu <[email protected]>: |
26 | 28 | # version 0.4: make script compatible with Python 3.x
|
27 |
| -# 2011-02-13, Sebastien Helleu <[email protected]>: |
| 29 | +# 2011-02-13, Sébastien Helleu <[email protected]>: |
28 | 30 | # version 0.3: use new help format for command arguments
|
29 |
| -# 2010-07-31, Sebastien Helleu <[email protected]>: |
| 31 | +# 2010-07-31, Sébastien Helleu <[email protected]>: |
30 | 32 | # version 0.2: add keyword "commands" to run many commands
|
31 |
| -# 2010-07-26, Sebastien Helleu <[email protected]>: |
| 33 | +# 2010-07-26, Sébastien Helleu <[email protected]>: |
32 | 34 | # version 0.1: initial release
|
33 |
| -# 2010-07-20, Sebastien Helleu <[email protected]>: |
| 35 | +# 2010-07-20, Sébastien Helleu <[email protected]>: |
34 | 36 | # script creation
|
35 | 37 | #
|
36 | 38 |
|
37 | 39 | SCRIPT_NAME = "cron"
|
38 |
| -SCRIPT_AUTHOR = "Sebastien Helleu <[email protected]>" |
39 |
| -SCRIPT_VERSION = "0.4" |
| 40 | +SCRIPT_AUTHOR = "Sébastien Helleu <[email protected]>" |
| 41 | +SCRIPT_VERSION = "0.5" |
40 | 42 | SCRIPT_LICENSE = "GPL3"
|
41 | 43 | SCRIPT_DESC = "Time-based scheduler, like cron and at"
|
42 | 44 |
|
@@ -242,7 +244,11 @@ def exec_command(self, userExec=False):
|
242 | 244 |
|
243 | 245 | def cron_filename():
|
244 | 246 | """ Get crontab filename. """
|
245 |
| - return weechat.config_get_plugin("filename").replace("%h", weechat.info_get("weechat_dir", "")) |
| 247 | + options = { |
| 248 | + 'directory': 'config', |
| 249 | + } |
| 250 | + return weechat.string_eval_path_home( |
| 251 | + weechat.config_get_plugin("filename"), {}, {}, options) |
246 | 252 |
|
247 | 253 | def cron_str_job_count(number):
|
248 | 254 | """ Get string with "%d jobs". """
|
|
0 commit comments