示例#1
0
	def __init__(self):
		# Find Project Root
		path.current = os.getcwd()
		path.root    = recurse_up(path.current, 'Cakefile')

		if path.root:
			os.chdir(path.root)
			sys.path.insert(0, '')

			# Print project path
			puts(fore.yellow('(in %s)' % path.root))
		else:
			raise CakeError('Cakefile not found')

		# Prepare environment
		self.env   = {}
		self.tasks = {}
	
		# Read Cakefile
		with open('Cakefile') as f:
			exec(f.read(), self.env)

		# Load all tasks
		for name, task in self.env.items():
			if getattr(task, '_task', False):
				self.tasks[name] = task
示例#2
0
    def __init__(self):
        # Find Project Root
        path.current = os.getcwd()
        path.root = recurse_up(path.current, 'Cakefile')

        if path.root:
            os.chdir(path.root)
            sys.path.insert(0, '')

            # Print project path
            puts(fore.yellow('(in %s)' % path.root))
        else:
            raise CakeError('Cakefile not found')

        # Prepare environment
        self.env = {}
        self.tasks = {}

        # Read Cakefile
        with open('Cakefile') as f:
            exec(f.read(), self.env)

        # Load all tasks
        for name, task in self.env.items():
            if getattr(task, '_task', False):
                self.tasks[name] = task
示例#3
0
def find_project():
	current = os.getcwd()
	return recurse_up(current, 'Cakefile')
示例#4
0
def find_project():
    current = os.getcwd()
    return recurse_up(current, 'Cakefile')