Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions atlassian/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
class Bitbucket(AtlassianRestAPI):
bulk_headers = {"Content-Type": "application/vnd.atl.bitbucket.bulk+json"}

def __init__(self, *args, **kwargs):
super(Bitbucket, self).__init__(*args, **kwargs)
url = kwargs.pop('url', False)
if url and 'bitbucket.org' in url:
self.cloud = True
def __init__(self, url, *args, **kwargs):
if (not 'cloud' in kwargs
and ('bitbucket.org' in url) ):
kwargs['cloud'] = True
super(Bitbucket, self).__init__(url, *args, **kwargs)

def project_list(self, limit=None):
"""
Expand Down
9 changes: 9 additions & 0 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ class Confluence(AtlassianRestAPI):
".svg": "image/svg+xml"
}

def __init__(self, url, *args, **kwargs):
if (('atlassian.net' in url or 'jira.com' in url)
and ('/wiki' not in url) ):
url = AtlassianRestAPI.url_joiner(url, '/wiki')
if not 'cloud' in kwargs:
kwargs['cloud'] = True
super(Confluence, self).__init__(url, *args, **kwargs)


@staticmethod
def _create_body(body, representation):
if representation not in ['editor', 'export_view', 'view', 'storage', 'wiki']:
Expand Down
4 changes: 0 additions & 4 deletions atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ class AtlassianRestAPI(object):
def __init__(self, url, username=None, password=None, timeout=60, api_root='rest/api', api_version='latest',
verify_ssl=True, session=None, oauth=None, cookies=None, advanced_mode=None, kerberos=None,
cloud=False, proxies=None):
if ('atlassian.net' in url or 'jira.com' in url) \
and '/wiki' not in url \
and self.__class__.__name__ in 'Confluence':
url = self.url_joiner(url, '/wiki')
self.url = url
self.username = username
self.password = password
Expand Down