Remove or space out suspension dots after service name for easier copy-pasting

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2015-09-04 17:43:12 -07:00
parent d84ee667ad
commit 6da7a9194c
2 changed files with 12 additions and 12 deletions

View File

@ -143,27 +143,27 @@ class Service(object):
# TODO: remove these functions, project takes care of starting/stopping, # TODO: remove these functions, project takes care of starting/stopping,
def stop(self, **options): def stop(self, **options):
for c in self.containers(): for c in self.containers():
log.info("Stopping %s..." % c.name) log.info("Stopping %s" % c.name)
c.stop(**options) c.stop(**options)
def pause(self, **options): def pause(self, **options):
for c in self.containers(filters={'status': 'running'}): for c in self.containers(filters={'status': 'running'}):
log.info("Pausing %s..." % c.name) log.info("Pausing %s" % c.name)
c.pause(**options) c.pause(**options)
def unpause(self, **options): def unpause(self, **options):
for c in self.containers(filters={'status': 'paused'}): for c in self.containers(filters={'status': 'paused'}):
log.info("Unpausing %s..." % c.name) log.info("Unpausing %s" % c.name)
c.unpause() c.unpause()
def kill(self, **options): def kill(self, **options):
for c in self.containers(): for c in self.containers():
log.info("Killing %s..." % c.name) log.info("Killing %s" % c.name)
c.kill(**options) c.kill(**options)
def restart(self, **options): def restart(self, **options):
for c in self.containers(): for c in self.containers():
log.info("Restarting %s..." % c.name) log.info("Restarting %s" % c.name)
c.restart(**options) c.restart(**options)
# end TODO # end TODO
@ -289,7 +289,7 @@ class Service(object):
) )
if 'name' in container_options and not quiet: if 'name' in container_options and not quiet:
log.info("Creating %s..." % container_options['name']) log.info("Creating %s" % container_options['name'])
return Container.create(self.client, **container_options) return Container.create(self.client, **container_options)
@ -423,7 +423,7 @@ class Service(object):
volumes can be copied to the new container, before the original volumes can be copied to the new container, before the original
container is removed. container is removed.
""" """
log.info("Recreating %s..." % container.name) log.info("Recreating %s" % container.name)
try: try:
container.stop(timeout=timeout) container.stop(timeout=timeout)
except APIError as e: except APIError as e:
@ -453,7 +453,7 @@ class Service(object):
if container.is_running: if container.is_running:
return container return container
else: else:
log.info("Starting %s..." % container.name) log.info("Starting %s" % container.name)
return self.start_container(container) return self.start_container(container)
def start_container(self, container): def start_container(self, container):
@ -462,7 +462,7 @@ class Service(object):
def remove_duplicate_containers(self, timeout=DEFAULT_TIMEOUT): def remove_duplicate_containers(self, timeout=DEFAULT_TIMEOUT):
for c in self.duplicate_containers(): for c in self.duplicate_containers():
log.info('Removing %s...' % c.name) log.info('Removing %s' % c.name)
c.stop(timeout=timeout) c.stop(timeout=timeout)
c.remove() c.remove()
@ -689,7 +689,7 @@ class Service(object):
) )
def build(self, no_cache=False): def build(self, no_cache=False):
log.info('Building %s...' % self.name) log.info('Building %s' % self.name)
path = self.options['build'] path = self.options['build']
# python2 os.path() doesn't support unicode, so we need to encode it to # python2 os.path() doesn't support unicode, so we need to encode it to

View File

@ -90,13 +90,13 @@ def write_out_msg(stream, lines, msg_index, msg, status="done"):
stream.write("%c[%dA" % (27, diff)) stream.write("%c[%dA" % (27, diff))
# erase # erase
stream.write("%c[2K\r" % 27) stream.write("%c[2K\r" % 27)
stream.write("{} {}... {}\n".format(msg, obj_index, status)) stream.write("{} {} ... {}\n".format(msg, obj_index, status))
# move back down # move back down
stream.write("%c[%dB" % (27, diff)) stream.write("%c[%dB" % (27, diff))
else: else:
diff = 0 diff = 0
lines.append(obj_index) lines.append(obj_index)
stream.write("{} {}... \r\n".format(msg, obj_index)) stream.write("{} {} ... \r\n".format(msg, obj_index))
stream.flush() stream.flush()