Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of 0 and 1 with False and True, where appropriate. #993

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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