abhimanyuPathania / lyrico

A python based command-line lyrics downloader
https://pypi.python.org/pypi/lyrico
Other
15 stars 6 forks source link

Simply running lyrico wants to change config #6

Closed cweiske closed 8 years ago

cweiske commented 8 years ago

When running lyrico with a given source dir, it wants to change the configuration file for no apparent reason:

$ lyrico Bell\ Book\ \&\ Candle/Read\ My\ Sign/
Unable to save settings to config.
[Errno 13] Permission denied: u'/usr/local/lib/python2.7/dist-packages/lyrico/config.ini'

There should not be anything that needs to be saved. Related to #5.

abhimanyuPathania commented 8 years ago

This is the intended behavior(last bullet point). The command lyrico path_to_source_dir is same as

  1. lyrico set source_dir path_to_source_dir
  2. lyrico

lyrico is the command that actually triggers downloads. It needs to read from config.ini for settings.

Your problem seems to be that you're unable to save to config.ini, which I keep along with rest of package files. This now is related to #5.

Does the command lyrico set source_dir path_to_source_dir go through? You must enter absolute path.

cweiske commented 8 years ago

I used sudo to set the source dir; that worked. But I did not want to run lyrico with sudo for "normal" operation.

But if you say that lyrico $path is the same as running lyrico set source_dir $path first, then I understand why it fails.


It seems I expect from this program something different than you. You require all to be configured before running, while I see the configuration file as something optional and that I should be able to configure everything by command line parameters.

abhimanyuPathania commented 8 years ago

I am not an avid Linux user, but when I tested lyrico I didn't have to use sudo. Even though running system level commands on my OS required me to use sudo.

It could be because I installed lyrico in a separate virtualenv and may be the permissions allow the config.ini file to be edited there. You can try that. That might also solve other issues as well.

cweiske commented 8 years ago

Yes, the virtualenv is probably the reason - I installed it system wide with sudo pip install lyrico.

cweiske commented 8 years ago

Ok, so this won't be fixed.

Btw, I would not expect that passing an option to a command modifies the permanent configuration (unless it's a "set" command). But this is what happens here.

abhimanyuPathania commented 8 years ago

The behavior is mentioned in the documentation. But mostly, I think that the change in config is totally non-intrusive. You can keep using the quick invocation command without worrying about changing config.

Your issue was caused by OS permissions related to updating the config file that was present alongside the package files.