summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2006-06-18 23:42:29 +0000
committerAlec Warner <antarus@gentoo.org>2006-06-18 23:42:29 +0000
commit605c793707dc54215de85fd9d1072811f1d1100d (patch)
tree85167a10ac18f98214d0cae0aee777db069ec5b4 /pym
parentf2b29ca07eb606ab15ad91781d8b5008af3c8aee (diff)
downloadportage-605c793707dc54215de85fd9d1072811f1d1100d.tar.gz
portage-605c793707dc54215de85fd9d1072811f1d1100d.tar.bz2
portage-605c793707dc54215de85fd9d1072811f1d1100d.zip
goodbye tokenize
svn path=/main/trunk/; revision=3533
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 8503ec198..d7fb000d0 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -317,52 +317,6 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis
starttime=long(time.time())
-def tokenize(mystring):
- """breaks a string like 'foo? (bar) oni? (blah (blah))'
- into embedded lists; returns None on paren mismatch"""
-
- # This function is obsoleted.
- # Use portage_dep.paren_reduce
-
- writemsg( output.red("!!! Tokenize is deprecated, please use portage_dep.paren_reduce.\n") )
-
- newtokens=[]
- curlist=newtokens
- prevlists=[]
- level=0
- accum=""
- for x in mystring:
- if x=="(":
- if accum:
- curlist.append(accum)
- accum=""
- prevlists.append(curlist)
- curlist=[]
- level=level+1
- elif x==")":
- if accum:
- curlist.append(accum)
- accum=""
- if level==0:
- writemsg("!!! tokenizer: Unmatched left parenthesis in:\n'"+str(mystring)+"'\n")
- return None
- newlist=curlist
- curlist=prevlists.pop()
- curlist.append(newlist)
- level=level-1
- elif x in string.whitespace:
- if accum:
- curlist.append(accum)
- accum=""
- else:
- accum=accum+x
- if accum:
- curlist.append(accum)
- if (level!=0):
- writemsg("!!! tokenizer: Exiting with unterminated parenthesis in:\n'"+str(mystring)+"'\n")
- return None
- return newtokens
-
def flatten(mytokens):
"""this function now turns a [1,[2,3]] list into
a [1,2,3] list and returns it."""