sugarlabs / convert

Sugar units conversion activity
GNU General Public License v3.0
0 stars 6 forks source link

[Final] Fix Empty unit spinners and spin button #10

Closed chimosky closed 6 years ago

chimosky commented 6 years ago

Activity runs fine but i get this error """Traceback (most recent call last): File "/home/ibiam/Activities/convert/activity.py", line 207, in _call self._update_label() File "/home/ibiam/Activities/convert/activity.py", line 195, in _update_label new_convert = locale.format(fmt, float(convert_value)) ValueError: could not convert string to float: None """

quozl commented 6 years ago

I'll wait until you've fixed that error then, and mark the pull request as in progress. Wouldn't want to merge a commit with a message about a problem unrelated to the commit.

chimosky commented 6 years ago

Done.

rhl-bthr commented 6 years ago

Reviewed and Tested.

chimosky commented 6 years ago
  • [ ] Every item in the combobox is displayed twice(side by side)

One for the unit being converted from, the other the unit being converted to.

rhl-bthr commented 6 years ago

Sorry, my statement might have had been ambiguous, This is what I meant: screenshot

chimosky commented 6 years ago

Just noticed it too.

chimosky commented 6 years ago

Change made

chimosky commented 6 years ago

@quozl Please review

quozl commented 6 years ago

Quick review; did not understand 565e3b89e2, any more detail?

chimosky commented 6 years ago

If active < 0 returns None, the value of text = keys[active] is also None so i thought of setting active to 0 instead of returning None since _get_active_text returns None which can't be converted to float and it worked -- i think it also works for none-negative values --.

chimosky commented 6 years ago

I also just noticed that without the active check, the activity runs fine. So I've removed the check.

chimosky commented 6 years ago

@quozl Kindly review.

quozl commented 6 years ago

Thanks for the update.

If active < 0 returns None, the value of text = keys[active] is also None so i thought of setting active to 0 instead of returning None since _get_active_text returns None which can't be converted to float and it worked -- i think it also works for none-negative values --.

Okay, thanks. This should be in the commit message; because pull request discussions are not archived, only the commit message is kept. If after reading below you think it should still be that way, please use git rebase -i or other methods to rewrite your commit message.

I also just noticed that without the active check, the activity runs fine. So I've removed the check.

Respectfully disagree.

The _get_active_text method takes as input a Gtk.ComboBox instance, and returns the text corresponding to the currently active item. It does this using Gtk.ComboBox.get_active method. Documentation says the method may return -1 when there is no active item. An index of -1 will cause an error in the line;

text = keys[active]

Because there is no key -1 in the dictionary.

The check for less than zero precedes this line, in the master branch, and you've removed it; perhaps you did not fully test the activity? Even if the code takes some other action to ensure there is an active item, there may be some way to not have an active item.

chimosky commented 6 years ago

Thanks, I'll rebase and send a new PR.

quozl commented 6 years ago

A new pull request is irritating, because we lose the discussion. Please just rebase properly and force push. If you don't yet know how to rebase, it's about time you learned by experience.

chimosky commented 6 years ago

Done, commit message not edited though.

quozl commented 6 years ago

Tested. Now I wait for you to finish the job;

Then I shall review your commit message against your source code changes. What is merged should be the minimal number of commits for each problem fixed.

Don't use your commit message to explain the exact change; we can see that from the commit diff. See our guide to making commits.

chimosky commented 6 years ago

I've tried rebasing but it's not working for me, is this okay?

quozl commented 6 years ago

Thanks, that's progress. You've rebased 0a650e221e628d80aabc143d5e0464bfb15063d5 to 65ca39667e8603cb14d70481963ac03797783aaf with no other change except commits and commit messages.

Now I've read the commit in detail and used the guide for reviewers. As you read this, also have 65ca396 open in another window or tab, so you can see what I see.

So there's my quandry. I could follow my own advice in guide for reviewers to rewrite, rebase and split your patch, something which will take me no more than five minutes. But I'm not sure if that's what you intend, it takes agency from you, and you won't have tested what I commit.

You've shown such uncommon resistance to rewriting patches and writing commit messages that I'm worried you are actively avoiding learning these skills, and I don't want you to miss out on the opportunity to do so.

If you have problems with rebasing, you might mention what they are.

chimosky commented 6 years ago

Changes made

Some of the above have been put into the same commits, where this occurs the commit message clearly states it.

You've shown such uncommon resistance to rewriting patches and writing commit messages that I'm worried you are actively avoiding learning these skills, and I don't want you to miss out on the opportunity to do so.

Thanks, I'm learning those skills and I promise not to miss out on this oppurtunity.

If you have problems with rebasing, you might mention what they are.

I hope you don't mind me sending a personal email.