telegram-export icon indicating copy to clipboard operation
telegram-export copied to clipboard

Create a default config file if it doesn't exist

Open Lonami opened this issue 6 years ago • 6 comments

This would also be a nice way to generate consistent config files with the actual defaults used in the code, instead maintaining them separately.

Lonami avatar May 04 '18 07:05 Lonami

We already do provide a default config file, albeit online. We could download it, I suppose, but the user still needs to manually provide some values.

expectocode avatar May 07 '18 21:05 expectocode

The idea is to get rid of that config file and generate a sane default one on the first run, which the user can modify.

Lonami avatar May 07 '18 21:05 Lonami

@Lonami I like having an actual file to reference, instead of something generated at runtime

expectocode avatar May 07 '18 21:05 expectocode

@expectocode but if we generate the default file if the chosen one doesn't exist lets us easily be consistent with default values in the code and the file. Adding comments and templating the values before writing isn't hard.

Lonami avatar May 07 '18 21:05 Lonami

Although templating values and keeping comments around is still kind of weird. Maybe just bundle the config file for PyPi or something.

Lonami avatar May 07 '18 23:05 Lonami

@Lonami Perhaps we could use something like https://stackoverflow.com/questions/40193112/python-setuptools-distribute-configuration-files-to-os-specific-directories

expectocode avatar May 07 '18 23:05 expectocode