Stores the CODEPAGE biff record.
767277
private function _writeCodepage()
	{
		$record          = 0x0042;             // Record identifier
		$length          = 0x0002;             // Number of bytes to follow
		$cv              = $this->_codepage;   // The code page

		$header          = pack('vv', $record, $length);
		$data            = pack('v',  $cv);

		$this->_append($header . $data);
	}
335253
function _storeMarginBottom()
    {
        $record  = 0x0029;                   // Record identifier
        $length  = 0x0008;                   // Bytes to follow

        $margin  = $this->_margin_bottom;     // Margin in inches

        $header    = pack("vv",  $record, $length);
        $data      = pack("d",   $margin);
        if ($this->_byte_order) { // if it's Big Endian
            $data = strrev($data);
        }

        $this->_prepend($header . $data);
    }
663365
function _storeDimensions()
    {
        $record    = 0x0200;                 // Record identifier
        $row_min   = $this->_dim_rowmin;     // First row
        $row_max   = $this->_dim_rowmax + 1; // Last row plus 1
        $col_min   = $this->_dim_colmin;     // First column
        $col_max   = $this->_dim_colmax + 1; // Last column plus 1
        $reserved  = 0x0000;                 // Reserved by Excel

        if ($this->_BIFF_version == 0x0500) {
            $length    = 0x000A;               // Number of bytes to follow
            $data      = pack("vvvvv", $row_min, $row_max,
                                       $col_min, $col_max, $reserved);
        } elseif ($this->_BIFF_version == 0x0600) {
            $length    = 0x000E;
            $data      = pack("VVvvv", $row_min, $row_max,
                                       $col_min, $col_max, $reserved);
        }
        $header = pack("vv", $record, $length);
        $this->_prepend($header.$data);
    }
1335891
function _storeWsbool()
    {
        $record      = 0x0081;   // Record identifier
        $length      = 0x0002;   // Bytes to follow
        $grbit       = 0x0000;

        // The only option that is of interest is the flag for fit to page. So we
        // set all the options in one go.
        //
        /*if ($this->_fit_page) {
            $grbit = 0x05c1;
        } else {
            $grbit = 0x04c1;
        }*/
        // Set the option flags
        $grbit |= 0x0001;                           // Auto page breaks visible
        if ($this->_outline_style) {
            $grbit |= 0x0020; // Auto outline styles
        }
        if ($this->_outline_below) {
            $grbit |= 0x0040; // Outline summary below
        }
        if ($this->_outline_right) {
            $grbit |= 0x0080; // Outline summary right
        }
        if ($this->_fit_page) {
            $grbit |= 0x0100; // Page setup fit to page
        }
        if ($this->_outline_on) {
            $grbit |= 0x0400; // Outline symbols displayed
        }

        $header = pack("vv", $record, $length);
        $data   = pack("v",  $grbit);
        $this->_prepend($header . $data);
    }
36770
def write_record(self, event_str):
        """"""
        header = struct.pack('Q', len(event_str))
        header += struct.pack('I', masked_crc32c(header))
        footer = struct.pack('I', masked_crc32c(event_str))
        self._writer.write(header + event_str + footer)
98249
function _storeEof()
	{
		$record    = 0x000A;   // Record identifier
		$length    = 0x0000;   // Number of bytes to follow

		$header    = pack("vv", $record, $length);
		$this->_append($header);
	}
252786
def store(self, value, l, dir_only):
        """"""

        if l and value in (b'', ''):
            return

        globstar = value in (b'**', '**') and self.globstar
        magic = self.is_magic(value)
        if magic:
            value = compile(value, self.flags)
        l.append(WcGlob(value, magic, globstar, dir_only, False))
280422
def store_text(x, y, dx, dy, grbit1, grbit2, rotation = 0x00)# :nodoc:
    record   = 0x1025            # Record identifier.
    length   = 0x0020            # Number of bytes to follow.
    at       = 0x02              # Horizontal alignment.
    vat      = 0x02              # Vertical alignment.
    wBkgMode = 0x0001            # Background display.
    rgbText  = 0x0000            # Text RGB colour.
    # x                          # Text x-pos.
    # y                          # Text y-pos.
    # dx                         # Width.
    # dy                         # Height.
    # grbit1                     # Option flags.
    icvText  = 0x004D            # Auto Colour.
    # grbit2                     # Show legend.
    # rotation                   # Show value.

    header = [record, length].pack('vv')
    data  = [at].pack('C')
    data += [vat].pack('C')
    data += [wBkgMode].pack('v')
    data += [rgbText].pack('V')
    data += [x].pack('V')
    data += [y].pack('V')
    data += [dx].pack('V')
    data += [dy].pack('V')
    data += [grbit1].pack('v')
    data += [icvText].pack('v')
    data += [grbit2].pack('v')
    data += [rotation].pack('v')

    append(header, data)
  end
705363
def store_file(self, filename):
        '''  '''
        
        # Spin up workbench
        self.workbench = zerorpc.Client(timeout=300, heartbeat=60)
        self.workbench.connect("tcp://127.0.0.1:4242")   

        # Open the file and send it to workbench
        storage_name = "streaming_pcap" + str(self.pcap_index)
        print filename, storage_name
        with open(filename,'rb') as f:
            self.workbench.store_sample(f.read(), storage_name, 'pcap')
        self.pcap_index += 1

        # Close workbench client
        self.workbench.close()
