Skip to content

Commit

Permalink
Replace uses of 0 and 1 with False and True, where appropriate. (#993)
Browse files Browse the repository at this point in the history
Note that in some cases there are more modern idioms that might be used,
but fixing those is for another PR.
  • Loading branch information
corranwebster committed Apr 18, 2023
1 parent 6135fea commit 03bb941
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions kiva/basecore2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,14 @@ def is_path_empty(self):
""" Tests to see whether the current drawing path is empty
"""
# If the first subpath is empty, then the path is empty
res = 0
res = False
if not self.path[0]:
res = 1
res = True
else:
res = 1
res = True
for sub in self.path:
if not is_point(sub[-1]):
res = 0
res = False
break
return res

Expand Down
4 changes: 2 additions & 2 deletions kiva/line_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def exactly_equal(arr1, arr2):

def is_dashed(dash):
# if all the values in the dash settings are 0, then it is a solid line.
result = 0
result = False
if dash is not None and sometrue(asarray(dash[1]) != 0):
result = 1
result = True
return result


Expand Down
4 changes: 2 additions & 2 deletions kiva/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def default_filter(kw1):
import reportlab.pdfbase.pdfmetrics as pdfmetrics
import reportlab.pdfbase._fontdata as _fontdata

_reportlab_loaded = 1
_reportlab_loaded = True
except ImportError:
# we support the basic 14
from . import _fontdata
from . import pdfmetrics

_reportlab_loaded = 0
_reportlab_loaded = False

font_face_map = {"Arial": "Helvetica", "": "Helvetica"}

Expand Down
4 changes: 2 additions & 2 deletions kiva/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ def default_filter(kw1):
import reportlab.pdfbase.pdfmetrics as pdfmetrics
import reportlab.pdfbase._fontdata as _fontdata

_reportlab_loaded = 1
_reportlab_loaded = True
except ImportError:
from . import pdfmetrics
from . import _fontdata

_reportlab_loaded = 0
_reportlab_loaded = False


# This backend has no compiled path object, yet.
Expand Down
2 changes: 1 addition & 1 deletion kiva/tests/test_quartz.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def OnPaint(self, evt):
class MyApp(wx.App):
def OnInit(self):
SimpleWindow()
return 1
return True

app = MyApp(False)
app.MainLoop()
Expand Down
2 changes: 1 addition & 1 deletion kiva/trait_defs/ui/wx/kiva_font_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def to_wx_font(self, editor):
family,
style,
weight,
(font.underline != 0),
font.underline,
self.face_name(font),
)

Expand Down

0 comments on commit 03bb941

Please sign in to comment.