diff --git a/buypeeb.py b/buypeeb.py index 1a7626f..207562e 100755 --- a/buypeeb.py +++ b/buypeeb.py @@ -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) diff --git a/listing.py b/listing.py index a9d553b..272c0ba 100644 --- a/listing.py +++ b/listing.py @@ -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() diff --git a/settings.py b/settings.py index 06a445d..8548cf5 100644 --- a/settings.py +++ b/settings.py @@ -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)) diff --git a/ui/main.glade b/ui/main.glade index 61db50a..dedd09a 100644 --- a/ui/main.glade +++ b/ui/main.glade @@ -146,6 +146,7 @@ Add new True gtk-add + @@ -321,6 +322,7 @@ True False + app.shutdown Quit True gtk-quit