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
69e23def
Commit
69e23def
authored
Jun 01, 2011
by
Keegi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.pronsolerc support
parent
36736e31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
.pronsolerc
.pronsolerc
+5
-0
pronsole.py
pronsole.py
+7
-0
No files found.
.pronsolerc
0 → 100644
View file @
69e23def
# Sample .pronsolerc file - copy this into your home directory
!self.do_alias = lambda aarg,self=self: setattr(self,"do_"+aarg.split()[0],lambda arg,self=self,a=aarg.split(None,1)[1]:self.onecmd(" ".join((a,arg))))
alias up move Z 10
alias loud !self.loud = 1
alias quiet !self.loud = 0
pronsole.py
View file @
69e23def
...
@@ -74,6 +74,13 @@ class pronsole(cmd.Cmd):
...
@@ -74,6 +74,13 @@ class pronsole(cmd.Cmd):
cmd
.
Cmd
.
postloop
(
self
)
cmd
.
Cmd
.
postloop
(
self
)
def
preloop
(
self
):
def
preloop
(
self
):
try
:
with
open
(
os
.
path
.
join
(
os
.
path
.
expanduser
(
"~"
),
".pronsolerc"
))
as
rc
:
for
rc_cmd
in
rc
:
if
rc_cmd
.
lstrip
()[
0
]
!=
"#"
:
self
.
onecmd
(
rc_cmd
.
rstrip
(
r"\r\n"
))
except
IOError
:
pass
print
"Welcome to the printer console! Type
\"
help
\"
for a list of available commands."
print
"Welcome to the printer console! Type
\"
help
\"
for a list of available commands."
cmd
.
Cmd
.
preloop
(
self
)
cmd
.
Cmd
.
preloop
(
self
)
...
...
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