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
72173c60
Commit
72173c60
authored
Jul 31, 2012
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CLI parameters for web config files location (if not in ~/.printrun or cwd)
Also remove the chdir() to pronterface.py directory
parent
cc60367a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
webinterface.py
printrun/webinterface.py
+3
-3
pronsole.py
pronsole.py
+7
-1
pronterface.py
pronterface.py
+1
-4
No files found.
printrun/webinterface.py
View file @
72173c60
...
@@ -241,7 +241,7 @@ class WebInterface(object):
...
@@ -241,7 +241,7 @@ class WebInterface(object):
config
=
ConfigParser
.
SafeConfigParser
(
allow_no_value
=
True
)
config
=
ConfigParser
.
SafeConfigParser
(
allow_no_value
=
True
)
else
:
else
:
config
=
ConfigParser
.
SafeConfigParser
()
config
=
ConfigParser
.
SafeConfigParser
()
config
.
read
(
configfile
(
'auth.config'
))
config
.
read
(
configfile
(
pface
.
web_auth_config
or
'auth.config'
))
users
[
config
.
get
(
"user"
,
"user"
)]
=
config
.
get
(
"user"
,
"pass"
)
users
[
config
.
get
(
"user"
,
"user"
)]
=
config
.
get
(
"user"
,
"pass"
)
self
.
pface
=
pface
self
.
pface
=
pface
global
gPronterPtr
global
gPronterPtr
...
@@ -361,7 +361,7 @@ def KillWebInterfaceThread():
...
@@ -361,7 +361,7 @@ def KillWebInterfaceThread():
def
StartWebInterfaceThread
(
webInterface
):
def
StartWebInterfaceThread
(
webInterface
):
current_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
current_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
cherrypy
.
config
.
update
({
'engine.autoreload_on'
:
False
})
cherrypy
.
config
.
update
({
'engine.autoreload_on'
:
False
})
cherrypy
.
config
.
update
(
configfile
(
"http.config"
))
cherrypy
.
config
.
update
(
configfile
(
webInterface
.
pface
.
web_config
or
"http.config"
))
conf
=
{
'/css/style.css'
:
{
'tools.staticfile.on'
:
True
,
conf
=
{
'/css/style.css'
:
{
'tools.staticfile.on'
:
True
,
'tools.staticfile.filename'
:
sharedfile
(
'css/style.css'
),
'tools.staticfile.filename'
:
sharedfile
(
'css/style.css'
),
},
},
...
@@ -371,7 +371,7 @@ def StartWebInterfaceThread(webInterface):
...
@@ -371,7 +371,7 @@ def StartWebInterfaceThread(webInterface):
'/images/control_z.png'
:
{
'tools.staticfile.on'
:
True
,
'/images/control_z.png'
:
{
'tools.staticfile.on'
:
True
,
'tools.staticfile.filename'
:
imagefile
(
'control_z.png'
),
'tools.staticfile.filename'
:
imagefile
(
'control_z.png'
),
}}
}}
cherrypy
.
config
.
update
(
configfile
(
"http.config"
))
cherrypy
.
config
.
update
(
configfile
(
webInterface
.
pface
.
web_config
or
"http.config"
))
cherrypy
.
quickstart
(
webInterface
,
'/'
,
config
=
conf
)
cherrypy
.
quickstart
(
webInterface
,
'/'
,
config
=
conf
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
pronsole.py
View file @
72173c60
...
@@ -277,6 +277,8 @@ class pronsole(cmd.Cmd):
...
@@ -277,6 +277,8 @@ class pronsole(cmd.Cmd):
self
.
helpdict
[
"final_command"
]
=
_
(
"Executable to run when the print is finished"
)
self
.
helpdict
[
"final_command"
]
=
_
(
"Executable to run when the print is finished"
)
self
.
commandprefixes
=
'MGT$'
self
.
commandprefixes
=
'MGT$'
self
.
webrequested
=
False
self
.
webrequested
=
False
self
.
web_config
=
None
self
.
web_auth_config
=
None
def
set_temp_preset
(
self
,
key
,
value
):
def
set_temp_preset
(
self
,
key
,
value
):
if
not
key
.
startswith
(
"bed"
):
if
not
key
.
startswith
(
"bed"
):
...
@@ -1211,13 +1213,17 @@ class pronsole(cmd.Cmd):
...
@@ -1211,13 +1213,17 @@ class pronsole(cmd.Cmd):
def
parse_cmdline
(
self
,
args
):
def
parse_cmdline
(
self
,
args
):
import
getopt
import
getopt
opts
,
args
=
getopt
.
getopt
(
args
,
"c:e:h
:w"
,
[
"conf="
,
"config="
,
"help"
,
"web
"
])
opts
,
args
=
getopt
.
getopt
(
args
,
"c:e:h
w"
,
[
"conf="
,
"config="
,
"help"
,
"web"
,
"web-config="
,
"web-auth-config=
"
])
for
o
,
a
in
opts
:
for
o
,
a
in
opts
:
#print repr((o,a))
#print repr((o,a))
if
o
in
(
"-c"
,
"--conf"
,
"--config"
):
if
o
in
(
"-c"
,
"--conf"
,
"--config"
):
self
.
load_rc
(
a
)
self
.
load_rc
(
a
)
elif
o
in
(
"-w"
,
"--web"
):
elif
o
in
(
"-w"
,
"--web"
):
self
.
webrequested
=
True
self
.
webrequested
=
True
elif
o
==
"--web-config"
:
self
.
web_config
=
a
elif
o
==
"--web-auth-config"
:
self
.
web_auth_config
=
a
elif
o
in
(
"-h"
,
"--help"
):
elif
o
in
(
"-h"
,
"--help"
):
print
"Usage: "
+
sys
.
argv
[
0
]
+
' [-c filename [-c filename2 ... ] ] [-e "command" ...]'
print
"Usage: "
+
sys
.
argv
[
0
]
+
' [-c filename [-c filename2 ... ] ] [-e "command" ...]'
print
" -c | --conf | --config - override startup .pronsolerc file"
print
" -c | --conf | --config - override startup .pronsolerc file"
...
...
pronterface.py
View file @
72173c60
...
@@ -28,10 +28,7 @@ except:
...
@@ -28,10 +28,7 @@ except:
print
_
(
"WX is not installed. This program requires WX to run."
)
print
_
(
"WX is not installed. This program requires WX to run."
)
raise
raise
import
sys
,
glob
,
time
,
threading
,
traceback
,
cStringIO
,
subprocess
import
sys
,
glob
,
time
,
threading
,
traceback
,
cStringIO
,
subprocess
try
:
os
.
chdir
(
os
.
path
.
split
(
__file__
)[
0
])
except
:
pass
StringIO
=
cStringIO
StringIO
=
cStringIO
thread
=
threading
.
Thread
thread
=
threading
.
Thread
...
...
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