-
Notifications
You must be signed in to change notification settings - Fork 82
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
check if config file exists #20
Comments
Graceful handling of errors?? We're getting very polished! Will add error
handling for this. I was thinking it might be a good idea to ship with the
"master" config listing every bank, but to have a "my config" file that you
paste the required ones into. I'm not certain though, is it a good idea?
…On 19 Oct 2017 11:35 am, "Torben Gundtofte-Bruun" ***@***.***> wrote:
Also found in Scottrobertson's code:
def perform_request(path)
raise 'Cannot find config file' unless File.exists?(config_path)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/APeoH-P4VXj89wOxgofLSeuXbjPathsrks5styX0gaJpZM4P_Brp>
.
|
I'm used to working with ... less experienced users, so this caught my attention when I saw it in his code. And hey, the script already works wonderfully, so what else is there to do? I too thought about what would happen when a user (me!) grabs a new version after having made changes to the [DEFAULT] config (e.g. the same download path for all my formats). In past projects, I've had a system-default config plus a user-default config that would override the system default, plus specific configs on top of that. Parameters were read as system-then-user-then-specific so the most specific setting gets the last word. I don't want to add too much complexity here so perhaps we could have the system-defaults as a fallback in the code, and leave the user-default in the config? What happens if I want to to have Payee&Memo swapped on my import but you don't, for the same format? Who gets to decide the "official" format? |
That's true. Could have a binary "active" flag for each section in the config? So "rabo Ben" could be a different section to "rabo nocalla". Maybe? Not sure about this. The DEFAULT in config acts as fall back anyway, not sure what happens if another config file also specifies default values. Which supercedes which? Worth experimentation I think. |
I suggest following your advice: walk first, run later. Our present config file works very well. I realize that if I mess with my local copy of the config, then it's my headache to deal with the diff to a new version. If we're already asking people to edit .conf files and run .py files, we can expect that those willing to do so are also able to handle the changes they make -- or accept their loss when everything is broken and they download a fresh package. So - would you be okay with just adding simple sanity checks like "file missing" for now? There could still be a whole lot of "missing parameter" checks in that, given that there is no fallback in the code. Without a valid config, the script can't run. Back to the thought of having sanity checks or hardcoded fallbacks, but I think we can't make a reliable fallback for most settings (download path, delimiter, etc). |
File missing for now I think. We'll work out user defaults down the line.
…On 19 Oct 2017 1:50 pm, "Torben Gundtofte-Bruun" ***@***.***> wrote:
I suggest following your advice: walk first, run later. Our present config
file works very well.
I realize that if I mess with my local copy of the config, then it's my
headache to deal with the diff to a new version. If we're already asking
people to edit .conf files and run .py files, we can expect that those
willing to do so are also able to handle the changes they make -- or accept
their loss when everything is broken and they download a fresh package.
So - would you be okay with just adding simple sanity checks like "file
missing" for now? There could still be a whole lot of "missing parameter"
checks in that, given that there is no fallback in the code. Without a
valid config, the script can't run.
Back to the thought of having sanity checks or hardcoded fallbacks, but I
think we can't make a reliable fallback for most settings (download path,
delimiter, etc).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APeoH9jrsH-mAuQunL6Ckj99oVn-oX5Pks5st0WogaJpZM4P_Brp>
.
|
Print error message if config file doesn't exist. No need to do anything else, as script will just terminate anyway.
Also found in Scottrobertson's code:
The text was updated successfully, but these errors were encountered: