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
9307b60b
Commit
9307b60b
authored
Jun 08, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix reading multi-line macros from .pronsolerc
parent
d2319d8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
pronsole.py
pronsole.py
+7
-7
No files found.
pronsole.py
View file @
9307b60b
...
@@ -81,6 +81,7 @@ class pronsole(cmd.Cmd):
...
@@ -81,6 +81,7 @@ class pronsole(cmd.Cmd):
return
[]
return
[]
def
hook_macro
(
self
,
l
):
def
hook_macro
(
self
,
l
):
l
=
l
.
rstrip
()
ls
=
l
.
lstrip
()
ls
=
l
.
lstrip
()
ws
=
l
[:
len
(
l
)
-
len
(
ls
)]
# just leading whitespace
ws
=
l
[:
len
(
l
)
-
len
(
ls
)]
# just leading whitespace
if
len
(
ws
)
==
0
:
if
len
(
ws
)
==
0
:
...
@@ -100,14 +101,13 @@ class pronsole(cmd.Cmd):
...
@@ -100,14 +101,13 @@ class pronsole(cmd.Cmd):
print
"Macro '"
+
self
.
cur_macro_name
+
"' defined"
print
"Macro '"
+
self
.
cur_macro_name
+
"' defined"
#print self.cur_macro+"------------" # debug
#print self.cur_macro+"------------" # debug
self
.
prompt
=
"PC>"
self
.
prompt
=
"PC>"
if
self
.
cur_macro_def
==
""
:
if
self
.
cur_macro_def
!=
""
:
print
"Empty macro - cancelled"
del
self
.
cur_macro
,
self
.
cur_macro_name
,
self
.
cur_macro_def
return
self
.
macros
[
self
.
cur_macro_name
]
=
self
.
cur_macro_def
self
.
macros
[
self
.
cur_macro_name
]
=
self
.
cur_macro_def
exec
self
.
cur_macro
exec
self
.
cur_macro
setattr
(
self
.
__class__
,
"do_"
+
self
.
cur_macro_name
,
lambda
self
,
largs
,
macro
=
macro
:
macro
(
self
,
*
largs
.
split
()))
setattr
(
self
.
__class__
,
"do_"
+
self
.
cur_macro_name
,
lambda
self
,
largs
,
macro
=
macro
:
macro
(
self
,
*
largs
.
split
()))
setattr
(
self
.
__class__
,
"help_"
+
self
.
cur_macro_name
,
lambda
self
,
macro_name
=
self
.
cur_macro_name
:
self
.
subhelp_macro
(
macro_name
))
setattr
(
self
.
__class__
,
"help_"
+
self
.
cur_macro_name
,
lambda
self
,
macro_name
=
self
.
cur_macro_name
:
self
.
subhelp_macro
(
macro_name
))
else
:
print
"Empty macro - cancelled"
del
self
.
cur_macro
,
self
.
cur_macro_name
,
self
.
cur_macro_def
del
self
.
cur_macro
,
self
.
cur_macro_name
,
self
.
cur_macro_def
def
do_macro
(
self
,
args
):
def
do_macro
(
self
,
args
):
...
...
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