Export to GitHub

obkey - issue #5

UI messages in order to announce problems with rc files


Posted on Nov 29, 2010 by Happy Camel

What steps will reproduce the problem? 1.obkey now just fails writing messages to the console, which is not seen when launched from the ui 2. 3.

What is the expected output? What do you see instead? obkey just fails to launch

What version of the product are you using? On what operating system? Ubuntu + lxde

Please provide any additional information below. I attach a modified obkey script that a) warns of errors graphically, and b) it is able to more or less infer the configuration file to use

Attachments

Comment #1

Posted on Nov 29, 2010 by Quick Bear

I won't take the patch. If I don't have a document describing my coding style it doesn't mean I don't have one.

  1. Indentation: you're using 4 spaces, I use tabs.
  2. A lot of mess like unnecessary brackets in if statements.
  3. Spaces separating arguments and brackets in function calls.
  4. Bugs: there is no such thing as os.exit it's sys.exit. If you haven't noticed that, it means you haven't even tested it. It's Python after all, you can't send a python patch to anyone without testing it.
  5. shutil.copyfile( path, path + str( time.time() ) + ".bak" ) # I don't need undocumented changes like that, if you're making a patch it should fix something or add something, not some random stuff. Generally speaking, that way of doing backups is unacceptable. Users will end up with tons of backup files in their config dirs. I agree that using shutil is better than os.system("cp") though.

So.. fix all that stuff, or I won't accept it.

Comment #2

Posted on Nov 29, 2010 by Quick Bear

Issue 3 has been merged into this issue.

Comment #3

Posted on Nov 30, 2010 by Happy Camel

I won't take the patch. Well, you're free to do that. I just wanted to share the enhancement of obkey with everybody. It now works fine (for me).

If I don't have a document describing my coding style it doesn't mean I don't have one. How am I then supposed to guess your coding style?

1.Tabs 2.A lot of mess like unnecessary brackets in if statements. 3. Spaces separating arguments and brackets in function calls.

It does not seem a very big deal... is it? It is not a so long script so you're unable to change it accordingly to your tastes.

  1. Bugs: there is no such thing as os.exit it's sys.exit. If you haven't noticed that, it means you haven't even tested it. It's Python after all, you can't send a python patch to anyone without testing it.

The obkey script, with that patch applied, is perfectly working now. Yep, it is true that sys.exit() is the correct one in that places, but the other modifications should be okay, as they work for me (that branch of the code is only reached when everything else, that's why it is not tested).

So. fix all that stuff, or I won't accept it.

As I said, is up to you, I won't be sending any other file. I was just trying to help, and I really think that obkey is better now, being able to show errors properly, inferring the configuration file to use, or accepting a new one as argument... I'd at least use the showError() function, and surround your code with try...except. After all, that's simply a matter common sense.

Sorry to have disturbed you. I wonder anyway if you are really willing to get help.

Comment #4

Posted on Nov 30, 2010 by Quick Bear

As I said, is up to you, I won't be sending any other file. Goodbye.

Status: WontFix

Labels:
Type-Enhancement Priority-Medium