project_create_handler.
178488
def project_create_handler(args):
    """"""
    if not db.setup(url=args.db, echo=args.db_echo):
        return
    if not _check_db_revision():
        return

    project_path = os.path.abspath(args.project_dir)
    project_name = args.project_name

    project = db.session.query(Project).\
        filter_by(path_name=project_path).first()

    if project is None:
        project = Project.create(project_path, project_name)
    else:
        print("Path '{}' has already registered.".format(project.path_name))
181399
def set_handler(self, handler):
        
        if self._handler:
            raise Exception('Handler was already set')
        if handler:
            self._handler = async_task(handler, loop=self._loop)
657200
public function create($project_id, array $parameters = array())
    {
        $resolver = new OptionsResolver();
        $resolver->setDefined('name')
            ->setRequired('name')
            ->setAllowedTypes('name', 'string');
        $resolver->setDefined('external_url')
            ->setAllowedTypes('external_url', 'string');

        return $this->post($this->getProjectPath($project_id, 'environment'), $resolver->resolve($parameters));
    }
1290018
def _create_console_handles(self, project):
        
        """
        import __main__
        for item in project:
            __main__.__dict__[item.name] = item
609083
private void createProject() {

        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            String name = "/";
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldOU.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldOU.getValue());
            }
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldName.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldName.getValue());
            } else {
                name = CmsStringUtil.joinPaths(name, "/");
            }

            m_project = cms.createProject(
                name,
                m_fieldDescription.getValue(),
                m_fieldUser.getValue(),
                m_fieldManager.getValue(),
                m_fieldDeleteAfterPublish.getValue().booleanValue()
                ? CmsProject.PROJECT_TYPE_TEMPORARY
                : CmsProject.PROJECT_TYPE_NORMAL);
            updateProjectResources();

        } catch (Throwable t) {
            CmsErrorDialog.showErrorDialog(t);
        }
    }
424867
def create(self, project, name, **attrs):
        
        attrs.update(
            {
                'project': project, 'name': name
            }
        )
        return self._new_resource(payload=attrs)
1065674
private function createErrorHandler()
    {
        /**
         * @param int $errno
         * @param string $errstr
         * @param string $errfile
         * @param int $errline
         * @return void
         * @throws \ErrorException if error is not within the error_reporting mask.
         */
        return function ($errno, $errstr, $errfile, $errline) {
            if (! (error_reporting() & $errno)) {
                // error_reporting does not include this error
                return;
            }

            throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
        };
    }
313280
def new(project_name):
    """"""

    try:
        locale.setlocale(locale.LC_ALL, '')
    except:
        print("Warning: Unable to set locale.  Expect encoding problems.")

    config = utils.get_config()
    config['new_project']['project_name'] = project_name

    values = new_project_ui(config)
    if type(values) is not str:
        print('New project options:')
        pprint.pprint(values)
        project_dir = render.render_project(**values)
        git.init_repo(project_dir, **values)
    else:
        print(values)
89712
@SuppressWarnings("unchecked")
   private Handler createHandler() throws Throwable
   {
      Class clz = handler;

      while (clz != Object.class)
      {
         try
         {
            Constructor c = clz.getDeclaredConstructor((Class[])null);
            c.setAccessible(true);

            return (Handler)c.newInstance((Object[])null);
         }
         catch (Throwable t)
         {
            t.printStackTrace(System.err);
         }

         clz = clz.getSuperclass();
      }

      throw new IllegalStateException("Unable to find default constructor");
   }
524895
def new(project, credentials=None):
        """"""
        user, oauth_access_token = parsecredentials(credentials)
        response = Project.create(project, user)
        if response is not None:
            return response
        msg = "Project " + project + " has been created for user " + user
        if oauth_access_token:
            extraloc = '?oauth_access_token=' + oauth_access_token
        else:
            extraloc = ''
        return flask.make_response(msg, 201, {'Location': getrooturl() + '/' + project + '/' + extraloc, 'Content-Type':'text/plain','Content-Length': len(msg),'Access-Control-Allow-Origin': settings.ALLOW_ORIGIN, 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE', 'Access-Control-Allow-Headers': 'Authorization'})
856517
def create(self, project, subject, **attrs):
        
        attrs.update({'project': project, 'subject': subject})
        return self._new_resource(payload=attrs)
869128
def create_module(project, name, sourcefolder=None):
    """"""
    if sourcefolder is None:
        sourcefolder = project.root
    packages = name.split('.')
    parent = sourcefolder
    for package in packages[:-1]:
        parent = parent.get_child(package)
    return parent.create_file(packages[-1] + '.py')
112888
def createHandler(self, handler):
        
        target = handler['target']
        if handler['type'] == 'log':
            self.logger.warning("Initialising csvlogger to log data to " + target)
            return CSVLogger('recorder', handler['name'], target)
        elif handler['type'] == 'post':
            self.logger.warning("Initialising http logger to log data to " + target)
            return HttpPoster(handler['name'], target)
176366
def create(cls, data=None, api_key=None, endpoint=None, add_headers=None,
               **kwargs):
        """"""
        cls.validate(data)
        inst = cls(api_key=api_key)
        endpoint = ''
        return inst.request('POST',
                            endpoint=endpoint,
                            data=data,
                            query_params=kwargs,
                            add_headers=add_headers,
                            )
999418
private function createErrorHandler()
    {
        /*
         * @param int $severity
         * @param string $message
         * @param string $file
         * @param int $line
         * @return void
         * @throws ErrorException if error is not within the error_reporting mask.
         */
        return function (int $severity, string $message, string $file, int $line): void {
            if (error_reporting() & $severity) {
                throw new ErrorException($message, 0, $severity, $file, $line);
            }
        };
    }
142149
def create(handler, item_document):
    """"""
    data = {'operation': 'create',
            'item': json.load(item_document)}
    handler.invoke(data)
646590
private void addInputHandler(final Project project) throws BuildException {
        final InputHandler handler;
        if (args.inputHandlerClassname == null) {
            handler = new DefaultInputHandler();
        } else {
            handler = ClasspathUtils.newInstance(args.inputHandlerClassname, Main.class.getClassLoader(),
                    InputHandler.class);
            project.setProjectReference(handler);
        }
        project.setInputHandler(handler);
    }