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
9fd1aa6a
Commit
9fd1aa6a
authored
Nov 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'loggerfix'
Conflicts: printrun/printcore.py printrun/printrun_utils.py
parents
1395a013
0d7b62fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
printcore.py
printrun/printcore.py
+5
-3
printrun_utils.py
printrun/printrun_utils.py
+8
-0
pronterface.py
printrun/pronterface.py
+3
-1
No files found.
printrun/printcore.py
View file @
9fd1aa6a
...
...
@@ -24,6 +24,9 @@ from Queue import Queue, Empty as QueueEmpty
import
time
import
platform
import
os
import
sys
reload
(
sys
)
.
setdefaultencoding
(
'utf8'
)
import
logging
import
traceback
import
errno
import
socket
...
...
@@ -31,11 +34,10 @@ import re
from
functools
import
wraps
from
collections
import
deque
from
printrun.GCodeAnalyzer
import
GCodeAnalyzer
from
printrun.printrun_utils
import
install_locale
,
decode_utf8
from
printrun.printrun_utils
import
install_locale
,
decode_utf8
,
setup_logging
install_locale
(
'pronterface'
)
import
logging
logging
.
basicConfig
(
format
=
"
%(levelname)
s:
%(message)
s"
)
setup_logging
(
sys
.
stderr
)
def
locked
(
f
):
@
wraps
(
f
)
...
...
printrun/printrun_utils.py
View file @
9fd1aa6a
...
...
@@ -19,6 +19,7 @@ import gettext
import
datetime
import
subprocess
import
shlex
import
logging
# Set up Internationalization using gettext
# searching for installed locales on /usr/share; uses relative folder if not
...
...
@@ -32,6 +33,13 @@ def install_locale(domain):
else
:
gettext
.
install
(
domain
,
'./locale'
,
unicode
=
1
)
def
setup_logging
(
out
):
logger
=
logging
.
getLogger
()
logger
.
handlers
=
[]
logging_handler
=
logging
.
StreamHandler
(
out
)
logging_handler
.
setFormatter
(
logging
.
Formatter
(
"[
%(levelname)
s]
%(message)
s"
))
logger
.
addHandler
(
logging_handler
)
def
iconfile
(
filename
):
if
hasattr
(
sys
,
"frozen"
)
and
sys
.
frozen
==
"windows_exe"
:
return
sys
.
executable
...
...
printrun/pronterface.py
View file @
9fd1aa6a
...
...
@@ -30,7 +30,8 @@ import logging
from
.
import
pronsole
from
.
import
printcore
from
printrun.printrun_utils
import
install_locale
,
RemainingTimeEstimator
from
printrun.printrun_utils
import
install_locale
,
\
RemainingTimeEstimator
,
setup_logging
install_locale
(
'pronterface'
)
try
:
...
...
@@ -64,6 +65,7 @@ class Tee(object):
def
__init__
(
self
,
target
):
self
.
stdout
=
sys
.
stdout
sys
.
stdout
=
self
setup_logging
(
sys
.
stdout
)
self
.
target
=
target
def
__del__
(
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