Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
f0cfc22c
Commit
f0cfc22c
authored
3 years ago
by
Izzard, Robert Dr (Maths & Physics)
Browse files
Options
Downloads
Patches
Plain Diff
improve newline passing
parent
7b2842ae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
binarycpython/utils/functions.py
+2
-1
2 additions, 1 deletion
binarycpython/utils/functions.py
binarycpython/utils/grid_logging.py
+7
-3
7 additions, 3 deletions
binarycpython/utils/grid_logging.py
with
9 additions
and
4 deletions
binarycpython/utils/functions.py
+
2
−
1
View file @
f0cfc22c
...
@@ -373,7 +373,7 @@ def call_binary_c_config(argument):
...
@@ -373,7 +373,7 @@ def call_binary_c_config(argument):
def
verbose_print
(
message
:
str
,
def
verbose_print
(
message
:
str
,
verbosity
:
int
,
verbosity
:
int
,
minimal_verbosity
:
int
,
minimal_verbosity
:
int
,
newline
=
"
\n
"
)
->
None
:
newline
:
str
=
"
\n
"
)
->
None
:
"""
"""
Function that decides whether to print a message based on the current verbosity
Function that decides whether to print a message based on the current verbosity
and its minimum verbosity
and its minimum verbosity
...
@@ -384,6 +384,7 @@ def verbose_print(message: str,
...
@@ -384,6 +384,7 @@ def verbose_print(message: str,
message: message to print
message: message to print
verbosity: current verbosity level
verbosity: current verbosity level
minimal_verbosity: threshold verbosity above which to print
minimal_verbosity: threshold verbosity above which to print
newline: newline character (or set of characters), defaults to
"
\n
"
but
"
\x0d
"
(carriage return) might be useful.
"""
"""
if
verbosity
>=
minimal_verbosity
:
if
verbosity
>=
minimal_verbosity
:
...
...
This diff is collapsed.
Click to expand it.
binarycpython/utils/grid_logging.py
+
7
−
3
View file @
f0cfc22c
...
@@ -274,7 +274,7 @@ class grid_logging():
...
@@ -274,7 +274,7 @@ class grid_logging():
mem_use
=
total_mem_use
,
mem_use
=
total_mem_use
,
system_string_colour
=
self
.
ANSI_colours
[
"
yellow
"
],
system_string_colour
=
self
.
ANSI_colours
[
"
yellow
"
],
system_string
=
system_string
,
system_string
=
system_string
,
closing_colour
=
self
.
ANSI_colours
[
"
reset
"
]
,
closing_colour
=
self
.
ANSI_colours
[
"
reset
"
]
),
),
self
.
grid_options
[
"
verbosity
"
],
self
.
grid_options
[
"
verbosity
"
],
1
,
1
,
...
@@ -295,8 +295,7 @@ class grid_logging():
...
@@ -295,8 +295,7 @@ class grid_logging():
mem_use
=
total_mem_use
,
mem_use
=
total_mem_use
,
system_string_colour
=
self
.
ANSI_colours
[
"
yellow
"
],
system_string_colour
=
self
.
ANSI_colours
[
"
yellow
"
],
system_string
=
system_string
,
system_string
=
system_string
,
closing_colour
=
self
.
ANSI_colours
[
"
reset
"
],
closing_colour
=
self
.
ANSI_colours
[
"
reset
"
]
newline
=
self
.
grid_options
[
"
log_newline
"
]
),
),
self
.
grid_options
[
"
verbosity
"
],
self
.
grid_options
[
"
verbosity
"
],
1
,
1
,
...
@@ -313,6 +312,11 @@ class grid_logging():
...
@@ -313,6 +312,11 @@ class grid_logging():
)
)
def
verbose_print
(
self
,
*
args
,
**
kwargs
):
def
verbose_print
(
self
,
*
args
,
**
kwargs
):
# wrapper for functions.verbose_print to use the correct newline
newline
=
kwargs
.
get
(
"
newline
"
,
self
.
grid_options
[
"
log_newline
"
])
if
newline
is
None
:
newline
=
"
\n
"
kwargs
[
"
newline
"
]
=
newline
binarycpython
.
utils
.
functions
.
verbose_print
(
*
args
,
**
kwargs
)
binarycpython
.
utils
.
functions
.
verbose_print
(
*
args
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment