def check_pushdir(self, local_dir): orig = dir = os.path.realpath(local_dir) if ':' in orig: # win32? return self.check_pushdir_win32(local_dir) while True: if os.path.isdir(dir) and os.path.exists(os.path.join(dir, 'dotcloud.yml')): if dir != orig: utils.info('# Found dotcloud.yml: Using {0} as a base directory'.format(dir)) return dir prev = dir dir = os.path.realpath(os.path.join(dir, os.path.pardir)) if dir == prev: local.confirm('Could not find dotcloud.yml file in {0} and parent directories. Proceed?'.format(orig)) break return orig
def hook_push(cmd): if '-h' in cmd or len(cmd) < 2: return if len(cmd) == 2: cmd.append('.') orig = dir = os.path.realpath(cmd[2]) while True: if os.path.isdir(dir) and os.path.exists(os.path.join(dir, 'dotcloud.yml')): if dir != orig: utils.info('# Found dotcloud.yml: Using {0} as a base directory'.format(dir)) cmd[2] = dir return prev = dir dir = os.path.realpath(os.path.join(dir, os.path.pardir)) if dir == prev: local.confirm('Could not find dotcloud.yml file in {0} and parent directories. Proceed?'.format(orig)) break
def hook_destroy(cmd): local.confirm('Please confirm destruction')
def hook_destroy(cmd): if '-h' in cmd: return local.confirm('Please confirm destruction')
def check_pushdir_win32(self, local_dir): if not os.path.exists(os.path.join(local_dir, 'dotcloud.yml')): local.confirm('Could not find dotcloud.yml file in {0}. Proceed?'.format(local_dir)) return local_dir