1247218
def store_frame(frame_type, grbit)   # :nodoc:
    record     = 0x1032     # Record identifier.
    length     = 0x0004     # Number of bytes to follow.
    # frame_type            # Frame type.
    # grbit                 # Option flags.

    store_simple(record, length, frame_type, grbit)
  end
1291723
function _storeMarginTop()
    {
        $record  = 0x0028;                   // Record identifier
        $length  = 0x0008;                   // Bytes to follow

        $margin  = $this->_margin_top;        // Margin in inches

        $header    = pack("vv",  $record, $length);
        $data      = pack("d",   $margin);
        if ($this->_byte_order) { // if it's Big Endian
            $data = strrev($data);
        }

        $this->_prepend($header . $data);
    }
623195
def store(hdu,dbase='cfeps',duser='cfhls',dtype='MYSQL',table='source'):
    """"""

    import MOPdbaccess
    db=MOPdbaccess.connect(dbase,duser,dbSystem=dtype)
    dbc=db.cursor()

    ### INSERT THE 'HEADER' in the meta-data table
    file_id=hdu['header']['image']
    for key in hdu['header'].keys():
        if key == 'image':
            continue
        value=hdu['header'][key]
        ### require that the file_id+keyword is unique
        sql="DELETE FROM metadata WHERE file_id='%s' and keyword='%s' " % ( file_id, key)
        dbc.execute(sql)
        sql="INSERT INTO metadata (file_id, keyword, value) values ('%s','%s','%s' ) "% ( file_id, key, value)
        dbc.execute(sql)
    db.commit()

    sql="DELETE FROM source WHERE file_id LIKE '%s'  " % ( file_id )
    dbc.execute(sql)

    sql="INSERT INTO %s ( " % ( table)
    sep=" "
    values="("
    cols=hdu['hdu2sql'].keys()
    for col in cols:
        sql+=sep+hdu['hdu2sql'][col]
        values+=sep+" %s " 
        sep=', '
    values+=", '%s', %d, %d )" % ( file_id, int(hdu['header']['EXPNUM']), int(hdu['header']['CHIP'] )-1 )
    sql+=", file_id, expnum, ccd ) VALUES "+values
    #print sql
    #sys.exit()
    #values=[]
    for row in range(len(hdu['data'][cols[0]])):
        value=[]
        for col in cols:
            value.append(hdu['data'][col][row])
        dbc.execute(sql,value)
        
    sql="""insert into source_idx ( sourceID, x, y, z ) SELECT sourceID, 
           (360.0*COS(RADIANS(raDeg))*COS(RADIANS(decDeg))),
           (360.0*SIN(RADIANS(raDeg))*COS(RADIANS(decDeg))),
           (360.0*SIN(RADIANS(decDeg))) FROM source  WHERE file_id='%s'""" % (file_id)

    dbc.execute(sql)
    db.commit()

    return
731568
function _storeCountry()
    {
        $record          = 0x008C;    // Record identifier
        $length          = 4;         // Number of bytes to follow

        $header = pack('vv',  $record, $length);
        /* using the same country code always for simplicity */
        $data = pack('vv', $this->_country_code, $this->_country_code);
        $this->_append($header . $data);
    }
11397
function _storeFooter()
    {
        $record  = 0x0015;               // Record identifier

        $str      = $this->_footer;       // Footer string
        $cch      = strlen($str);         // Length of footer string
        if ($this->_BIFF_version == 0x0600) {
            $encoding = 0x0;                  // TODO: Unicode support
            $length   = 3 + $cch;             // Bytes to follow
        } else {
            $length  = 1 + $cch;
        }

        $header    = pack("vv", $record, $length);
        if ($this->_BIFF_version == 0x0600) {
            $data      = pack("vC",  $cch, $encoding);
        } else {
            $data      = pack("C",  $cch);
        }

        $this->_prepend($header . $data . $str);
    }
1216556
def record_to_fs(self):
        """"""

        fr = self.record

        if fr.contents:
            with self._fs.open(self.file_name, 'w', encoding='utf-8') as f:
                self.record_to_fh(f)
1310379
function _storeBoundsheet($sheetname,$offset)
    {
        $record    = 0x0085;                    // Record identifier
        if ($this->_BIFF_version == 0x0600) {
            $length    = 0x08 + strlen($sheetname); // Number of bytes to follow
        } else {
            $length = 0x07 + strlen($sheetname); // Number of bytes to follow
        }

        $grbit     = 0x0000;                    // Visibility and sheet type
        $cch       = strlen($sheetname);        // Length of sheet name

        $header    = pack("vv",  $record, $length);
        if ($this->_BIFF_version == 0x0600) {
            $data      = pack("Vvv", $offset, $grbit, $cch);
        } else {
            $data      = pack("VvC", $offset, $grbit, $cch);
        }
        $this->_append($header.$data.$sheetname);
    }
592821
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('ER record not yet initialized!')

        return b'ER' + struct.pack('=BBBBBB', RRERRecord.length(self.ext_id, self.ext_des, self.ext_src), SU_ENTRY_VERSION, len(self.ext_id), len(self.ext_des), len(self.ext_src), self.ext_ver) + self.ext_id + self.ext_des + self.ext_src