Skip to content
Open
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
language_version: python3
files: .
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-toml
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
rev: 7.3.0
hooks:
- id: flake8
language_version: python3
Expand All @@ -22,4 +22,4 @@ repos:
- id: isort
language_version: python3
repo: https://github.com/timothycrosley/isort
rev: 6.0.1
rev: 8.0.1
1 change: 1 addition & 0 deletions src/livemaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
"""Top-level package for pylivemaker."""

from loguru import logger

from ._version import __version__, __version_tuple__ # noqa: F401
Expand Down
34 changes: 17 additions & 17 deletions src/livemaker/lsb/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,39 +590,39 @@ def _to(self):
# someone finds a script that actually requires supporting it

def _plus(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " + ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
raise NotImplementedError("Plus() expected numeric type")
return [Param(value=p1.value + p2.value)]

def _minus(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " - ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
raise NotImplementedError("Minus() expected numeric type")
return [Param(value=p1.value - p2.value)]

def _mul(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " * ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
raise NotImplementedError("Mul() expected numeric type")
return [Param(value=p1.value * p2.value)]

def _div(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " / ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
raise NotImplementedError("Div() expected numeric type")
return [Param(value=p1.value / p2.value)]

def _mod(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " % ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
Expand All @@ -631,7 +631,7 @@ def _mod(self):

def _or(self):
# LiveMaker uses | to specify both bitwise and boolean OR
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return ["(", p1, " | ", p2, ")"]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
Expand All @@ -642,7 +642,7 @@ def _or(self):

def _and(self):
# LiveMaker uses | to specify both bitwise and boolean AND
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return ["(", p1, " & ", p2, ")"]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
Expand All @@ -652,7 +652,7 @@ def _and(self):
return [p1.value & p2.value]

def _xor(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " ^ ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
Expand All @@ -676,45 +676,45 @@ def _func(self):
return x

def _equal(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " == ", p2]
return [Param(value=p1.value == p2.value)]

def _big(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " > ", p2]
return [Param(value=p1.value > p2.value)]

def _small(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " < ", p2]
return [Param(value=p1.value < p2.value)]

def _ebig(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " >= ", p2]
return [Param(value=p1.value >= p2.value)]

def _esmall(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " <= ", p2]
return [Param(value=p1.value <= p2.value)]

def _shiftl(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " << ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
raise NotImplementedError("ShiftL() expected numeric type")
return [Param(p1.value << p2.value)]

def _shiftr(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " >> ", p2]
elif p1.type == ParamType.Str or p2.type == ParamType.Str:
Expand All @@ -723,15 +723,15 @@ def _shiftr(self):

def _combostr(self):
# String join
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " ++ ", p2]
elif p1.type != ParamType.Str or p2.type != ParamType.Str:
raise NotImplementedError("ComboStr() expected string type")
return [Param(value="".join([p1.value, p2.value]))]

def _nequal(self):
(p1, p2) = self.operands
p1, p2 = self.operands
if p1.type == ParamType.Var or p2.type == ParamType.Var:
return [p1, " != ", p2]
return [Param(value=p1.value != p2.value)]
Expand Down
Loading