Sublime Forum

"reloading ....json" after plugin saves data

#1

Hi,

I have a plugin that stores data in json format in the ~/LibraryApplication Support/Sublime Text 3/Packages/PACKAGENAME/data.json. With version 3104, I started seeing the console message “reloading ~/Library/Application Support/Sublime Text 3/Packages/HPC/data.json” whenever the plugin saves the json file. I didn’t see that before the recent updates. Any advice? ST shouldn’t load this json considering that it’s plugin specific data.

Thanks!

0 Likes

#2

Have you called load_settings(…) on the file?

0 Likes

#3

No. Only this code

data = json.load(open(PATH, “r”))

all kind of changes and then

with open(PATH, ‘w’) as fp:
fp.write(json.dumps(data))
fp.close()

0 Likes

#4

The only way Sublime Text will print that message is if you currently have that file open in a text buffer, or if a plugin has called load_settings on it. Check you don’t have it open, and then try giving the file a different name to rule out another plugin loading it.

2 Likes

#5

Yes, you are right. The file was open in a text buffer while I was developing the plugin. Sorry for the confusion

0 Likes