Commit Graph

156 Commits

Author SHA1 Message Date
c15b352c4b Prep for Pre-release 2 2026-02-24 19:30:54 -07:00
1c39d7b9ad Added hexchat.py to the Windows packaging copy step so the compatibility module is shipped alongside xchat.py/zoitechat.py in ZoiteChatRel\python, which resolves import hexchat failures for HexChat-style addons on Windows builds.
Added hexchat.py to the Visual Studio Python plugin project item list so it is tracked consistently in the Windows project metadata.

Added hexchat.py to the corresponding .vcxproj.filters entries under Source Files for IDE consistency.
2026-02-24 15:56:29 -07:00
3a680cf6b4 Updated the Python scripting shim to expose EAT_HEXCHAT as an alias of EAT_ZOITECHAT, so scripts written for HexChat constants work without changes.
Added a Python hexchat.py compatibility module and ensured it is installed alongside zoitechat.py/xchat.py, enabling import hexchat scripts to run.

Updated the Perl API layer to support HexChat naming by aliasing HexChat:: to ZoiteChat::, adding EAT_HEXCHAT to exported constants, and adding an explicit Perl shim module HexChat.pm.

Extended Perl XS constant registration to export EAT_HEXCHAT as a compatibility alias, and wired HexChat.pm into the embedded Perl module generation list so it ships with the plugin.
2026-02-23 19:09:09 -07:00
d379bb138c Added Flatpak-specific Python module search paths in plugin init: when FLATPAK_ID is present, the loader now also probes /app/lib/zoitechat/python and /app/lib/x86_64-linux-gnu/zoitechat/python before importing zoitechat.
Kept the existing safe behavior intact: paths are only added if they exist and are not already in sys.path, so this broadens compatibility without duplicating entries.
2026-02-22 11:42:49 -07:00
76796f5f23 Fixed Python plugin module discovery to search multiple valid install layouts before importing zoitechat, instead of assuming only one path. This includes:
existing sibling fallback (../python)

    direct fallback (libdir/python)

    AppImage-aware fallbacks under $APPDIR/usr/lib/zoitechat/python and $APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/python.

Added guards so paths are appended only if the directory exists and is not already in sys.path, reducing duplicate/invalid entries while improving robustness across packaging layouts.
2026-02-22 11:03:57 -07:00
deepend-tildeclub
e424d9325c Update Python plugin version to 2.18.0-pre1 2026-02-17 09:39:01 -07:00
deepend-tildeclub
c815a4629c Update python3.vcxproj with new configurations 2026-02-15 23:05:59 -07:00
deepend-tildeclub
41f140c971 Fix XML encoding issues in python3.vcxproj
Updated the Python plugin Visual Studio project to also undefine _DEBUG and Py_DEBUG (in both Release|Win32 and Release|x64), alongside the existing Py_REF_DEBUG and Py_TRACE_REFS, to avoid pulling in debug-only Python refcount symbols during linking.
2026-02-15 22:58:35 -07:00
deepend-tildeclub
89b0bc667b Update python3.vcxproj with UndefinePreprocessorDefinitions
Updated the Windows Python plugin project file to explicitly undefine Py_REF_DEBUG and Py_TRACE_REFS in both Release|Win32 and Release|x64 compile settings, preventing the build from pulling in CPython debug-refcount import symbols that are missing from normal Python import libraries.
2026-02-15 22:50:37 -07:00
deepend-tildeclub
d8cbab3bfc Modify python3.vcxproj with new preprocessor definitions
Updated the Python plugin Visual Studio project to define Py_NO_LINK_LIB in both Release|Win32 and Release|x64 configurations, so CPython headers won’t auto-link a debug import library like python314_d.lib.

Kept explicit linker input ("$(Python3Lib).lib") unchanged, so linking continues to use the configured Python library from project properties.
2026-02-15 22:40:12 -07:00
deepend-tildeclub
c23d1d493f Fix XML formatting issues in python3.vcxproj 2026-02-14 21:17:28 -07:00
173d10f336 revert: back to 874ea99 2026-02-14 17:40:42 -07:00
3e2268b391 chore: normalize line endings 2026-02-14 17:02:11 -07:00
a86dc5ae85 Added build capability switches in the shared Windows props file so optional components are only enabled when their prerequisites exist:
Python3Enabled (python executable + import lib + cffi)
   PerlEnabled (perl executable + perl runtime DLL + gendef.exe)
   InstallerEnabled (Inno Setup iscc.exe).
Updated the Python plugin project to compile only when Python3Enabled is true, and otherwise emit a clear skip message instead of failing prebuild/import steps.
Updated the Perl plugin project similarly to gate build steps on PerlEnabled and print a skip message when prerequisites are missing.
Updated the installer project so it only uses C++ targets when InstallerEnabled is true, with a fallback skip message when Inno Setup is unavailable.
2026-02-13 20:14:39 -07:00
2b98ebc544 HEXCHAT -> ZOITECHAT 2026-01-25 16:13:47 -07:00
a1ed2b1bed Zoitechat naming fixes. 2026-01-07 20:33:55 -07:00
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