mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
dictclient: remove overly complex dequote method
This commit is contained in:
parent
989ac5ee97
commit
0e1e37a5a2
@ -20,15 +20,10 @@ import socket, re
|
|||||||
|
|
||||||
version = '1.0'
|
version = '1.0'
|
||||||
|
|
||||||
def dequote(str):
|
def dequote(s):
|
||||||
"""Will remove single or double quotes from the start and end of a string
|
"""Will remove single or double quotes from the start and end of a string
|
||||||
and return the result."""
|
and return the result."""
|
||||||
quotechars = "'\""
|
return s.strip("'\"")
|
||||||
while len(str) and str[0] in quotechars:
|
|
||||||
str = str[1:]
|
|
||||||
while len(str) and str[-1] in quotechars:
|
|
||||||
str = str[0:-1]
|
|
||||||
return str
|
|
||||||
|
|
||||||
def enquote(str):
|
def enquote(str):
|
||||||
"""This function will put a string in double quotes, properly
|
"""This function will put a string in double quotes, properly
|
||||||
|
Loading…
Reference in New Issue
Block a user