Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -7,12 +7,12 @@ VERSION := $(shell version get:plugin st2.py || echo 2.1dev) DEST := /usr/share/streamtuner2 INST := install -m 644 PACK := xpm DEPS := -n $(NAME) -d python -d python-pyquery -d python-gtk2 -d python-requests -d python-keybinder -DEPS_A := -n $(NAME) -d pygtk -d python2 -d python2-cssselect -d python2-keybinder2 -d python2-lxml -d python2-pillow -d python2-pyquery -d python2-xdg -d python2-requests -OPTS := -s src -u packfile,man,fixperms -f --prefix=$(DEST) --deb-compression xz --rpm-compression xz --exe-autoextract +DEPS_A := -n $(NAME) -d pygtk -d python2 -d python2-cssselect -d python2-keybinder2 -d python2-lxml -d python2-pillow -d python2-pyquery -d python2-xdg -d python2-requests --provides streamtuner-python +OPTS := -s src -u packfile,man,fixperms -f --prefix=$(DEST) --deb-compression=xz --rpm-compression=xz --exe-autoextract # targets .PHONY: bin all: gtk3 #(most used) pack: all ver docs xpm src @@ -39,19 +39,19 @@ rm -r __pycache__ */__pycache__ #-- bundles xpm: deb pyz tar rpm exe deb: - $(PACK) $(OPTS) $(DEPS) -t $@ -p "$(NAME)-VERSION.deb" st2.py + $(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.deb" st2.py rpm: - $(PACK) $(OPTS) $(DEPS) -t $@ -p "$(NAME)-VERSION.rpm" st2.py + $(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.rpm" st2.py tar: - $(PACK) $(OPTS) $(DEPS) -t $@ -p "$(NAME)-VERSION.bin.txz" st2.py + $(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.bin.txz" st2.py exe: - $(PACK) $(OPTS) $(DEPS) -t $@ -p "$(NAME)-VERSION.exe" st2.py + $(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.exe" st2.py arch: - $(PACK) $(OPTS) $(DEPS_A) -t $@ -p "$(NAME)-VERSION.arch.txz" st2.py + $(PACK) -t $@ $(OPTS) $(DEPS_A) -p "$(NAME)-VERSION.arch.txz" st2.py pyz: #@BUG: relative package references leave a /tmp/doc/ folder $(PACK) -u packfile -s src -t zip --zip-shebang "/usr/bin/env python" \ -f -p "$(NAME)-$(VERSION).pyz" --prefix=./ .zip.py st2.py src: Index: PKG-INFO ================================================================== --- PKG-INFO +++ PKG-INFO @@ -1,12 +1,12 @@ Metadata-Version: 1.0 Name: streamtuner2 -Version: 2.1.7 +Version: 2.1.7-dev Summary: Streamtuner2 is an internet radio browser Home-page: http://fossil.include-once.org/streamtuner2/ Author: Mario Salzer Author-email: xmilky+st2@gmail.... License: Public Domain Description: Streamtuner2 lists radio directory services like Shoutcast, Xiph, Live365, MyOggRadio, Jamendo. It allows listening via any audio player, and recording of streams via streamripper. Platform: ALL Keywords: internet-radio, python, streaming, audio Index: channels/internet_radio.py ================================================================== --- channels/internet_radio.py +++ channels/internet_radio.py @@ -79,11 +79,11 @@ ) # Is there a next page? if str(page+1) not in rx_pages.findall(html[-1]): break - self.parent.status(float(page)/float(max_pages+1)) + self.parent.status(float(page)/float(max_pages+1), timeout=1) # Alternatively try regex or pyquery parsing #log.HTTP(html) for use_rx in [not conf.pyquery, conf.pyquery]: try: Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -356,42 +356,38 @@ - # Shortcut to statusbar and progressbar. - # Either pass a string "" or a float 0.5, the message and pulse will be automatically - # removed after 5 seconds now. + # Shortcut to statusbar and progressbar (receives either a string, or a float). def status(self, text=None, timeout=3): - t = time.time() + timeout - + self.status_last = time.time() + timeout + gobject.timeout_add(int(timeout*1000), self.status_clear) # progressbar if isinstance(text, (int, float)): if (text <= 0): # unknown state uikit.do(self.progress.pulse, immediate=1) elif text >= 0.999 or text < 0.0: # completed uikit.do(self.progress.hide) else: # show percentage uikit.do(self.progress.show, immediate=1) uikit.do(self.progress.set_fraction, text, immediate=1) - self.status_last = t - # add text elif isinstance(text, (str)): uikit.do(self.statusbar.set_text, text) - self.status_last = t + # clean up + else: + self.status_clear(anyway=True) - # timeout - if not text or time.time() >= self.status_last: + # Clean up after 3 seconds + def status_clear(self, anyway=False): + if anyway or time.time() >= self.status_last: self.statusbar.set_text("") self.progress.hide() return False - # add timer else: - gobject.timeout_add(int(timeout*1000), self.status) - return True - status_last = 0 + return True # load plugins from /usr/share/streamtuner2/channels/ def load_plugin_channels(self):