From 5baa725885522370f7682e0962f26416165b2cb7 Mon Sep 17 00:00:00 2001 From: lyon1998 Date: Thu, 7 Apr 2022 22:57:59 +0800 Subject: [PATCH] update PikaStdDevice, use 'self' arg --- package/PikaStdDevice/PikaStdDevice.py | 148 +++++++++--------- .../linux/package/pikascript/PikaStdDevice.py | 148 +++++++++--------- port/linux/pkg-push.sh | 8 +- 3 files changed, 152 insertions(+), 152 deletions(-) diff --git a/package/PikaStdDevice/PikaStdDevice.py b/package/PikaStdDevice/PikaStdDevice.py index eef40e631..58481ce7c 100644 --- a/package/PikaStdDevice/PikaStdDevice.py +++ b/package/PikaStdDevice/PikaStdDevice.py @@ -2,255 +2,255 @@ from PikaObj import * class GPIO(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPin(pinName: str): + def setPin(self, pinName: str): pass - def setId(id: int): + def setId(self, id: int): pass - def getId() -> int: + def getId(self) -> int: pass - def getPin() -> str: + def getPin(self) -> str: pass - def setMode(mode: str): + def setMode(self, mode: str): pass - def getMode() -> str: + def getMode(self) -> str: pass - def setPull(pull: str): + def setPull(self, pull: str): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def high(): + def high(self): pass - def low(): + def low(self): pass - def read() -> int: + def read(self) -> int: pass # need be overrid - def platformHigh(): + def platformHigh(self): pass # need override - def platformLow(): + def platformLow(self): pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformDisable(): + def platformDisable(self): pass # need override - def platformSetMode(): + def platformSetMode(self): pass # need override - def platformRead(): + def platformRead(self): pass class Time(TinyObj): # need override - def sleep_s(s: int): + def sleep_s(self, s: int): pass # need override - def sleep_ms(ms: int): + def sleep_ms(self, ms: int): pass class ADC(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPin(pin: str): + def setPin(self, pin: str): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def read() -> float: + def read(self) -> float: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class UART(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setBaudRate(baudRate: int): + def setBaudRate(self, baudRate: int): pass - def setId(id: int): + def setId(self, id: int): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def write(data: str): + def write(self, data: str): pass - def read(length: int) -> str: + def read(self, length: int) -> str: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformWrite(): + def platformWrite(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class IIC(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPinSCL(pin: str): + def setPinSCL(self, pin: str): pass - def setPinSDA(pin: str): + def setPinSDA(self, pin: str): pass - def setDeviceAddr(addr: int): + def setDeviceAddr(self, addr: int): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def write(addr: int, data: str): + def write(self, addr: int, data: str): pass - def read(addr: int, length: int) -> str: + def read(self, addr: int, length: int) -> str: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformWrite(): + def platformWrite(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class PWM(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setName(name: str): + def setName(self, name: str): pass - def getName() -> str: + def getName(self) -> str: pass - def setChannel(ch: int): + def setChannel(self, ch: int): pass - def getChannel() -> int: + def getChannel(self) -> int: pass - def setPin(pin: str): + def setPin(self, pin: str): pass - def setFrequency(freq: int): + def setFrequency(self, freq: int): pass - def setFreq(freq: int): + def setFreq(self, freq: int): pass - def setDuty(duty: float): + def setDuty(self, duty: float): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def getFrequency() -> int: + def getFrequency(self) -> int: pass - def getDuty() -> float: + def getDuty(self) -> float: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformSetFrequency(): + def platformSetFrequency(self): pass # need override - def platformSetDuty(): + def platformSetDuty(self): pass # need override - def platformDisable(): + def platformDisable(self): pass diff --git a/port/linux/package/pikascript/PikaStdDevice.py b/port/linux/package/pikascript/PikaStdDevice.py index eef40e631..58481ce7c 100644 --- a/port/linux/package/pikascript/PikaStdDevice.py +++ b/port/linux/package/pikascript/PikaStdDevice.py @@ -2,255 +2,255 @@ from PikaObj import * class GPIO(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPin(pinName: str): + def setPin(self, pinName: str): pass - def setId(id: int): + def setId(self, id: int): pass - def getId() -> int: + def getId(self) -> int: pass - def getPin() -> str: + def getPin(self) -> str: pass - def setMode(mode: str): + def setMode(self, mode: str): pass - def getMode() -> str: + def getMode(self) -> str: pass - def setPull(pull: str): + def setPull(self, pull: str): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def high(): + def high(self): pass - def low(): + def low(self): pass - def read() -> int: + def read(self) -> int: pass # need be overrid - def platformHigh(): + def platformHigh(self): pass # need override - def platformLow(): + def platformLow(self): pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformDisable(): + def platformDisable(self): pass # need override - def platformSetMode(): + def platformSetMode(self): pass # need override - def platformRead(): + def platformRead(self): pass class Time(TinyObj): # need override - def sleep_s(s: int): + def sleep_s(self, s: int): pass # need override - def sleep_ms(ms: int): + def sleep_ms(self, ms: int): pass class ADC(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPin(pin: str): + def setPin(self, pin: str): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def read() -> float: + def read(self) -> float: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class UART(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setBaudRate(baudRate: int): + def setBaudRate(self, baudRate: int): pass - def setId(id: int): + def setId(self, id: int): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def write(data: str): + def write(self, data: str): pass - def read(length: int) -> str: + def read(self, length: int) -> str: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformWrite(): + def platformWrite(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class IIC(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setPinSCL(pin: str): + def setPinSCL(self, pin: str): pass - def setPinSDA(pin: str): + def setPinSDA(self, pin: str): pass - def setDeviceAddr(addr: int): + def setDeviceAddr(self, addr: int): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def write(addr: int, data: str): + def write(self, addr: int, data: str): pass - def read(addr: int, length: int) -> str: + def read(self, addr: int, length: int) -> str: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformWrite(): + def platformWrite(self): pass # need override - def platformRead(): + def platformRead(self): pass # need override - def platformDisable(): + def platformDisable(self): pass class PWM(TinyObj): - def __init__(): + def __init__(self): pass - def init(): + def init(self): pass - def setName(name: str): + def setName(self, name: str): pass - def getName() -> str: + def getName(self) -> str: pass - def setChannel(ch: int): + def setChannel(self, ch: int): pass - def getChannel() -> int: + def getChannel(self) -> int: pass - def setPin(pin: str): + def setPin(self, pin: str): pass - def setFrequency(freq: int): + def setFrequency(self, freq: int): pass - def setFreq(freq: int): + def setFreq(self, freq: int): pass - def setDuty(duty: float): + def setDuty(self, duty: float): pass - def enable(): + def enable(self): pass - def disable(): + def disable(self): pass - def getFrequency() -> int: + def getFrequency(self) -> int: pass - def getDuty() -> float: + def getDuty(self) -> float: pass # need override - def platformEnable(): + def platformEnable(self): pass # need override - def platformSetFrequency(): + def platformSetFrequency(self): pass # need override - def platformSetDuty(): + def platformSetDuty(self): pass # need override - def platformDisable(): + def platformDisable(self): pass diff --git a/port/linux/pkg-push.sh b/port/linux/pkg-push.sh index 52b59283f..a48b28013 100644 --- a/port/linux/pkg-push.sh +++ b/port/linux/pkg-push.sh @@ -1,6 +1,6 @@ pkg=$1 -cp package/pikascript/pikascript-lib/PikaStdLib ../../package/ -r -cp package/pikascript/$pkg.py ../../package/PikaStdLib/ -git add package/pikascript/pikascript-lib/PikaStdLib +cp package/pikascript/pikascript-lib/$pkg ../../package/ -r +cp package/pikascript/$pkg.py ../../package/$pkg/ +git add package/pikascript/pikascript-lib/$pkg git add package/pikascript/$pkg.py -git add ../../package/PikaStdLib +git add ../../package/$pkg