Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
9735d4e1
Commit
9735d4e1
authored
Jun 09, 2011
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from k-eex/macros
Fixed macro arguments expansion
parents
95ce7969
cba3ebbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pronsole.py
pronsole.py
+2
-2
No files found.
pronsole.py
View file @
9735d4e1
...
@@ -92,7 +92,7 @@ class pronsole(cmd.Cmd):
...
@@ -92,7 +92,7 @@ class pronsole(cmd.Cmd):
if
ls
.
startswith
(
'!'
):
if
ls
.
startswith
(
'!'
):
self
.
cur_macro
+=
ws
+
ls
[
1
:]
+
"
\n
"
# python mode
self
.
cur_macro
+=
ws
+
ls
[
1
:]
+
"
\n
"
# python mode
else
:
else
:
self
.
cur_macro
+=
ws
+
'self.onecmd("'
+
ls
+
'".format(arg))
\n
'
# parametric command mode
self
.
cur_macro
+=
ws
+
'self.onecmd("'
+
ls
+
'".format(
*
arg))
\n
'
# parametric command mode
self
.
cur_macro_def
+=
l
+
"
\n
"
self
.
cur_macro_def
+=
l
+
"
\n
"
def
end_macro
(
self
):
def
end_macro
(
self
):
...
@@ -137,7 +137,7 @@ class pronsole(cmd.Cmd):
...
@@ -137,7 +137,7 @@ class pronsole(cmd.Cmd):
if
macro_def
.
startswith
(
"!"
):
if
macro_def
.
startswith
(
"!"
):
self
.
cur_macro
=
"def macro(self,*arg):
\n
"
+
macro_def
[
1
:]
+
"
\n
"
self
.
cur_macro
=
"def macro(self,*arg):
\n
"
+
macro_def
[
1
:]
+
"
\n
"
else
:
else
:
self
.
cur_macro
=
"def macro(self,*arg):
\n
self.onecmd('"
+
macro_def
+
"'.format(arg))
\n
"
self
.
cur_macro
=
"def macro(self,*arg):
\n
self.onecmd('"
+
macro_def
+
"'.format(
*
arg))
\n
"
self
.
end_macro
()
self
.
end_macro
()
return
return
if
not
self
.
processing_rc
:
if
not
self
.
processing_rc
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment