Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
dd4f26e3
Commit
dd4f26e3
authored
Jul 14, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed Singleton decorator - backward compatibility
parent
37be48b0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
20 deletions
+3
-20
debomatic-modules/JSONLogger.py
debomatic-modules/JSONLogger.py
+3
-20
No files found.
debomatic-modules/JSONLogger.py
View file @
dd4f26e3
...
@@ -35,7 +35,7 @@ from collections import defaultdict
...
@@ -35,7 +35,7 @@ from collections import defaultdict
# as first and as last one for pre_* and post_* hooks
# as first and as last one for pre_* and post_* hooks
class
DebomaticModule_00_JSONLogger
:
class
DebomaticModule_00_JSONLogger
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
logger
=
JSONLogger
.
Instance
()
self
.
logger
=
DebomaticModule_JSONLogger
()
def
pre_chroot
(
self
,
args
):
def
pre_chroot
(
self
,
args
):
self
.
logger
.
pre_chroot
(
args
)
self
.
logger
.
pre_chroot
(
args
)
...
@@ -46,7 +46,7 @@ class DebomaticModule_00_JSONLogger:
...
@@ -46,7 +46,7 @@ class DebomaticModule_00_JSONLogger:
class
DebomaticModule_ZZ_JSONLogger
:
class
DebomaticModule_ZZ_JSONLogger
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
logger
=
JSONLogger
.
Instance
()
self
.
logger
=
DebomaticModule_JSONLogger
()
def
post_chroot
(
self
,
args
):
def
post_chroot
(
self
,
args
):
self
.
logger
.
post_chroot
(
args
)
self
.
logger
.
post_chroot
(
args
)
...
@@ -55,25 +55,8 @@ class DebomaticModule_ZZ_JSONLogger:
...
@@ -55,25 +55,8 @@ class DebomaticModule_ZZ_JSONLogger:
self
.
logger
.
post_build
(
args
)
self
.
logger
.
post_build
(
args
)
# Singleton decorator
class
Singleton
:
def
__init__
(
self
,
decorated
):
self
.
_decorated
=
decorated
def
Instance
(
self
):
try
:
return
self
.
_instance
except
AttributeError
:
self
.
_instance
=
self
.
_decorated
()
return
self
.
_instance
def
__call__
(
self
):
raise
TypeError
(
'Singletons must be accessed through `Instance()`.'
)
# The real JSONLogger Class
# The real JSONLogger Class
@
Singleton
class
DebomaticModule_JSONLogger
:
class
JSONLogger
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
jsonfile
=
'/var/log/debomatic-json.log'
self
.
jsonfile
=
'/var/log/debomatic-json.log'
...
...
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