-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Use a menu separator constant instead of None #3795
Conversation
@@ -499,6 +499,10 @@ def show_std_icons(): | |||
dialog.show() | |||
sys.exit(app.exec_()) | |||
|
|||
|
|||
def get_menu_separator(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call this menu_separator
.
@@ -973,25 +973,27 @@ def get_plugin_actions(self): | |||
# ---- File menu/toolbar construction ---- | |||
self.recent_file_menu = QMenu(_("Open &recent"), self) | |||
self.recent_file_menu.aboutToShow.connect(self.update_recent_file_menu) | |||
|
|||
|
|||
menu_separator = get_menu_separator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this assigment
Thanks for working on this @mariacamilaremolinagutierrez :-) However, there are many other places where None is used as menu separator (i.e. not just in the Editor). Please find them all and do the same replacement you already did for the Editor. |
There are a lot of style failures. Please review CircleCI to see how to fix them :-) |
@ccordoba12 Wow there are, nice work on CI, it is super useful. I am making several commits but I'll squash the ones regarding style and some merges :) Also, I'm not sure about this one:
Because that would mean changing the header structure: Should I import it up? |
Please don't change the import order in However, ciocheck is still reporting errors in |
@ccordoba12 do you know how to re run tests without making another commit? I'm getting a HTTPError: 500 Server Error in the CI failure. |
I restarted the build. There are still some failures (besides the import order :-) |
@ccordoba12 I don't quite understand the last error I have left. How should I indent it? |
@mariacamilaremolinagutierrez using a = []
b = []
c = []
new = (a +
b +
['something'] +
c +
['something']) You can also use the same for strings that are too long: # a is a single string.
a = ('asdasdadsasdasd asd adasd ads ad asd asd ad ad ad asdas dasd asd adas '
'asdasdasd asd s asd asd df a sd asd d adsasdasd a ds asd asd asd ad') Parenthesis used like this serve the same purpose and make the code much cleaner. Also PEP8 requires that the operators remain at the end of the line instead of at the beginning, so # PEP8 ok
a = (5123123123123123123132134123123123132 +
6)
# PEP8 fails
a = (5123123123123123123132134123123123132
+ 6) Although that rule is not perfect to be honest... |
style corrections style corrections 2 style corrections 3 total style corrections
@goanpeca Awesome! Thank you very much :) @ccordoba12 The CI test that's failing is only the import one I mentioned earlier. And the style commits were squashed in one. |
@@ -499,6 +499,10 @@ def show_std_icons(): | |||
dialog.show() | |||
sys.exit(app.exec_()) | |||
|
|||
|
|||
def menu_separator(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this one a constant instead of a function to use it more easily, like this
menu_separator = None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then make it upper case!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, sure, no problem with that :-)
Great job at fixing the style issues! I left a last comment, then this would be ready :-) |
@goanpeca Both ways are accepted, and operators at the beginning Knuth's style are preferred |
Thanks @mariacamilaremolinagutierrez, this looks good to me now :-) |
Fixes #3794