Add given TI-TXT string `lines`. Set `overwrite` to ``True`` to
        allow already added data to be overwritten.
779247
def add_ti_txt(self, lines, overwrite=False):
        

        address = None
        eof_found = False

        for line in StringIO(lines):
            # Abort if data is found after end of file.
            if eof_found:
                raise Error("bad file terminator")

            line = line.strip()

            if len(line) < 1:
                raise Error("bad line length")

            if line[0] == 'q':
                eof_found = True
            elif line[0] == '@':
                try:
                    address = int(line[1:], 16)
                except ValueError:
                    raise Error("bad section address")
            else:
                # Try to decode the data.
                try:
                    data = bytearray(binascii.unhexlify(line.replace(' ', '')))
                except (TypeError, binascii.Error):
                    raise Error("bad data")

                size = len(data)

                # Check that there are correct number of bytes per
                # line. There should TI_TXT_BYTES_PER_LINE. Only
                # exception is last line of section which may be
                # shorter.
                if size > TI_TXT_BYTES_PER_LINE:
                    raise Error("bad line length")

                if address is None:
                    raise Error("missing section address")

                self._segments.add(_Segment(address,
                                            address + size,
                                            data,
                                            self.word_size_bytes),
                                   overwrite)

                if size == TI_TXT_BYTES_PER_LINE:
                    address += size
                else:
                    address = None

        if not eof_found:
            raise Error("missing file terminator")
1219184
def insertFromMimeData(self, source):
        
        lines = projex.text.nativestring(source.text()).splitlines()
        for i in range(1, len(lines)):
            if not lines[i].startswith('... '):
                lines[i] = '... ' + lines[i]
        
        if len(lines) > 1:
            lines.append('... ')
        
        self.insertPlainText('\n'.join(lines))
790916
def _append_string(self, value, _file):  # pylint: disable=no-self-use
        
        _text = str(value).replace('"', '\\"')
        _labs = ' "{text}"'.format(text=_text)
        _file.write(_labs)
720276
def add_input(self, line):
        
        Deployment.objects.filter(pk=self.id).update(input=CF('input')+line)
1185943
def add(self, data, overwrite=False):
        

        if is_srec(data):
            self.add_srec(data, overwrite)
        elif is_ihex(data):
            self.add_ihex(data, overwrite)
        elif is_ti_txt(data):
            self.add_ti_txt(data, overwrite)
        else:
            raise UnsupportedFileFormatError()
937095
def example_add_line_to_file():
    
    my_file = FileAsObj('/tmp/example_file.txt')
    my_file.add('foo')
    my_file.append('bar')
    # Add a new line to my_file that contains the word 'lol' and print True|False if my_file was changed.
    print(my_file + 'lol')
    # Add line even if it already exists in the file.
    my_file.unique = False
    my_file.add('foo')
315964
def prepend_line(filepath, line):
    
    with open(filepath) as f:
        lines = f.readlines()

    lines.insert(0, line)

    with open(filepath, 'w') as f:
        f.writelines(lines)
1023463
def add(self, variables: Dict[str, str], overwrite: bool=False):
        
        preset_variables = self._project.variables.list()
        preset_variable_keys = [variable.key for variable in preset_variables]

        for key, value in variables.items():
            if key in preset_variable_keys:
                if overwrite:
                    variable = preset_variables[preset_variable_keys.index(key)]
                    variable.value = value
                    variable.save()
            else:
                variable = self._project.variables.create({
                    _VARIABLE_KEY_PROPERTY: key, _VARIABLE_VALUE_PROPERTY: value})
                variable.save()
25749
public void addLine(int startLine, String sourceFile, int repeatCount,
                      int outputLine, int outputIncrement)
  {
    _lines.add(new Line(startLine, sourceFile, repeatCount,
                        outputLine, outputIncrement));
  }
255696
def add_date(self, date):
        
        self.lines = self.parser.add_date(date, self.lines)
97516
def add_text(self, text):
        """"""
        index = self.findText(text)
        while index != -1:
            self.removeItem(index)
            index = self.findText(text)
        self.insertItem(0, text)
        index = self.findText('')
        if index != -1:
            self.removeItem(index)
            self.insertItem(0, '')
            if text != '':
                self.setCurrentIndex(1)
            else:
                self.setCurrentIndex(0)
        else:
            self.setCurrentIndex(0)
1130802
def add_line(self, sentences, line_number=None):
        
        self.bytes += self.line(sentences, line_number)
616906
def add_str(window, line_num, str):
    
    try:
        window.addstr(line_num, 0, str)
    except curses.error:
        pass
511883
def set_lines( lines, target_level, indent_string="    ", indent_empty_lines=False ):
    

    first_non_empty_line_index = _get_first_non_empty_line_index( lines )
    first_line_original_level =  get_line_level( lines[first_non_empty_line_index], indent_string )

    for i in range(first_non_empty_line_index, len(lines)):
        if not indent_empty_lines and lines[i] == "":
            continue

        line_i_unindented = get_line_unindented( lines[i], indent_string )
        line_i_level =      get_line_level( lines[i], indent_string )

        on_second_line_or_later = i > first_non_empty_line_index
        if on_second_line_or_later:
            first_line_final_level = get_line_level( lines[first_non_empty_line_index], indent_string )
            relative_indent_move =   first_line_final_level - first_line_original_level
            target_level =           line_i_level + relative_indent_move

        if line_i_level == target_level:
            continue

        lines[i] = indent_string * target_level + line_i_unindented
1168807
def add_line_with_subsequent_indent(self, line, indent=4):
        
        if isinstance(line, (list, tuple)):
            line = ''.join(line)
        line = line.strip()
        width = self.textwidth-self.indent-indent
        wrapped_lines = textwrap.wrap(line[indent:], width=width)
        for i in range(len(wrapped_lines)):
            if wrapped_lines[i] != '':
                wrapped_lines[i] = indent * ' ' + wrapped_lines[i]
        self.pieces.append(line[:indent] + '\n'.join(wrapped_lines)[indent:] + '  \n')
267673
public void addLine(String line) {
        int sep = line.indexOf('=');
        if(sep > 0) {
            put(line.substring(0,sep),line.substring(sep+1));
        }
    }
37182
def add_output(self, line):
        
        Deployment.objects.filter(pk=self.id).update(output=CF('output')+line)