Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
I3csstatus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
I3csstatus
Commits
5ac02fa4
Commit
5ac02fa4
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Change Module.Init api: Remove ConfigParser
ConfigParser is available via ConfigSection.
parent
11fcd08b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Program.cs
+7
-7
7 additions, 7 deletions
Program.cs
with
7 additions
and
7 deletions
Program.cs
+
7
−
7
View file @
5ac02fa4
...
...
@@ -89,14 +89,14 @@ namespace i3csstatus {
interface
Module
{
IEnumerable
<
Element
>
Get
();
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
);
void
Init
(
StatusBar
_bar
,
ConfigSection
section
);
}
[
ModuleName
(
"constant"
)]
class
ModuleConstant
:
Module
{
string
text
;
Color
color
;
public
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
)
public
void
Init
(
StatusBar
_bar
,
ConfigSection
section
)
{
text
=
section
.
Mandatory
(
"text"
);
color
=
section
?[
"color"
]?.
AsColor
()
??
System
.
Drawing
.
ColorTranslator
.
FromHtml
(
"white"
);
...
...
@@ -113,7 +113,7 @@ namespace i3csstatus {
InnerStatusBar
ifNotFound
;
InnerStatusBar
ifReadError
;
Parser
parser
;
public
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
)
public
void
Init
(
StatusBar
_bar
,
ConfigSection
section
)
{
path
=
section
.
Mandatory
(
"path"
).
AsPath
();
ifNotFound
=
new
InnerStatusBar
(
_bar
,
section
.
Optional
(
"not_found_handler"
)?.
AsConfig
()
??
...
...
@@ -166,7 +166,7 @@ text = ERR
int
scheudleIn_ms
;
bool
pipeError
=
false
;
Parser
parser
;
public
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
)
public
void
Init
(
StatusBar
_bar
,
ConfigSection
section
)
{
bar
=
_bar
;
path
=
section
.
Mandatory
(
"path"
).
AsPath
();
...
...
@@ -258,7 +258,7 @@ text = ERR
int
maxOld_ms
;
int
showOld_ms
;
int
timeout_ms
;
public
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
)
public
void
Init
(
StatusBar
_bar
,
ConfigSection
section
)
{
bar
=
_bar
;
url
=
section
.
Mandatory
(
"url"
).
AsString
();
...
...
@@ -429,7 +429,7 @@ text = ERR
}
}
}
public
void
Init
(
StatusBar
_bar
,
ConfigParser
config
,
ConfigSection
section
)
public
void
Init
(
StatusBar
_bar
,
ConfigSection
section
)
{
name
=
section
[
"name"
];
configuration
=
section
.
Optional
(
"config"
)?.
AsString
();
...
...
@@ -480,7 +480,7 @@ text = ERR
if
(
constructor
==
null
)
throw
new
Exception
(
$"Missing constructor of
{
type
}
module"
);
Module
module
=
(
Module
)
constructor
.
Invoke
(
new
object
[]{});
module
.
Init
(
this
,
p
,
s
);
module
.
Init
(
this
,
s
);
modules
.
Add
(
module
);
}
}
...
...
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