Skip to content

Commit f5c0afa

Browse files
committed
Confluence: Add splitter of classes
1 parent b08a969 commit f5c0afa

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

atlassian/confluence/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ class Confluence(ConfluenceBase):
1717
"""Legacy Confluence class for backward compatibility."""
1818

1919
def __init__(self, url, *args, **kwargs):
20-
# Auto-detect if it's cloud or server based on URL
20+
# Detect which implementation to use
2121
if ("atlassian.net" in url or "jira.com" in url) and ("/wiki" not in url):
22-
if "cloud" not in kwargs:
23-
kwargs["cloud"] = True
24-
super().__init__(url, *args, **kwargs)
22+
impl = ConfluenceCloud(url, *args, **kwargs)
23+
else:
24+
impl = ConfluenceServer(url, *args, **kwargs)
25+
self._impl = impl
26+
27+
def __getattr__(self, attr):
28+
# Delegate all unknown attributes to the true client
29+
return getattr(self._impl, attr)
2530

2631

2732
__all__ = [

atlassian/confluence/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,4 @@ def raise_for_status(self, response):
184184
else:
185185
raise HTTPError(error_msg, response=response)
186186
else:
187-
response.raise_for_status()
187+
response.raise_for_status()

atlassian/confluence/server/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(self, url, *args, **kwargs):
2424
"""
2525
super(ConfluenceServerBase, self).__init__(url, *args, **kwargs)
2626

27-
2827
def _get_paged(
2928
self,
3029
url,

0 commit comments

Comments
 (0)