Skip to content

Commit 5fb884d

Browse files
committed
WIP with python methods
1 parent 5ed541f commit 5fb884d

File tree

3 files changed

+279
-270
lines changed

3 files changed

+279
-270
lines changed

Bindings~/python/alttester/altby.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,30 @@ def __repr__(self):
3434
def __eq__(self, other):
3535
return self.by == other.by and self.value == other.value
3636

37-
def name(name):
38-
return AltBy(by=By.NAME, value=name)
37+
@classmethod
38+
def name(cls, name):
39+
return cls(by=By.NAME, value=name)
3940

40-
def id(id):
41-
return AltBy(by=By.ID, value=id)
41+
@classmethod
42+
def id(cls, id):
43+
return cls(by=By.ID, value=id)
4244

43-
def path(path):
44-
return AltBy(by=By.PATH, value=path)
45+
@classmethod
46+
def path(cls, path):
47+
return cls(by=By.PATH, value=path)
4548

46-
def tag(tag):
47-
return AltBy(by=By.TAG, value=tag)
49+
@classmethod
50+
def tag(cls, tag):
51+
return cls(by=By.TAG, value=tag)
4852

49-
def layer(layer):
50-
return AltBy(by=By.LAYER, value=layer)
53+
@classmethod
54+
def layer(cls, layer):
55+
return cls(by=By.LAYER, value=layer)
5156

52-
def text(text):
53-
return AltBy(by=By.TEXT, value=text)
57+
@classmethod
58+
def text(cls, text):
59+
return cls(by=By.TEXT, value=text)
5460

55-
def component(component):
56-
return AltBy(by=By.COMPONENT, value=component)
61+
@classmethod
62+
def component(cls, component):
63+
return cls(by=By.COMPONENT, value=component)

0 commit comments

Comments
 (0)