X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fvlc-rc;h=f2d0d617c89aeb4ab9f876e5b4e208c5292423ba;hb=5b4483f152e04ec74cd42c9bb319e9fc837858b5;hp=ef6bb1e7cad307befab4f3c500655c2ddb3299a6;hpb=bc123377a5d6360085e1ce7569177fbde385da0b;p=home.git diff --git a/.bin/vlc-rc b/.bin/vlc-rc index ef6bb1e..f2d0d61 100755 --- a/.bin/vlc-rc +++ b/.bin/vlc-rc @@ -56,7 +56,8 @@ def connection(host, port, quiet=False): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: if not quiet: - print('Connecting to %s:%s ...' %(host, port), end='') + print('Connecting to %s:%s ... ' %(host, port), end='') + sys.stdout.flush() try: s.connect((host, port)) except socket.error as e: @@ -101,7 +102,7 @@ class VlcConsole(code.InteractiveConsole): try: result += self.server.recv(1024 * 1024) except socket.timeout: - if result: + if '\n' in result: break if passthru: self.write(result) @@ -194,7 +195,11 @@ class VlcConsole(code.InteractiveConsole): offset *= -1 position = current_position + offset else: - position = opts.position + try: + position = int(opts.position) + except ValueError: + logging.error('seek takes an int, not "%s"', opts.position) + return self._run_command('seek %s' % (position,), passthru=True)