Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9337068
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/swh/journal/writer/__init__.py b/swh/journal/writer/__init__.py
index 7540c40..bd12467 100644
--- a/swh/journal/writer/__init__.py
+++ b/swh/journal/writer/__init__.py
@@ -1,20 +1,28 @@
# Copyright (C) 2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
+import warnings
+
+
+def get_journal_writer(cls, **kwargs):
+ if 'args' in kwargs:
+ warnings.warn(
+ 'Explicit "args" key is deprecated, use keys directly instead.',
+ DeprecationWarning)
+ kwargs = kwargs['args']
-def get_journal_writer(cls, args={}):
if cls == 'inmemory': # FIXME: Remove inmemory in due time
import warnings
warnings.warn("cls = 'inmemory' is deprecated, use 'memory' instead",
DeprecationWarning)
cls = 'memory'
if cls == 'memory':
from .inmemory import InMemoryJournalWriter as JournalWriter
elif cls == 'kafka':
from .kafka import KafkaJournalWriter as JournalWriter
else:
raise ValueError('Unknown journal writer class `%s`' % cls)
- return JournalWriter(**args)
+ return JournalWriter(**kwargs)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Jul 4 2025, 7:51 AM (10 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3276080
Attached To
rDJNL Journal infrastructure
Event Timeline
Log In to Comment