This repository was archived by the owner on Sep 28, 2024. It is now read-only.
Clean up snippets in the python module#3
Open
paaguti wants to merge 7 commits intoorbitalquark:defaultfrom
Open
Clean up snippets in the python module#3paaguti wants to merge 7 commits intoorbitalquark:defaultfrom
paaguti wants to merge 7 commits intoorbitalquark:defaultfrom
Conversation
init.lua
Outdated
| "\t)\n" | ||
| snip.ifmain = "if __name__ == '__main__':\n" .. | ||
| "\t%1(main())\n" | ||
| snip.class = "class %1(ClassName)%0:\n\t'''%2(documentation)'''\n\n" .. |
Owner
There was a problem hiding this comment.
I would much rather prefer something like this:
snip.class = table.concat({
"class %1(ClassName)%2((%3(object))):",
"\t%4('''%5(documentation)'''",
"",
"\t)def __init__(self%6(, %7(arg))):",
"\t\t%8(super(%1, self).__init__())"
}, '\n')
You've missed the trailing newline. It's easy to make that mistake with so many escapes.
I'm not sure this commit is an improvement over longstrings.
Author
|
Hmm... nice :-) I'll try that :-)
/PA
…On Tue, 17 May 2022 at 18:48, orbitalquark ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In init.lua
<#3 (comment)>
:
> -
- )def __init__(self%6(, %7(arg))):
- %8(super(%1, self).__init__())]]
-snip.try = [[
-try:
- %0
-except %2(Exception) as %3(e):
- %4(pass)%5(
-finally:
- %6(pass))]]
+snip.def = "def %1(name)(%2(self)%3(, %4(arg))):\n" ..
+"\t%5('''%6'''\n" ..
+"\t)\n"
+snip.ifmain = "if __name__ == '__main__':\n" ..
+"\t%1(main())\n"
+snip.class = "class %1(ClassName)%0:\n\t'''%2(documentation)'''\n\n" ..
I would much rather prefer something like this:
snip.class = table.concat({
"class %1(ClassName)%2((%3(object))):",
"\t%4('''%5(documentation)'''",
"",
"\t)def __init__(self%6(, %7(arg))):",
"\t\t%8(super(%1, self).__init__())"
}, '\n')
You've missed the trailing newline. It's easy to make that mistake with so
many escapes.
I'm not sure this commit is an improvement over longstrings.
—
Reply to this email directly, view it on GitHub
<#3 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZKU4HNMFFTIEN5O3BLV4LVKPEVVANCNFSM5WEBGJSA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HI,
I put all snippets as single strings with \n and \t to make better tabulations...