diff options
author | Berke Viktor <bviktor@hexchat.org> | 2012-07-21 19:16:31 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2012-07-21 19:16:31 +0200 |
commit | 2b3e1f46e36ee0726dcf9d55593cadab9d42fcb1 (patch) | |
tree | 64549cbaf816a1d17e303b284ab8ead97290d2c1 /plugins/python | |
parent | 9ea3ac9ddd66e7c85c9a066770da5e7a0ed9c598 (diff) |
Use <configdir>/scripts to (auto)load Lua/Perl/Python/Tcl scripts
Diffstat (limited to 'plugins/python')
-rw-r--r-- | plugins/python/python.c | 17 |
1 files changed, 12 insertions, 5 deletions
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/<filename> exists. */ + /* Check if ~/.config/hexchat/scripts/<filename> 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); |