summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-12 08:27:31 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-12 08:27:31 +0000
commit7415a0972e5544e92885331b957135b85ac43c33 (patch)
treebca0557a6700aab03f613484888ffac5d86de953 /pym/getbinpkg.py
parentMore String deprecation (diff)
downloadportage-multirepo-7415a0972e5544e92885331b957135b85ac43c33.tar.gz
portage-multirepo-7415a0972e5544e92885331b957135b85ac43c33.tar.bz2
portage-multirepo-7415a0972e5544e92885331b957135b85ac43c33.zip
Use startswith and endswith to simplify code.
svn path=/main/trunk/; revision=5598
Diffstat (limited to 'pym/getbinpkg.py')
-rw-r--r--pym/getbinpkg.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py
index 7067eefd..40f3c642 100644
--- a/pym/getbinpkg.py
+++ b/pym/getbinpkg.py
@@ -6,7 +6,7 @@
if not hasattr(__builtins__, "set"):
from sets import Set as set
-from output import *
+#from output import *
import htmllib,HTMLParser,formatter,sys,os,xpak,time,tempfile,base64,urllib2
try:
@@ -50,7 +50,7 @@ class ParseLinks(HTMLParser.HTMLParser):
def get_anchors_by_prefix(self,prefix):
newlist = []
for x in self.PL_anchors:
- if (len(x) >= len(prefix)) and (x[:len(suffix)] == prefix):
+ if x.startswith(prefix):
if x not in newlist:
newlist.append(x[:])
return newlist
@@ -58,7 +58,7 @@ class ParseLinks(HTMLParser.HTMLParser):
def get_anchors_by_suffix(self,suffix):
newlist = []
for x in self.PL_anchors:
- if (len(x) >= len(suffix)) and (x[-len(suffix):] == suffix):
+ if x.endswith(prefix):
if x not in newlist:
newlist.append(x[:])
return newlist