You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I had a need to open (for reading) the default session file (session.xml) from a PythonScript.
Locating the file was tedious as I first had to figure out where it was.
PS currently has notepad.getNppDir() and notepad.getPluginConfigDir() functions, and it would be nice to see the addition of notepad.getNppConfigDir().
Comments based on functionality from PS 2.0 and 3.10.4.
Here's my workaround script code:
# -*- coding: utf-8 -*-from __future__ importprint_functionfromNppimport*defnotepad_getNppConfigDir():
npp_dir=notepad.getNppDir()
plugin_cfg_dir=notepad.getPluginConfigDir()
ifplugin_cfg_dir.startswith(npp_dir):
npp_config_dir=npp_dir# portable version of N++else:
# installed (%APPDATA%) version of N++npp_config_dir=os.path.join(plugin_cfg_dir, '..', '..')
npp_config_dir=os.path.abspath(npp_config_dir)
returnnpp_config_dirnpp_cfg_dir=notepad_getNppConfigDir()
print('npp_cfg_dir:', npp_cfg_dir)
The text was updated successfully, but these errors were encountered:
The original request here mentioned session.xml location retrieval as an example, and that file isn't put in the cloud location when configured for cloud.
My original request, 2 years old exactly today, perhaps isn't as important to me as it was then.
If no one else thinks it has value, perhaps it should be closed.
@chcg - requires the Notepad++ extension needed label.
Of course, PS can read the config.xml file to find out if a cloud setting has been made, but since the configuration file format is not part of the public API, PS should not need to rely on it, I guess.
Recently I had a need to open (for reading) the default session file (
session.xml
) from a PythonScript.Locating the file was tedious as I first had to figure out where it was.
PS currently has
notepad.getNppDir()
andnotepad.getPluginConfigDir()
functions, and it would be nice to see the addition ofnotepad.getNppConfigDir()
.Comments based on functionality from PS 2.0 and 3.10.4.
Here's my workaround script code:
The text was updated successfully, but these errors were encountered: