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

Option to specify alternate config directory on first run #1243

Closed
alanhuang122 opened this issue Jan 12, 2018 · 3 comments
Closed

Option to specify alternate config directory on first run #1243

alanhuang122 opened this issue Jan 12, 2018 · 3 comments
Labels
Milestone

Comments

@alanhuang122
Copy link
Contributor

When the bot is first run, it executes sopel/run_script.py at startup.
Said script is hardcoded to create ~/.sopel if it doesn't already exist.
Should there be an option to allow the user to specify an alternate directory to use?

This was observed on d9cfb41 running python sopel.py without prior configuration.

@freeboson
Copy link
Contributor

@alanhuang122 are you thinking something like sopel -d ~/.sopel-alt?

@dgw
Copy link
Member

dgw commented May 9, 2018

@alanhuang122 It wasn't run_script.py, but the config helpers. Does 646f542 do what you're looking for?

@dgw
Copy link
Member

dgw commented Dec 7, 2018

Per #1404 (comment), I dug up the logs of the IRC conversation that led to this issue being opened in the first place. The words of the person who actually asked about this should give the best context:

<JZTech101> hi, how I can get sopel to install in a custom directory, along with all
            it's configs?
<alanhuang> JZTech101: there seems to be a homedir variable in [core]
<alanhuang> though it looks like sopel tries to create ~/.sopel initially if it doesn't
            exist(?)
<JZTech101> yes, yes it does. I was hoping for a non-code-editing solution? :/
<alanhuang> mmmmm
<alanhuang> let me see
<alanhuang> if you take an existing config file and add the homedir variable it works
<alanhuang> the only required variable seems to be [core] owner=
<JZTech101> required variable innthe config?
<alanhuang> yeah; it has defaults for server/port/other stuff *wince*
<alanhuang> nick, host, use_ssl, homedir, port, owner, channels are probably the bare
            minimum variables you want to specify to get things running
<JZTech101> awesome, thanks. I'll look into it when I gwt home, I'm at work
* alanhuang nods
<JZTech101> Also, I wouldn't worry too much about the defaults, it's likely a legacy
            thing they're too lazy to remove
<JZTech101> From when the bot's first roots
<alanhuang> opened an issue (though I don't expect much response) - might take a look
            and make a PR at some point

(Self-note: This is from /2018/01/11/freenode_%23sopel.log.gz)

Exirel added a commit to Exirel/sopel that referenced this issue Dec 31, 2018
The `sopel.run_script.homedir` variable was a "global" variable that
belong to the configuration realm. Therefore, I moved it to the
`sopel.config` module, and renamed it to `DEFAULT_HOMEDIR`.

This name:

* follow the PEP8 naming convention (not required but nice to have)
* move from a "run thing" module to a "config" module, which is more
  appropriate
* express the need for being the "default" location for configuration,
  since a local configuration can be used that might not be in it

All of this is unecessary, and more "nice to have", but it could help
fixing sopel-irc#1243 - if that makes sense.
Exirel added a commit to Exirel/sopel that referenced this issue Jan 10, 2019
The `sopel.run_script.homedir` variable was a "global" variable that
belong to the configuration realm. Therefore, I moved it to the
`sopel.config` module, and renamed it to `DEFAULT_HOMEDIR`.

This name:

* follow the PEP8 naming convention (not required but nice to have)
* move from a "run thing" module to a "config" module, which is more
  appropriate
* express the need for being the "default" location for configuration,
  since a local configuration can be used that might not be in it

All of this is unecessary, and more "nice to have", but it could help
fixing sopel-irc#1243 - if that makes sense.
Exirel added a commit to Exirel/sopel that referenced this issue Jan 31, 2019
The `sopel.run_script.homedir` variable was a "global" variable that
belong to the configuration realm. Therefore, I moved it to the
`sopel.config` module, and renamed it to `DEFAULT_HOMEDIR`.

This name:

* follow the PEP8 naming convention (not required but nice to have)
* move from a "run thing" module to a "config" module, which is more
  appropriate
* express the need for being the "default" location for configuration,
  since a local configuration can be used that might not be in it

All of this is unecessary, and more "nice to have", but it could help
fixing sopel-irc#1243 - if that makes sense.
Exirel added a commit to Exirel/sopel that referenced this issue Jan 31, 2019
The `sopel.run_script.homedir` variable was a "global" variable that
belonged to the configuration realm. Therefore, I moved it to the
`sopel.config` module, and renamed it to `DEFAULT_HOMEDIR`.

This name:

* follow the PEP8 naming convention (not required but nice to have)
* move from a "run thing" module to a "config" module, which is more
  appropriate
* express the need for being the "default" location for configuration,
  since a local configuration can be used that might not be in it

All of this is unecessary, and more "nice to have", but it could help
fixing sopel-irc#1243 - if that makes sense.
@dgw dgw closed this as completed in #1404 Feb 7, 2019
@dgw dgw added this to the 7.0.0 milestone Feb 7, 2019
kwaaak pushed a commit to kwaaak/sopel that referenced this issue Mar 25, 2019
The `sopel.run_script.homedir` variable was a "global" variable that
belonged to the configuration realm. Therefore, I moved it to the
`sopel.config` module, and renamed it to `DEFAULT_HOMEDIR`.

This name:

* follow the PEP8 naming convention (not required but nice to have)
* move from a "run thing" module to a "config" module, which is more
  appropriate
* express the need for being the "default" location for configuration,
  since a local configuration can be used that might not be in it

All of this is unecessary, and more "nice to have", but it could help
fixing sopel-irc#1243 - if that makes sense.
kwaaak pushed a commit to kwaaak/sopel that referenced this issue Mar 25, 2019
Infer config directory from given config filename.

Resolves sopel-irc#1243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants