Commit Graph

140 Commits

Author SHA1 Message Date
4683ef705b new name after fork 2026-01-05 23:12:38 -07:00
Patrick Griffis
a1f154cd5e win32: Remove Python 2 support 2023-11-03 14:23:55 -05:00
Celelibi
5cbd2524dc python: fix for timers that unhook themselves
The python plugin use weak references for hooks, which might let a
necessary object disappear if the callback of a timer hook unhooks
itself.

Signed-off-by: Celelibi <celelibi@gmail.com>
2023-04-24 17:10:41 -05:00
Celelibi
847e5a14d6 python: add flush() to Stdout
Python sometime calls flush() on sys.stdout or sys.stderr.
In particular, it might do so when an exception is raised. This fixes
the second error message that was generated in such cases.

Signed-off-by: Celelibi <celelibi@gmail.com>
2023-04-03 12:29:22 -05:00
DjLegolas
6da8f97e37 fix addons load in python2 2022-05-07 11:34:47 -05:00
Patrick
dd167b4c83 python: Fix API break in hook_timer()
Closes #2691
2022-04-15 13:43:22 -05:00
Biswapriyo Nath
9c7109b578 meson: Fix exported functions for python plugin
This fixes loading python plugin in Windows by exporting functions using
python.def file. Otherwise, hexchat_plugin_init symbol error is shown.
2022-01-11 17:26:31 -06:00
Patrick Griffis
6fd8a8f9bf python: Open all scripts with utf-8 encoding 2021-10-02 09:49:17 -05:00
Alexandre Jousset
734d888210 python: Fix off by one range
The range goes from 31 to 1 inclusive (#2391).
2021-05-28 19:39:44 -05:00
DjLegolas
939ec7a16e Updated Toolset to v142 2021-05-23 19:43:24 -05:00
Sbgodin
090fd29acf python: Fix exception with list_pluginpref()
__decode cannot work (with Python3) because prefs_str has no attribute 'decode'.

Related to https://github.com/hexchat/hexchat/issues/2531
2021-03-07 15:20:58 -05:00
Patrick Griffis
3871fbaacb build: Fix potential undefined variable 2020-03-11 11:13:25 -07:00
Patrick Griffis
5deb695919 build: Better support building against python 3.8+
Closes #2441
2020-03-11 11:08:28 -07:00
jacob1
586f089df6 Python: Fix error in hexchat.emit_print when passing time attribute 2019-06-24 07:37:20 -07:00
A_D
7abeb10cf1 python: plugin cleanup and refactor 2019-01-02 18:50:10 -05:00
linuxdaemon
a5a727122b python: Make sure help() doesn't cause hexchat to hang (#2290)
* Make sure `help()` doesn't cause hexchat to hang

Replace `pydoc.help` with a copy of `pydoc.Helper` with an empty
`StringIO` instead of stdin

* Handle BytesIO vs StringIO on 2.7
2018-12-27 14:46:02 -05:00
linuxdaemon
f7713a6a64 python: Make the plugins table dynamically sized (#2291)
Adjust the width of the columns depending on the length of the data in
each element
2018-12-26 17:15:25 -05:00
A_D
3ebfa83fdd python: Made sure to set sys.argv if it is not set. fixes #2282 2018-12-26 16:58:46 -05:00
Patrick Griffis
ed55330153 python: Fix console not eating commands 2018-12-05 19:45:30 -05:00
A_D
a2ff661d40 python: Various cffi fixes
- fixed /py exec behaviour
- fixed hexchat.unload_hook() failing when passed a hook id
- fixed get_list() calls in python3
2018-11-09 18:36:59 -05:00
Patrick Griffis
706f9bca82 python: Rewrite with CFFI 2018-11-09 18:36:59 -05:00
Patrick Griffis
541b9ca744 win32: Update to build against gvsbuild 2018-03-09 20:26:41 +00:00
Patrick Griffis
628100c19f build: Replace Autotools with Meson
Quick rundown of benefits:

- Much faster:
  - Autotools (with autogen): 22 seconds
  - Meson: 7 seconds
  - Meson (with ccache): 2 seconds

- Simpler:
  - ~1000 lines smaller
  - Single simple language

- Potentially better Windows (Visual Studio) support

What is not done:

- Complete Windows support
- OSX support (easy)

Closes #2013
Closes #1937
Closes #1803
2017-06-13 23:54:51 -04:00
Mark Jansen
eccd0d05b5 python: Use HEXCHAT_EAT_XXX where appropriate. 2017-03-30 16:58:49 -04:00
Rainer Müller
c79ce843f4 build: Reorder includes to avoid installed plugin header
When hexchat is already installed into a non-default prefix, a new build
could pick up ${prefix}/include/hexchat-plugin.h from the installed
version instead of the local header, as configuration variables such as
$(GLIB_CFLAGS) would point to -I${prefix}/include.

Reordering the includes and moving -I arguments to CPPFLAGS prevents
this, as it ensures the local directories are always searched first.

This was no problem when compiling for /usr or /usr/local as these
directories in the compiler search path are always searched last.

Closes #1822
2016-09-26 19:16:42 -04:00
Patrick Griffis
9d74ceedfd python: Fix get_pluginpref()
This relied on undocumented behavior of hexchat_pluginpref_get_int()
that has been fixed recently. -1 is the correct failure value.
2016-08-05 21:08:52 -04:00
Patrick Griffis
0826e7d353 python: Handle get_info('win_ptr') 2016-02-18 12:59:02 -05:00
Patrick Griffis
aab881fda2 Fix strict prototype warnings 2016-02-18 08:57:22 -05:00
Arnavion
f7e3d3f32c Use VS 2015 2015-10-10 16:14:12 -07:00
Patrick Griffis
fad8f93ad8 configure: Clean up Python checking
This fixes requiring to add a version every time
a new release comes out...
2015-09-30 03:55:42 -04:00
Arnavion
9858784eb6 Better project files.
- Output directly to rel\ instead of to bin\ and then copying files over.
- Deduped Win32 vs x64 configs
- Moved some common properties to hexchat.props
- All build intermediates (except htm's intermediates) are no longer emitted in the source directory
2015-02-11 10:01:29 -08:00
TingPing
086d4e3962 python: Use Py_RETURN_NONE macro 2014-12-31 15:11:47 -05:00
TingPing
448cc962cd Python: Fix overflow and code-cleanup 2014-12-31 09:50:03 -05:00
TingPing
95febd978c Fix building as c89 2014-12-28 06:47:23 -05:00
TingPing
3f855f07f5 Use glib for allocations in all plugins
Continuation of 83032b1aa
2014-12-28 06:47:07 -05:00
TingPing
aeb5d15871 More consistently include config.h 2014-12-17 18:21:10 -05:00
TingPing
0e4164ad0c configure: Improve various build flags
- Store openssl flags in own vars
- Share some common flags for plugins
- Fix building plugins on win32
- Store all glib flags in one var
- Don't link against every lib for each plugin
- Don't hardcode ldflags for sysinfo
2014-12-15 11:07:46 -05:00
Arnavion
65da34f19e Removed some unnecessary null-checks for calls to g_free and g_strfreev 2014-12-08 21:24:59 -08:00
Campbell Barton
f83d78dd28 Warning cleanup
- ignoring const
- declarations after statements
- some C files didnt include own headers (risking them getting out of sync)

Closes #1064
2014-11-02 14:41:20 -05:00
TingPing
3cd8556c54 Use GDir instead of dirent 2014-06-04 13:56:33 -04:00
TingPing
b8c02f71d9 win32: Use config.h instead of config-win32.h 2014-06-04 10:30:18 -04:00
Adam Dane [:hobophobe]
7e55e4ee73 python: Scan for non-NULLs in print events
Closes #916
Closes #915
2014-04-19 22:30:31 -04:00
TingPing
b7e8f64bba Fix crash in hexchat_pluginpref_list()
Set max output size to 4096
2013-09-30 01:23:20 -04:00
TingPing
d18a95fda6 Make Python version consistent on both platforms
and don't hardcode 2.7/3.3
2013-09-25 20:53:23 -04:00
Eustachy Kapusta
b658fca4a7 Convert project files to vs2013 2013-09-15 15:07:46 -07:00
TingPing
e8456beadc Add reload command for plugins and add to gui 2013-08-04 04:36:10 -04:00
Arnavion
4a95b07ae7 python: Set VERSION using existing VERSION_MAJOR and VERSION_MINOR macros and some mintor refactoring. 2013-07-30 22:54:57 -07:00
TingPing
2cbe758c80 Fix some warnings 2013-07-26 22:53:01 -04:00
TingPing
72c6834cc5 Python: Fix callbacks for the "special" print hooks 2013-07-26 19:51:56 -04:00
Eustachy Kapusta
715a520c0e Move optimization settings from all subsequent projects to hexchat.props 2013-07-24 20:56:36 +02:00