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

Detect the program name whenpython -m was executed#424

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

Open
dukecat0 wants to merge2 commits intogoogle:master
base:master
Choose a base branch
Loading
fromdukecat0:package-name

Conversation

@dukecat0
Copy link

@dukecat0dukecat0 commentedDec 17, 2022
edited
Loading

Closes#76

Old behaviour:

SYNOPSIS    __main__.py ARGS

New behaviour:

SYNOPSIS    '/usr/bin/python -m sample' ARGS

Display(output,out=sys.stdout)


def_GetProgName(name,main=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the current PR I don't think the main arg is passed anywhere (other than the test). Is a file missing?

Copy link
Author

Choose a reason for hiding this comment

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

It is only passed during testing.

@dbieber
Copy link
Collaborator

Good idea! Thanks for submitting 👍

dukecat0 reacted with thumbs up emoji

Args:
name: Optional. The name of the command as entered at the command line.
main: Optional. This should only be passed during testing.
Copy link
Author

Choose a reason for hiding this comment

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

See here :)

@dbieber
Copy link
Collaborator

The new behavior doesn't look quite like what we want:

SYNOPSIS    '/usr/bin/python -m sample' ARGS

Instead, we'd prefer the following, right?

SYNOPSIS    /usr/bin/python -m sample ARGS

@dukecat0
Copy link
Author

It looks like the quotes come from here:

return' '.join(self._Quote(arg)forarginargs)

I think the reason is that there are spaces insideself.name, i.e./usr/bin/python -m sample. Any opinions on how should we deal with this case?

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

Reviewers

@dbieberdbieberdbieber 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.

Use package name when __main__.py is used

2 participants

@dukecat0@dbieber

[8]ページ先頭

©2009-2025 Movatter.jp