Git Product home page Git Product logo

Comments (7)

raffaem avatar raffaem commented on May 28, 2024 1

pybliometrics-dev/pybliometrics@b15ad45

from nbstata.

hugetim avatar hugetim commented on May 28, 2024

I'm not familiar with Arch Linux or how it relates to other platforms. Is this XDG Base Directory spec universal?

I guess I'm also not clear on what you're requesting. A pull request would be the most direct way to show me. Otherwise, can you explain what we'd be doing different if we're "still reading from the old path"? How is that consistent with the request to "move nbstata.conf"?

from nbstata.

raffaem avatar raffaem commented on May 28, 2024

I'm not familiar with Arch Linux or how it relates to other platforms. Is this XDG Base Directory spec universal?

Yes

https://en.wikipedia.org/wiki/Freedesktop.org#Base_Directory_Specification

I guess I'm also not clear on what you're requesting.

move ~/.nbstata.conf to ~/.config/nbstata/nbstata.conf

Otherwise, can you explain what we'd be doing different if we're "still reading from the old path"?

We would read from the new folder in addition to the old one, for backwards compatibility

How is that consistent with the request to "move nbstata.conf"?

If ~/.config/nbstata/nbstata.conf doesn't exist, you try the old ~/.nbstata.conf.

The point is that people rely on this standard to administer their system, for example they backup ~/.config instead of the entire home folder.

from nbstata.

huegerich avatar huegerich commented on May 28, 2024

Thank you, that clears it up for me.

I would have thought to move it to ~/.config/nbstata.conf. Just to double check, you'd prefer putting it within a nbstata directory, right?

Also, when checking the XDG spec path, we should actually use the environment variable $XDG_CONFIG_HOME/nbstata/nbstata.conf rather than $HOME/.config/nbstata/nbstata.conf, right?

The current code is here and here.

from nbstata.

raffaem avatar raffaem commented on May 28, 2024

I would have thought to move it to ~/.config/nbstata.conf. Just to double check, you'd prefer putting it within a nbstata directory, right?

We may want other files in the future.

For example, a ~/.config/nbstata/nbstata.d directory which contains user-defined STATA scripts to be run at startup. For instance to initialize the environment, or define variables or functions that the user frequently uses.

Or in the future we may want to support multiple STATA versions, so have a config file for each version.

Or the user may want to backup an old config file, keeping it in the same directory.

Also, when checking the XDG spec path, we should actually use the environment variable $XDG_CONFIG_HOME/nbstata/nbstata.conf rather than $HOME/.config/nbstata/nbstata.conf, right?

We check if XDG_CONFIG_HOME is defined. If it isn't, we define XDG_CONFIG_HOME=$HOME/.config. Then we always use $XDG_CONFIG_HOME/nbstata/nbstata.conf.

from nbstata.

hugetim avatar hugetim commented on May 28, 2024

Ok, that sounds good. If you know of another Python project that handles a configuration file in a similar way (the simpler, the better), that would be helpful to see. Otherwise, I think this is enough to go on.

from nbstata.

hugetim avatar hugetim commented on May 28, 2024

Hmm, this code example doesn't do anything with XDG_CONFIG_HOME, which is the part I was most looking for sample code for. But co-pilot or the like can probably help me with that, anyway.

from nbstata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.