Skip to content

Commit

Permalink
Uses Python 3 syntax (#554)
Browse files Browse the repository at this point in the history
This is a follow up for:
#553
- updates `super()` syntax
- removes `object` inheritance
- removes `from __future__ import unicode_literals`
  • Loading branch information
AndreMiras authored Apr 10, 2020
1 parent 5fb013c commit 11b6b4b
Show file tree
Hide file tree
Showing 87 changed files with 125 additions and 133 deletions.
2 changes: 1 addition & 1 deletion examples/accelerometer/basic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class AccelerometerTest(BoxLayout):
def __init__(self):
super(AccelerometerTest, self).__init__()
super().__init__()
self.sensorEnabled = False

def do_toggle(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Graph(Widget):
_ticks_minory = ListProperty([])

def __init__(self, **kwargs):
super(Graph, self).__init__(**kwargs)
super().__init__(**kwargs)

self._mesh = Mesh(mode='lines')
self._mesh_rect = Mesh(mode='line_strip')
Expand Down Expand Up @@ -768,7 +768,7 @@ class MeshLinePlot(Plot):
def __init__(self, **kwargs):
self._color = Color(1, 1, 1, group='LinePlot%d' % id(self))
self._mesh = Mesh(mode='line_strip', group='LinePlot%d' % id(self))
super(MeshLinePlot, self).__init__(**kwargs)
super().__init__(**kwargs)

self._trigger = Clock.create_trigger(self._redraw)
self.bind(_params=self._trigger, points=self._trigger)
Expand Down
2 changes: 1 addition & 1 deletion examples/accelerometer/using_graph/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class AccelerometerDemo(BoxLayout):
def __init__(self):
super(AccelerometerDemo, self).__init__()
super().__init__()

self.sensorEnabled = False
self.graph = self.ids.graph_plot
Expand Down
6 changes: 3 additions & 3 deletions examples/camera/basic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class CameraDemo(FloatLayout):
def __init__(self):
super(CameraDemo, self).__init__()
super().__init__()
self.cwd = getcwd() + "/"
self.ids.path_label.text = self.cwd

Expand Down Expand Up @@ -50,7 +50,7 @@ def camera_callback(self, filepath):

class CameraDemoApp(App):
def __init__(self):
super(CameraDemoApp, self).__init__()
super().__init__()
self.demo = None

def build(self):
Expand All @@ -66,7 +66,7 @@ def on_resume(self):

class MsgPopup(Popup):
def __init__(self, msg):
super(MsgPopup, self).__init__()
super().__init__()
self.ids.message_label.text = msg


Expand Down
1 change: 0 additions & 1 deletion examples/filechooser/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Example of an Android filechooser.
'''

from __future__ import unicode_literals
from textwrap import dedent

from plyer import filechooser
Expand Down
2 changes: 1 addition & 1 deletion examples/gravity/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

class GravityInterface(BoxLayout):
def __init__(self):
super(GravityInterface, self).__init__()
super().__init__()
self.sensorEnabled = False

def do_toggle(self):
Expand Down
2 changes: 1 addition & 1 deletion examples/wifi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def show_wifi_scans(self):
for name in wifi_scans:
content = ""
items = wifi._get_network_info(name)
for key, value in items.iteritems():
for key, value in items.items():
content += "{}: {} \n".format(key, value)

popup = self._create_popup(name, content)
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'''


class Accelerometer(object):
class Accelerometer:
'''
Accelerometer facade.
'''
Expand Down
4 changes: 2 additions & 2 deletions plyer/facades/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'''


class Audio(object):
class Audio:
'''
Audio facade.
'''
Expand All @@ -55,7 +55,7 @@ class Audio(object):
_file_path = ''

def __init__(self, file_path=None):
super(Audio, self).__init__()
super().__init__()
self._file_path = file_path or self._file_path

def start(self):
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/barometer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Barometer(object):
class Barometer:
'''Barometer facade.
Barometer sensor is used to measure the ambient air pressure in hPa.
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'''


class Battery(object):
class Battery:
'''
Battery info facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'''


class Bluetooth(object):
class Bluetooth:
'''
Bluetooth facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'''


class Brightness(object):
class Brightness:
'''
Brightness facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'''


class Call(object):
class Call:
'''
Call facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'''


class Camera(object):
class Camera:
'''
Camera facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/compass.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'''


class Compass(object):
class Compass:
'''Compass facade.
.. versionadded:: 1.2.0
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'''


class CPU(object):
class CPU:
'''
Facade providing info about sockets, physical and logical
number of processors.
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'''


class Email(object):
class Email:
'''
Email facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/filechooser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'''


class FileChooser(object):
class FileChooser:
'''
File Chooser facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'''


class Flash(object):
class Flash:
"""
Flash facade.
"""
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def print_locations(**kwargs):
'''


class GPS(object):
class GPS:
'''
GPS facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/gravity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Gravity(object):
class Gravity:
'''Gravity facade.
.. versionadded:: 1.2.5
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/gyroscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'''


class Gyroscope(object):
class Gyroscope:
'''
Gyroscope facade.
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/humidity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Humidity(object):
class Humidity:
'''Humidity facade.
Humidity sensor returns value of humidity.
With method `enable` you can turn on Humidity sensor and
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/irblaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'''


class IrBlaster(object):
class IrBlaster:
'''
Infrared blaster facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/keystore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Keystore(object):
class Keystore:
'''
Keyring facade
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Light(object):
class Light:
'''Light facade.
Light sensor measures the ambient light level(illumination) in lx.
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'''


class Notification(object):
class Notification:
'''
Notification facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/orientation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'''


class Orientation(object):
class Orientation:
'''
Orientation facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'''


class Processors(object):
class Processors:
'''
Number of Processors info facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/proximity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Proximity(object):
class Proximity:
'''Proximity facade.
The proximity sensor is commonly used to determine distance whether
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'''


class Screenshot(object):
class Screenshot:
'''
Screenshot facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'''


class Sms(object):
class Sms:
'''
Sms facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/spatialorientation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8


class SpatialOrientation(object):
class SpatialOrientation:
'''Spatial Orientation facade.
Computes the device's orientation based on the rotation matrix.
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/storagepath.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'''


class StoragePath(object):
class StoragePath:
'''
StoragePath facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
'''


class STT(object):
class STT:
'''
Speech to text facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/temperature.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8


class Temperature(object):
class Temperature:
'''Temperature facade.
Temperature sensor is used to measure the ambient room temperature in
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'''


class TTS(object):
class TTS:
'''
TextToSpeech facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/uniqueid.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
'''


class UniqueID(object):
class UniqueID:
'''
UniqueID facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/vibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'''


class Vibrator(object):
class Vibrator:
'''
Vibration facade.
'''
Expand Down
2 changes: 1 addition & 1 deletion plyer/facades/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'''


class Wifi(object):
class Wifi:
'''
Wifi Facade.
'''
Expand Down
Loading

0 comments on commit 11b6b4b

Please sign in to comment.