Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
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
Marko Mecina
CCS
Commits
1e989456
Commit
1e989456
authored
2 years ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
make confignator usage more efficient in codeblockreusefeature
parent
f0c9443d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tst/codeblockreusefeature/codeblockreuse.py
+12
-10
12 additions, 10 deletions
Tst/codeblockreusefeature/codeblockreuse.py
Tst/codeblockreusefeature/codeblockreusefeature.cfg
+1
-1
1 addition, 1 deletion
Tst/codeblockreusefeature/codeblockreusefeature.cfg
with
13 additions
and
11 deletions
Tst/codeblockreusefeature/codeblockreuse.py
+
12
−
10
View file @
1e989456
...
@@ -20,7 +20,7 @@ translate = gettext.translation('handroll', localedir, fallback=True)
...
@@ -20,7 +20,7 @@ translate = gettext.translation('handroll', localedir, fallback=True)
_
=
translate
.
gettext
_
=
translate
.
gettext
uni_grau
=
'
#666666
'
uni_grau
=
'
#666666
'
uni_weiss
=
'
#
ffffff
'
uni_weiss
=
'
#
FFFFFF
'
uni_schwarz
=
'
#000000
'
uni_schwarz
=
'
#000000
'
uni_blau
=
'
#0063A6
'
uni_blau
=
'
#0063A6
'
...
@@ -37,8 +37,10 @@ setting.set_boolean("enable-inspector-keybinding", True)
...
@@ -37,8 +37,10 @@ setting.set_boolean("enable-inspector-keybinding", True)
menu_xml
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
menu.xml
'
)
menu_xml
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
menu.xml
'
)
css_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
style.css
'
)
css_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
style.css
'
)
cfg
=
confignator
.
get_config
()
log_file_path
=
confignator
.
get_option
(
section
=
'
codereuse-logging
'
,
option
=
'
log-file-path
'
)
log_file_path
=
cfg
.
get
(
section
=
'
codereuse-logging
'
,
option
=
'
log-file-path
'
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
logger
.
setLevel
(
level
=
logging
.
DEBUG
)
logger
.
setLevel
(
level
=
logging
.
DEBUG
)
...
@@ -47,7 +49,7 @@ logger.addHandler(hdlr=console_hdlr)
...
@@ -47,7 +49,7 @@ logger.addHandler(hdlr=console_hdlr)
file_hdlr
=
toolbox
.
create_file_handler
(
file
=
log_file_path
)
file_hdlr
=
toolbox
.
create_file_handler
(
file
=
log_file_path
)
logger
.
addHandler
(
hdlr
=
file_hdlr
)
logger
.
addHandler
(
hdlr
=
file_hdlr
)
path_tst
=
c
onfignator
.
get_option
(
section
=
'
paths
'
,
option
=
'
tst
'
)
path_tst
=
c
fg
.
get
(
section
=
'
paths
'
,
option
=
'
tst
'
)
def
apply_css
(
*
args
):
def
apply_css
(
*
args
):
...
@@ -146,8 +148,8 @@ class AppWindow(Gtk.ApplicationWindow):
...
@@ -146,8 +148,8 @@ class AppWindow(Gtk.ApplicationWindow):
self
.
box
.
pack_start
(
self
.
stat_bar
,
False
,
False
,
0
)
self
.
box
.
pack_start
(
self
.
stat_bar
,
False
,
False
,
0
)
# set the size (width and height) of the main window using the values of the configuration file
# set the size (width and height) of the main window using the values of the configuration file
height_from_config
=
c
onfignator
.
get_option
(
'
codereuse-preferences
'
,
'
main-window-height
'
)
height_from_config
=
c
fg
.
get
(
'
codereuse-preferences
'
,
'
main-window-height
'
)
width_from_config
=
c
onfignator
.
get_option
(
'
codereuse-preferences
'
,
'
main-window-width
'
)
width_from_config
=
c
fg
.
get
(
'
codereuse-preferences
'
,
'
main-window-width
'
)
if
height_from_config
is
not
None
and
width_from_config
is
not
None
:
if
height_from_config
is
not
None
and
width_from_config
is
not
None
:
self
.
resize
(
int
(
width_from_config
),
int
(
height_from_config
))
self
.
resize
(
int
(
width_from_config
),
int
(
height_from_config
))
else
:
else
:
...
@@ -530,13 +532,13 @@ class CBRSearch(Gtk.Box):
...
@@ -530,13 +532,13 @@ class CBRSearch(Gtk.Box):
self
.
right_click_menu
=
TreeRightClickMenu
(
cruf
=
self
)
self
.
right_click_menu
=
TreeRightClickMenu
(
cruf
=
self
)
# set the position of the Paned widget using the configuration file
# set the position of the Paned widget using the configuration file
paned_position
=
c
onfignator
.
get_option
(
'
codereuse-preferences
'
,
'
paned-position-search
'
)
paned_position
=
c
fg
.
get
(
'
codereuse-preferences
'
,
'
paned-position-search
'
)
self
.
set_paned_position
(
int
(
paned_position
))
self
.
set_paned_position
(
int
(
paned_position
))
# set the position of the paned of the widget self.codeblockreuse
# set the position of the paned of the widget self.codeblockreuse
paned_position_cc
=
c
onfignator
.
get_option
(
'
codereuse-preferences
'
,
'
paned-position-command-code
'
)
paned_position_cc
=
c
fg
.
get
(
'
codereuse-preferences
'
,
'
paned-position-command-code
'
)
self
.
set_code_view_pane_position
(
int
(
paned_position_cc
))
self
.
set_code_view_pane_position
(
int
(
paned_position_cc
))
# set teh position of the comment and vrc description windows
# set teh position of the comment and vrc description windows
paned_position_comment
=
c
onfignator
.
get_option
(
'
codereuse-preferences
'
,
'
paned-position-comment
'
)
paned_position_comment
=
c
fg
.
get
(
'
codereuse-preferences
'
,
'
paned-position-comment
'
)
self
.
set_comment_pane_position
(
int
(
paned_position_comment
))
self
.
set_comment_pane_position
(
int
(
paned_position_comment
))
self
.
show_all
()
self
.
show_all
()
...
@@ -986,11 +988,11 @@ class TreeRightClickMenu(Gtk.Menu):
...
@@ -986,11 +988,11 @@ class TreeRightClickMenu(Gtk.Menu):
def
run
(
file_path
=
None
):
def
run
(
file_path
=
None
):
bus_name
=
c
onfignator
.
get_option
(
'
dbus_names
'
,
'
log-viewer
'
)
bus_name
=
c
fg
.
get
(
'
dbus_names
'
,
'
log-viewer
'
)
dbus
.
validate_bus_name
(
bus_name
)
dbus
.
validate_bus_name
(
bus_name
)
if
file_path
is
None
:
if
file_path
is
None
:
confignator_log_file
=
c
onfignator
.
get_option
(
'
confignator-paths
'
,
'
log-file
'
)
confignator_log_file
=
c
fg
.
get
(
'
confignator-paths
'
,
'
log-file
'
)
if
os
.
path
.
isfile
(
confignator_log_file
):
if
os
.
path
.
isfile
(
confignator_log_file
):
file_path
=
confignator_log_file
file_path
=
confignator_log_file
...
...
This diff is collapsed.
Click to expand it.
Tst/codeblockreusefeature/codeblockreusefeature.cfg
+
1
−
1
View file @
1e989456
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
log-viewer
=
egse.tst.logviewer
log-viewer
=
egse.tst.logviewer
[codereuse-logging]
[codereuse-logging]
level
=
DEBU
G
level
=
WARNIN
G
log-file-path
=
${logging:log-dir}/codereuse/codereuse.log
log-file-path
=
${logging:log-dir}/codereuse/codereuse.log
[codereuse-filter]
[codereuse-filter]
...
...
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