Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move config file to AppData/Local #46

Open
dougransom opened this issue Jan 1, 2023 · 3 comments
Open

Move config file to AppData/Local #46

dougransom opened this issue Jan 1, 2023 · 3 comments
Assignees

Comments

@dougransom
Copy link
Member

I recently learned this is where settings should go, not in it is kind of like the /etc in unix.

I think we should move the default location for natlink config files to AppData/Local/Natlink.

@dougransom dougransom self-assigned this Jan 1, 2023
@quintijn
Copy link
Collaborator

quintijn commented Jan 3, 2023

This would be a "breaking change" (as Aaron puts it).

This directory could then be overridden by setting NATLINK_USERDIR, but... when we change this, we can also change "NATLINK_USERDIR" into "NATLINK_SETTINGDIR".

Primarily the file "natlink.ini" is then located here.

We find this directory by taking default HOME (~) and go to AppData/Local/Natlink (also forget about that .natlink (dot) convention?).

In this directory, which MUST be local, and clearly is, also some data can/will be stored. For example the vocolagrammars (compiled by the vocola modules), and UnimacroData (where unimacro grammars can store data on its way, for example the grammar _oops, which "remembers" all utterances).

The now existing UnimacroGrammars sub directory is now obsolete, as we take the grammars from the site-packages area directly by now.

Thinking about this, yes, maybe we should move into this.

@drmfinlay
Copy link
Member

This seems sensible to me. Was there anything you wanted me to do, Quintijn? Dragonfly doesn't have much to do with Natlink's loading process. The library does have a similar config file in the wrong place on Windows, but it has been scheduled for removal in the next major version.

By the way, there is a built-in environment variable you might use to get the current user's AppData/Local folder: LOCALAPPDATA. It may be accessed in Python like this:

import os
print(os.environ["LOCALAPPDATA"])

@quintijn
Copy link
Collaborator

quintijn commented Jan 4, 2023

Dane, I think there is nothing you need to do here.

Let us make this change then!!

For users that have a preliminary version of the python3 installer already, we can copy the stuff from HOME/.natlink into LOCALAPPDATA/Natlink, when running the natlinkconfig_gui or natlinkconfig_cli.

The way to change the location of this directory will then be with NATLINK_SETTINGSDIR instead of NATLINK_USERDIR, OK?

@drmfinlay drmfinlay removed their assignment Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants