Adds a project.

        :param path: Project path.
        :type path: unicode
        :return: Method success.
        :rtype: bool
332487
def add_project(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        path = os.path.normpath(path)
        if self.__model.get_project_nodes(path):
            self.__engine.notifications_manager.warnify(
                "{0} | '{1}' project is already opened!".format(self.__class__.__name__, path))
            return False

        LOGGER.info("{0} | Adding '{1}' project!".format(self.__class__.__name__, path))
        project_node = self.__model.register_project(path)
        if not project_node:
            return False

        self.__model.set_project_nodes(project_node)
        return True
661469
def __load_project_from_file_path(file_path):
    '''
    
    '''
    try:
        project = get_project(project_dir=os.path.dirname(file_path),
                              config_path=[os.path.basename(file_path)])
    except Exception as inst:
        return __handle_except(inst)
    return project
253365
def AddFile(self, filepath):
    
    if filepath not in self._files:
      self._files.add(filepath)
      return True
    return False
822137
def add_resource(self, path, resource):
        

        assert isinstance(resource, Resource)
        path = path.strip("/")
        paths = path.split("/")
        actual_path = ""
        i = 0
        for p in paths:
            i += 1
            actual_path += "/" + p
            try:
                res = self.root[actual_path]
            except KeyError:
                res = None
            if res is None:
                resource.path = actual_path
                self.root[actual_path] = resource
        return True
705955
def add_path(self, path):
        

        if os.path.exists(path):
            self.paths.add(path)
            return path
        else:
            #logger.debug('Path {} doesn\'t exist'.format(path))
            return None
1229142
def _add_asset_bundle(cls, path):
        
        f = "%s/assets.yml" % path
        if os.path.isfile(f):
            cls._asset_bundles.add(f)
1137939
def register_prefix(self, path):
        
        if path not in self._prefixes:
            LOG.debug('%r: registering prefix %r', self, path)
            self._prefixes.add(path)
411491
def add(self, method, path_settings, target):
        
        self.routes.append(Route(method, path_settings, target))
        return
856411
def add_project(self, ):
        
        i = self.prj_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            project = item.internal_data()
            if self._atype:
                self._atype.projects.add(project)
            elif self._dep:
                self._dep.projects.add(project)
            else:
                project.users.add(self._user)
            self.projects.append(project)
            item.set_parent(None)
793866
def with_path(self, path):
        
        new_command = copy.deepcopy(self)
        new_command._paths.append(str(path))
        return new_command
591781
def AddDir(self, dirpath):
    
    if dirpath not in self._dirs:
      self._dirs.add(dirpath)
      return True
    return False
792372
private void addProjectPath(final Path path) {
        addToClassPool(path);

        if (path.toFile().isFile() && path.toString().endsWith(".jar")) {
            addJarClasses(path);
        } else if (path.toFile().isDirectory()) {
            addDirectoryClasses(path, Paths.get(""));
        } else {
            throw new IllegalArgumentException("The project path '" + path + "' must be a jar file or a directory");
        }
    }
824622
def add_favicon_path(self, path: str) -> None:
        
        spec = web.URLSpec(
            '/(favicon.ico)',
            StaticFileHandler,
            dict(path=path)
        )
        # Need some check
        handlers = self.handlers[0][1]
        handlers.append(spec)
675816
public ThreadContextClassLoaderBuilder addPath(final String path) {

        // Check sanity
        Validate.notEmpty(path, "path");

        // Convert to an URL, and delegate.
        final URL anUrl;
        try {
            anUrl = new File(path).toURI().toURL();
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Could not convert path [" + path + "] to an URL.", e);
        }

        // Delegate
        return addURL(anUrl);
    }
972690
def addpath(path):
    """"""
    import sys
    if not exists(path):
        raise ValueError('Path %s does not exist' % path)
    sys.path.insert(1, path)
1112100
def load_project(self, path):
        
        base = self._get_base(path)

        filename, pathname, description = imp.find_module('tarbell_config', [path])
        project = imp.load_module('project', filename, pathname, description)

        try:
            self.key = project.SPREADSHEET_KEY
            self.client = get_drive_api()
        except AttributeError:
            self.key = None
            self.client = None

        try:
            project.CREATE_JSON
        except AttributeError:
            project.CREATE_JSON = False

        try:
            project.S3_BUCKETS
        except AttributeError:
            project.S3_BUCKETS = {}

        project.EXCLUDES = list(set(EXCLUDES + getattr(project, 'EXCLUDES', []) + getattr(base, 'EXCLUDES', [])))

        # merge project template types with defaults
        project.TEMPLATE_TYPES = set(getattr(project, 'TEMPLATE_TYPES', [])) | set(TEMPLATE_TYPES)

        try:
            project.DEFAULT_CONTEXT
        except AttributeError:
            project.DEFAULT_CONTEXT = {}

        project.DEFAULT_CONTEXT.update({
            "PROJECT_PATH": self.path,
            "ROOT_URL": "127.0.0.1:5000",
            "SPREADSHEET_KEY": self.key,
            "BUCKETS": project.S3_BUCKETS,
            "SITE": self,
        })

        # Set up template loaders
        template_dirs = [path]
        if base:
            template_dirs.append(base.base_dir)
        error_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'error_templates')
        template_dirs.append(error_path)

        self.app.jinja_loader = TarbellFileSystemLoader(template_dirs)

        # load the project blueprint, if it exists
        if hasattr(project, 'blueprint') and isinstance(project.blueprint, Blueprint):
            self.app.register_blueprint(project.blueprint, site=self)

        return project, base
634522
def put(self, path=None, method='PUT', **options):
        
        return self.route(path, method, **options)