and the winner of the dunce of the year is
This commit is contained in:
parent
2a3700e6fe
commit
765f148805
4 changed files with 12 additions and 3 deletions
|
@ -69,6 +69,9 @@ class BuypeebApp:
|
|||
self.settings.save()
|
||||
self.app.quit()
|
||||
|
||||
def btnAddClicked(self, widget):
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = BuypeebApp()
|
||||
app.run(sys.argv)
|
||||
|
|
|
@ -11,8 +11,12 @@ class YahooAuctionsItem:
|
|||
def __init__(self, name: str, url: str):
|
||||
# note - incoming url is not validated in any way!
|
||||
self.name = name
|
||||
self.url = re.match(url.rstrip("/"), r"([^?]+)") # remove trailing slashes and query params
|
||||
self.id = re.match(self.url, r".+\/(.+?)$") # extract "x12345" from "https://buyee.jp/whatever/blah/x12345"
|
||||
try:
|
||||
self.url = re.match(r"([^?]+)", url.rstrip("/")).group(1) # remove trailing slashes and query params
|
||||
except:
|
||||
# ???
|
||||
raise
|
||||
self.id = re.match(r".+\/(.+?)$", self.url) # extract "x12345" from "https://buyee.jp/whatever/blah/x12345"
|
||||
self.last_checked = datetime.fromisoformat('1970-01-01')
|
||||
self.available = True
|
||||
self.update()
|
||||
|
|
|
@ -32,5 +32,5 @@ class BuypeebSettings:
|
|||
def set(self, setting: str, value):
|
||||
self.s['setting'] = value
|
||||
|
||||
def watch(self, name: string, url: string):
|
||||
def watch(self, name: str, url: str):
|
||||
self.s['watchlist'].add(YahooAuctionsItem(name, url))
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
<property name="label" translatable="yes">Add new</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-add</property>
|
||||
<signal name="clicked" handler="btnAddClicked" swapped="no"/>
|
||||
<accelerator key="n" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -321,6 +322,7 @@
|
|||
<object class="GtkToolButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">app.shutdown</property>
|
||||
<property name="label" translatable="yes">Quit</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-quit</property>
|
||||
|
|
Loading…
Reference in a new issue