Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix for issue #717#727

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
xarx00 wants to merge2 commits intopython-gitlab:masterfromxarx00:bugfix-717
Closed

Conversation

xarx00
Copy link
Contributor

I propose this fix for isuue#717. It fixesevent list, which didn't worked when invoked from CLI (and probably neither when used from gitlab API).

@@ -357,7 +357,7 @@ def display_dict(d, padding):
id = getattr(obj, obj._id_attr)
print('%s: %s' % (obj._id_attr.replace('_', '-'), id))
if hasattr(obj, '_short_print_attr'):
value = getattr(obj, obj._short_print_attr)
value = getattr(obj, obj._short_print_attr) or 'None'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn'tNone events just be skipped in the CLI?

target_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: Nonetarget_title: None

Copy link
ContributorAuthor

@xarx00xarx00Mar 6, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actually, I don't know what these bad events are. It seems to me better to display them then to hide them. Because I consider github as a tool that helps me to show precisely what's going on in GitLab. If it hides the bad results, it may hide an important clue to a problem I'm solving.

But I don't know how other parts of github behave. It's up to you to decide what you want it to do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The problem I see with this issue is that there is no way to have a usable output without displaying multiple attributes. For events that would be target_type and action_name for exemple

What we could do (to be discussed):

  1. make thedisplay_dict check for arepr method for the object. This method would return a key and a value to be displayed. We could use__repr__ ou__unicode__ for this maybe
  2. if the method doesn't exist, fallback to the_short_print_attr attribute
  3. if this attribute is None raise an error so we can fix the code and add the method from 1 (not sure about this step, it's not nice for end users).

Other idea:_short_print_attr could become a tuple, and we display multiple lines when needed

@gpocentek
Copy link
Contributor

@xarx00 could you make the commit messages a bit more meaningful? Something like:

fix(cli): Don't fail when the short print attr value is NoneFixes #717

Thanks for your help on fixing the CLI 👍

@xarx00
Copy link
ContributorAuthor

xarx00 commentedMar 7, 2019
edited
Loading

@gpocentek OK, I have thought that link to the defect is enough.

Also, the PEP8 test on GitHub Travis CI complains when the commit message is longer than 50 chars.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpocentekgpocentekgpocentek left review comments

@max-wittigmax-wittigmax-wittig left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@xarx00@gpocentek@max-wittig

[8]ページ先頭

©2009-2025 Movatter.jp