Exemple #1
0
 def build_url(self, path, _endpoint=None, **query):
     """Build the url for the specified object
     :param args segments: URI segments
     :param kwargs query: Query parameters
     :rtype str:
     """
     endpoint = _endpoint or self.endpoint
     return provider.build_url(endpoint, self.container, *path.split('/'), **query)
Exemple #2
0
 def build_url(self, *segments, _endpoint=None, **query):
     """Build the url for the specified object
     :param args segments: URI segments
     :param kwargs query: Query parameters
     :rtype str:
     """
     endpoint = _endpoint or self.endpoint
     return provider.build_url(endpoint, self.container, *segments, **query)
Exemple #3
0
 def _build_upload_url(self, *segments, **query):
     return provider.build_url(settings.BASE_UPLOAD_URL, *segments, **query)
Exemple #4
0
 def _build_content_url(self, *segments, **query):
     return provider.build_url(settings.BASE_CONTENT_URL, *segments,
                               **query)
 def build_view_url(self, *segments):
     segments = (self.owner, self.repo, 'blob') + segments
     return provider.build_url(settings.VIEW_URL, *segments)
 def _web_view(self, path):
     segments = (self.owner, self.repo, 'blob', path.branch_ref, path.path)
     return provider.build_url(pd_settings.VIEW_URL, *segments)
Exemple #7
0
 def _build_item_url(self, *segments, **query) -> str:
     return provider.build_url(settings.BASE_DRIVE_URL, 'items', *segments,
                               **query)
 def _web_view(self, path):
     segments = (self.owner, self.repo, 'blob', path.identifier[0], path.path)
     return provider.build_url(settings.VIEW_URL, *segments)
 def web_view(self):
     if self.is_public:
         segments = ('articles', str(self.article_id))
     else:
         segments = ('account', 'articles', str(self.article_id))
     return build_url(settings.VIEW_URL, *segments)
Exemple #10
0
 def _build_drive_url(self, *segments, **query) -> str:
     return provider.build_url(settings.BASE_DRIVE_URL, *segments, **query)
 def _build_item_url(self, *segments, **query) -> str:
     return provider.build_url(settings.BASE_DRIVE_URL, 'items', *segments, **query)
 def _build_drive_url(self, *segments, **query) -> str:
     return provider.build_url(settings.BASE_DRIVE_URL, *segments, **query)
Exemple #13
0
 def web_view(self):
     segments = ('articles', self.parent['title'], str(self.article_id))
     return build_url(settings.VIEW_URL, *segments)
Exemple #14
0
 def _web_view(self, path):
     segments = (self.owner, self.repo, 'blob', path.branch_ref, path.path)
     return provider.build_url(settings.VIEW_URL, *segments)
Exemple #15
0
 def web_view(self):
     segments = ('articles', self.parent['title'], str(self.article_id))
     return build_url(settings.VIEW_URL, *segments)
Exemple #16
0
 def _build_upload_url(self, *segments, **query):
     return provider.build_url(settings.BASE_UPLOAD_URL, *segments, **query)
Exemple #17
0
 def web_view(self):
     if self.is_public:
         segments = ("articles", str(self.article_id))
     else:
         segments = ("account", "articles", str(self.article_id))
     return build_url(settings.VIEW_URL, *segments)
 def _build_content_url(self, *segments, **query):
     return provider.build_url(settings.BASE_CONTENT_URL, *segments, **query)
Exemple #19
0
 def web_view(self):
     if self.parent['status'].lower() == 'public':
         segments = ('articles', self.parent['title'], str(self.article_id))
     else:
         segments = ('account', 'articles', str(self.article_id))
     return build_url(settings.VIEW_URL, *segments)