diff options
author | BonfaceKilz | 2020-08-19 02:05:05 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-08-19 02:34:39 +0300 |
commit | bafbb5b7a4b7db2ca230f292eb45be7e67985259 (patch) | |
tree | a8ef159bec1b71daf21f9eb7907e12e9abfd7baf | |
parent | 06edbb8455f1e85a3818c33c4ef4d42e6a061d43 (diff) | |
download | genenetwork2-bafbb5b7a4b7db2ca230f292eb45be7e67985259.tar.gz |
Remove erroneous `if .. else` branch
* wqflask/utility/svg.py [roct, ellipse, SVGelement]: Raise only a single value error
if either height or width is not defined. Fixes parsing error when running
`2to3-3.8 -f apply -w .`
-rw-r--r-- | wqflask/utility/svg.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/wqflask/utility/svg.py b/wqflask/utility/svg.py index c850feb8..d66c954e 100644 --- a/wqflask/utility/svg.py +++ b/wqflask/utility/svg.py @@ -445,12 +445,8 @@ class rect(SVGelement): def __init__(self, x=None, y=None, width=None, height=None, fill=None, stroke=None, stroke_width=None, **args): if width == None or height == None: - raise ValueError, 'height is required' - raise ValueError, 'width is required' - if width!=None: - if height!=None: - else: - raise ValueError, 'both height and width are required' + raise ValueError, 'both height and width are required' + SVGelement.__init__(self,'rect',{'width':width,'height':height},**args) if x!=None: self.attributes['x']=x @@ -470,12 +466,8 @@ class ellipse(SVGelement): """ def __init__(self,cx=None,cy=None,rx=None,ry=None,fill=None,stroke=None,stroke_width=None,**args): if rx==None or ry== None: - raise ValueError, 'rx is required' - raise ValueError, 'ry is required' - if rx!=None: - if ry!=None: - else: - raise ValueError, 'both rx and ry are required' + raise ValueError, 'both rx and ry are required' + SVGelement.__init__(self,'ellipse',{'rx':rx,'ry':ry},**args) if cx!=None: self.attributes['cx']=cx @@ -722,12 +714,7 @@ class image(SVGelement): """ def __init__(self,url,x=None,y=None,width=None,height=None,**args): if width==None or height==None: - raise ValueError, 'height is required' - raise ValueError, 'width is required' - if width!=None: - if height!=None: - else: - raise ValueError, 'both height and width are required' + raise ValueError, 'both height and width are required' SVGelement.__init__(self,'image',{'xlink:href':url,'width':width,'height':height},**args) if x!=None: self.attributes['x']=x |