From 90a279863867188ea9301ae7db40f41858a7e73d Mon Sep 17 00:00:00 2001 From: Mike Druger Date: Fri, 7 Mar 2014 15:56:41 -0500 Subject: [PATCH] aweber_api: code std update for entry class code std update for entry class --- aweber_api/entry.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/aweber_api/entry.py b/aweber_api/entry.py index 7003345..f716338 100644 --- a/aweber_api/entry.py +++ b/aweber_api/entry.py @@ -142,35 +142,11 @@ def get_parent_entry(self): if url_parts is None: return None - url = self._remove_collection_id_from_url(url_parts) + url = self._construct_parent_url(url_parts, 2) data = self.adapter.request('GET', url) return AWeberEntry(url, data, self.adapter) - def _partition_url(self): - """Partition the url into segments.""" - try: - url_parts = self.url.split('/') - #If top of tree - no parent entry - if len(url_parts) <= 3: - return None - - except Exception: - return None - - return url_parts - - def _remove_collection_id_from_url(self, url_parts): - """Remove collection id and slash from end of url.""" - url = '' - # construct the url string from the url_parts list - for i in range(len(url_parts) - 2): - url = '{0}{1}/'.format(url, url_parts[i]) - # remove the trailing slash - url = url[:len(url) - 1] - - return url - def get_web_forms(self): self._method_for('account') data = self.adapter.request(