From 2b3e1f46e36ee0726dcf9d55593cadab9d42fcb1 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sat, 21 Jul 2012 19:16:31 +0200 Subject: Use /scripts to (auto)load Lua/Perl/Python/Tcl scripts --- plugins/python/python.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'plugins/python') diff --git a/plugins/python/python.c b/plugins/python/python.c index ebbf4f38..477cbc74 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -389,20 +389,27 @@ Util_Autoload() char *sub_dir; /* we need local filesystem encoding for chdir, opendir etc */ - /* auto-load from ~/.config/hexchat/ or %APPDATA%\HexChat\ */ xdir = xchat_get_info(ph, "xchatdirfs"); + + /* don't pollute the filesystem with script files, this only causes misuse of the folders + * only use ~/.config/hexchat/scripts/ and %APPDATA%\HexChat\scripts */ +#if 0 + /* auto-load from ~/.config/hexchat/ or %APPDATA%\HexChat\ */ Util_Autoload_from(xchat_get_info(ph, "xchatdirfs")); +#endif - /* auto-load from subdirectory plugins */ + /* auto-load from subdirectory scripts */ sub_dir = malloc (strlen (xdir) + 9); strcpy (sub_dir, xdir); - strcat (sub_dir, "/plugins"); + strcat (sub_dir, "/scripts"); Util_Autoload_from(sub_dir); free (sub_dir); +#if 0 #ifdef WIN32 /* also auto-load C:\Program Files\HexChat\Plugins\*.py */ Util_Autoload_from(HEXCHATLIBDIR"/plugins"); #endif +#endif } static char * @@ -437,9 +444,9 @@ Util_Expand(char *filename) return expanded; g_free(expanded); - /* Check if ~/.config/hexchat/ exists. */ + /* Check if ~/.config/hexchat/scripts/ exists. */ expanded = g_build_filename(xchat_get_info(ph, "xchatdir"), - filename, NULL); + "scripts", filename, NULL); if (g_file_test(expanded, G_FILE_TEST_EXISTS)) return expanded; g_free(expanded); -- cgit 1.4.1