Add a new script or phrase to the folder.
338269
def add_item(self, item):
        
        item.parent = self
        #self.phrases[phrase.description] = phrase
        self.items.append(item)
1025503
def append_js!(html, after_script_name, script_name)
      html.sub!(script_matcher(after_script_name)) do
        "#{$~}\n" + helper.javascript_include_tag(script_name)
      end
    end
316353
function addLiteral(script, str){
  if(!str) return;
  str = str.replace(/\\|'/g, '\\$&');// escape '

  var m, index = 0;
  while(m = reNewline.exec(str)){
    var nl = m[0];
    var es = nl==='\r\n'? '\\r\\n':'\\n';
    script.push("__p('" + str.slice(index, m.index) + es + "');\n");
    index = m.index + nl.length;
  }
  var last = str.slice(index);
  if(last) script.push("__p('" + last + "');");
}
1318211
def container_new_folder(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/newFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
1210794
def write_script(self, script_name, contents, mode="t", blockers=()):
        """"""
        self.delete_blockers(  # clean up old .py/.pyw w/o a script
            [os.path.join(self.script_dir, x) for x in blockers]
        )
        log.info("Installing %s script to %s", script_name, self.script_dir)
        target = os.path.join(self.script_dir, script_name)
        self.add_output(target)

        if self.dry_run:
            return

        mask = current_umask()
        ensure_directory(target)
        if os.path.exists(target):
            os.unlink(target)
        with open(target, "w" + mode) as f:
            f.write(contents)
        chmod(target, 0o777 - mask)
29866
private function addScriptBefore($script) {
        $script = trim($script);
        if ($script != '') {
            if (strpos($this->script, $script) === false) {
                $this->script = "
				 {$script} 
				 {$this->script}";
            }
        }
    }
12242
def add_javascripts(self, *js_files):
        """"""
        # create the script tag if don't exists
        if self.main_soup.script is None:
            script_tag = self.main_soup.new_tag('script')
            self.main_soup.body.append(script_tag)

        for js_file in js_files:
            self.main_soup.script.append(self._text_file(js_file))
257570
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, CodeExpression.TYPES)
        self.arguments = self.arguments + (codeobj,)
20480
def activate_script(self):
        """"""

        # must be rethought
        # ./scripts
        # deploydir/./scripts
        self._add_scope("script")
        self.scripts = {}
        self.script_files = [
            "./scripts/script_*.txt", "~/.cloudmesh/scripts/script_*.txt"]
        self._load_scripts(self.script_files)
1169679
def add_script_sequence(self):
        

        def empty_tree(tree_model):
            # COMMENT_ME
            def add_children_to_list(item, somelist):
                if item.hasChildren():
                    for rownum in range(0, item.rowCount()):
                        somelist.append(str(item.child(rownum, 0).text()))

            output_list = []
            root = tree_model.invisibleRootItem()
            add_children_to_list(root, output_list)
            tree_model.clear()
            return output_list

        name = str(self.txt_script_sequence_name.text())
        new_script_list = empty_tree(self.tree_script_sequence_model)
        new_script_dict = {}
        for script in new_script_list:
            if script in self.elements_old:
                new_script_dict.update({script: self.elements_old[script]})
            elif script in self.elements_from_file:
                new_script_dict.update({script: self.elements_from_file[script]})

        new_script_parameter_dict = {}
        for index, script in enumerate(new_script_list):
            new_script_parameter_dict.update({script: index})
        # QtGui.QTextEdit.toPlainText()


        # get the module of the current dialogue

        package = get_python_package(inspect.getmodule(self).__file__)

        assert package is not None # check that we actually find a module

        # class_name = Script.set_up_dynamic_script(factory_scripts, new_script_parameter_list, self.cmb_looping_variable.currentText() == 'Parameter Sweep')
        new_script_dict = {name: {'class': 'ScriptIterator', 'package': package, 'scripts': new_script_dict,
                                  'info': str(self.txt_info.toPlainText()),
                                  'settings': {'script_order': new_script_parameter_dict,
                                               'iterator_type': str(self.cmb_looping_variable.currentText())}}}
        self.selected_element_name = name
        self.fill_tree(self.tree_loaded, new_script_dict)
        self.elements_from_file.update(new_script_dict)
489433
def do_add(self, subcmd, opts, *args):
        
        print "'svn %s' opts: %s" % (subcmd, opts)
        print "'svn %s' args: %s" % (subcmd, args)
1282731
def add(entry_point, all_entry_points, auto_write, scripts_path):
    ''''''

    click.echo()
    if not entry_point and not all_entry_points:
        raise click.UsageError(
            'Missing required option: --entry_point or --all_entry_points'
        )
    if not os.path.exists('setup.py'):
        raise click.UsageError('No setup.py found.')

    setup_data = parse_setup('setup.py')
    console_scripts = get_console_scripts(setup_data)

    scripts = []
    if all_entry_points and console_scripts:

        # Make sure our entry points start with py
        for entry in console_scripts:
            if not entry.startswith('py'):
                click.echo('Your python entry_points must start with py.')
                click.echo('Found: ' + entry)
                raise click.Abort()

        for entry in console_scripts:
            click.echo('Found entry_point: ' + entry)
            py_entry_point = entry
            entry_point = entry[2:]
            more_scripts = copy_templates(
                entry_point,
                py_entry_point,
                auto_write,
                scripts_path
            )

            for script in more_scripts:
                click.echo('    Created ' + script)

            scripts.extend(more_scripts)

    elif entry_point:
        if not entry_point.startswith('py'):
            click.echo('Your python entry_points must start with py.')
            raise click.Abort()
        if entry_point not in console_scripts:
            click.echo(entry_point + ' not found in your setups entry_points')
            click.echo('You will need to add it afterward if you continue...')
            click.echo('')
            click.confirm('Do you want to continue?', abort=True)

        click.echo('\nCreating scripts for: ' + entry_point)
        py_entry_point = entry_point
        entry_point = entry_point[2:]
        more_scripts = copy_templates(
            entry_point,
            py_entry_point,
            auto_write,
            scripts_path
        )

        for script in more_scripts:
            click.echo('    Created ' + script)

        scripts.extend(more_scripts)

    click.echo('\n\nAdd the following section to your package setup:\n')
    click.echo('scripts=[')
    for script in scripts:
        click.echo("    '{}',".format(script))
    click.echo('],')
1202030
def AddSlur(self, item):
        '''
        
        '''
        if not hasattr(self, "slurs"):
            self.slurs = []
        self.slurs.append(item)
958466
public void addScriptFunction(ScriptPlacement placement, String script)
    {
        assert (script != null) : "The paramter 'script' must not be null";
        IScriptReporter sr = getParentScriptReporter();
        if (sr != null) {
            sr.addScriptFunction(placement, script);
            return;
        }

        // get the list of function blocks and add this script to it.
        if (placement == null || placement == ScriptPlacement.PLACE_INFRAMEWORK) {
            if (_funcBlocks == null) {
                _funcBlocks = new ArrayList/*<String>*/();
            }
            assert (_funcBlocks != null) : "_funcBlocks should not be null";
            _funcBlocks.add(script);
        }
        else if (placement == ScriptPlacement.PLACE_BEFORE) {
            if (_codeBefore == null)
                _codeBefore = new ArrayList/*<String>*/();
            _codeBefore.add(script);
        }
        else if (placement == ScriptPlacement.PLACE_AFTER) {
            if (_codeAfter == null)
                _codeAfter = new ArrayList/*<String>*/();
            _codeAfter.add(script);
        }
        else {
            assert(false) : "unsupported placement:" + placement;
        }
    }
132563
def fill_notebook(work_notebook, script_blocks):
    

    for blabel, bcontent, lineno in script_blocks:
        if blabel == 'code':
            add_code_cell(work_notebook, bcontent)
        else:
            add_markdown_cell(work_notebook, bcontent + '\n')
1020203
def add_jsfile(self, src: str) -> None:
        """"""
        self.body.appendChild(Script(src=src))
762775
def add_scripts(self):
        """"""
        common_script = self.node(self.defs, 'script', type='text/javascript')

        def get_js_dict():
            return dict(
                (k, getattr(self.graph.state, k))
                for k in dir(self.graph.config)
                if not k.startswith('_') and hasattr(self.graph.state, k)
                and not hasattr(getattr(self.graph.state, k), '__call__')
            )

        def json_default(o):
            if isinstance(o, (datetime, date)):
                return o.isoformat()
            if hasattr(o, 'to_dict'):
                return o.to_dict()
            return json.JSONEncoder().default(o)

        dct = get_js_dict()
        # Config adds
        dct['legends'] = [
            l.get('title') if isinstance(l, dict) else l
            for l in self.graph._legends + self.graph._secondary_legends
        ]

        common_js = 'window.pygal = window.pygal || {};'
        common_js += 'window.pygal.config = window.pygal.config || {};'
        if self.graph.no_prefix:
            common_js += 'window.pygal.config = '
        else:
            common_js += 'window.pygal.config[%r] = ' % self.graph.uuid

        common_script.text = common_js + json.dumps(dct, default=json_default)

        for js in self.graph.js:
            if js.startswith('file://'):
                script = self.node(self.defs, 'script', type='text/javascript')
                with io.open(js[len('file://'):], encoding='utf-8') as f:
                    script.text = f.read()
            else:
                if js.startswith('//') and self.graph.force_uri_protocol:
                    js = '%s:%s' % (self.graph.force_uri_protocol, js)
                self.node(self.defs, 'script', type='text/javascript', href=js)