Skip to content

Commit

Permalink
Merge pull request #711 from misl6/fix/fixes-some-E275
Browse files Browse the repository at this point in the history
Fixes some E275. + other minor PEP8 fixes
  • Loading branch information
akshayaurora authored Oct 2, 2022
2 parents 9663f3d + 2d38bc1 commit 924e406
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/accelerometer/using_graph/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def get_acceleration(self, dt):
# We re-write our points list if number of values exceed 100.
# ie. Move each timestamp to the left.
for plot in self.plot:
del(plot.points[0])
del plot.points[0]
plot.points[:] = [(i[0] - 1, i[1]) for i in plot.points[:]]

self.counter = 99

val = accelerometer.acceleration[:3]

if(not val == (None, None, None)):
if not val == (None, None, None):
self.plot[0].points.append((self.counter, val[0]))
self.plot[1].points.append((self.counter, val[1]))
self.plot[2].points.append((self.counter, val[2]))
Expand Down
4 changes: 2 additions & 2 deletions examples/camera/basic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):
def do_capture(self):
filepath = self.cwd + self.ids.filename_text.text

if(exists(filepath)):
if exists(filepath):
popup = MsgPopup("Picture with this name already exists!")
popup.open()
return False
Expand All @@ -40,7 +40,7 @@ def do_capture(self):
popup.open()

def camera_callback(self, filepath):
if(exists(filepath)):
if exists(filepath):
popup = MsgPopup("Picture saved!")
popup.open()
else:
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/humidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Humidity:
With method `enable` you can turn on Humidity sensor and
'disable' method stops the sensor.
Use property `tell` to get humidity value.
Supported Platforms
-------------------
Android
Expand Down
2 changes: 1 addition & 1 deletion plyer/platforms/android/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get_acceleration(self):
return (None, None, None)

def __del__(self):
if(self.bState):
if self.bState:
self._disable()
super().__del__()

Expand Down
4 changes: 2 additions & 2 deletions plyer/platforms/android/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class AndroidCamera(Camera):

def _take_picture(self, on_complete, filename=None):
assert(on_complete is not None)
assert on_complete is not None
self.on_complete = on_complete
self.filename = filename
android.activity.unbind(on_activity_result=self._on_activity_result)
Expand All @@ -26,7 +26,7 @@ def _take_picture(self, on_complete, filename=None):
activity.startActivityForResult(intent, 0x123)

def _take_video(self, on_complete, filename=None):
assert(on_complete is not None)
assert on_complete is not None
self.on_complete = on_complete
self.filename = filename
android.activity.unbind(on_activity_result=self._on_activity_result)
Expand Down
2 changes: 1 addition & 1 deletion plyer/platforms/android/compass.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _get_field_uncalib(self):
return (None, None, None, None, None, None)

def __del__(self):
if(self.bState):
if self.bState:
self._disable()
super().__del__()

Expand Down
2 changes: 1 addition & 1 deletion plyer/platforms/android/gyroscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _get_rotation_uncalib(self):
return (None, None, None, None, None, None)

def __del__(self):
if(self.bState):
if self.bState:
self._disable()
super().__del__()

Expand Down
4 changes: 2 additions & 2 deletions plyer/platforms/ios/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def photos(self):
return PhotosLibrary()

def _take_picture(self, on_complete, filename=None):
assert(on_complete is not None)
assert on_complete is not None
self.on_complete = on_complete
self.filename = filename
photos = self.photos
Expand All @@ -38,7 +38,7 @@ def capture_callback(self, photolibrary):
self._remove(self.filename)

def _take_video(self, on_complete, filename=None):
assert(on_complete is not None)
assert on_complete is not None
raise NotImplementedError

def _remove(self, fn):
Expand Down
2 changes: 1 addition & 1 deletion plyer/platforms/ios/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _set_locale(self, locale="en-US"):
def _speak(self, **kwargs):
message = kwargs.get('message')

if(not self.voice):
if not self.voice:
self._set_locale()

utterance = \
Expand Down
4 changes: 2 additions & 2 deletions plyer/platforms/macosx/libs/osx_motion_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def read_sms():
inStructure = data_structure()
outStructure = data_structure()

if(is_os_64bit() or hasattr(IOKit, 'IOConnectCallStructMethod')):
if is_os_64bit() or hasattr(IOKit, 'IOConnectCallStructMethod'):
structureInSize = IOItemCount(sizeof(data_structure))
structureOutSize = c_size_t(sizeof(data_structure))

Expand Down Expand Up @@ -120,7 +120,7 @@ def get_coord():
ret, data = read_sms()

if (ret > 0):
if(data.x):
if data.x:
return (data.x, data.y, data.z)
else:
return (None, None, None)
Expand Down

0 comments on commit 924e406

Please sign in to comment.