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:
try:
result += self.server.recv(1024 * 1024)
except socket.timeout:
- if result:
+ if '\n' in result:
break
if passthru:
self.write(result)
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)