unicornpaint

A web-based painting app for raspberry PI and pimoroni Unicorn Hat HD
Log | Files | Refs | README

bindata.go (11965B)


      1 // Code generated by go-bindata. DO NOT EDIT.
      2 // sources:
      3 // data/sample.gif
      4 // data/sample2.gif
      5 package unicorn
      6 
      7 import (
      8 	"bytes"
      9 	"compress/gzip"
     10 	"fmt"
     11 	"io"
     12 	"io/ioutil"
     13 	"os"
     14 	"path/filepath"
     15 	"strings"
     16 	"time"
     17 )
     18 
     19 func bindataRead(data []byte, name string) ([]byte, error) {
     20 	gz, err := gzip.NewReader(bytes.NewBuffer(data))
     21 	if err != nil {
     22 		return nil, fmt.Errorf("Read %q: %v", name, err)
     23 	}
     24 
     25 	var buf bytes.Buffer
     26 	_, err = io.Copy(&buf, gz)
     27 	clErr := gz.Close()
     28 
     29 	if err != nil {
     30 		return nil, fmt.Errorf("Read %q: %v", name, err)
     31 	}
     32 	if clErr != nil {
     33 		return nil, err
     34 	}
     35 
     36 	return buf.Bytes(), nil
     37 }
     38 
     39 type asset struct {
     40 	bytes []byte
     41 	info  os.FileInfo
     42 }
     43 
     44 type bindataFileInfo struct {
     45 	name    string
     46 	size    int64
     47 	mode    os.FileMode
     48 	modTime time.Time
     49 }
     50 
     51 func (fi bindataFileInfo) Name() string {
     52 	return fi.name
     53 }
     54 func (fi bindataFileInfo) Size() int64 {
     55 	return fi.size
     56 }
     57 func (fi bindataFileInfo) Mode() os.FileMode {
     58 	return fi.mode
     59 }
     60 func (fi bindataFileInfo) ModTime() time.Time {
     61 	return fi.modTime
     62 }
     63 func (fi bindataFileInfo) IsDir() bool {
     64 	return false
     65 }
     66 func (fi bindataFileInfo) Sys() interface{} {
     67 	return nil
     68 }
     69 
     70 var _dataSampleGif = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x93\xb1\x8b\x24\x45\x14\xc6\x3f\xef\x0e\x6f\x0e\x9d\x73\x47\x0d\x9c\xc3\x64\xe6\x98\x40\x3c\x44\x6e\x40\xee\x14\x11\xb1\x76\x8e\x92\x76\x5b\xb9\x7b\x61\x07\x1e\xd2\x62\x28\x08\x6d\x20\xb2\xc8\xe8\x15\xee\x8a\x0b\x1d\x48\x25\x8d\xa2\xd1\xcb\x5c\x35\xb1\x44\x10\x84\x65\xe1\x09\x86\x9b\x94\xa8\x20\x1a\x2c\x85\x60\xe2\x82\x50\xf2\x2a\xd2\xff\x61\x27\x79\x1f\xef\x4d\xf0\xd5\xaf\xbf\xef\x86\x5d\x5d\xbb\xfe\xf2\x06\x36\x00\x60\x96\xef\xd9\xda\xbc\x75\xf3\xb9\x67\x5f\xdc\xbc\xfa\xd8\xe3\x67\xef\xd2\xd5\xc9\x39\x5c\x05\x70\x45\xef\xfa\xb7\x3b\x2a\x60\x00\x07\x88\x4e\x63\x60\x1c\x8c\xe8\xc2\x19\x38\x07\x27\x10\x40\x0c\xc4\x41\x04\x31\x4e\x26\x13\x80\x00\x0f\x44\x9d\x44\xa8\x3c\x6c\xd4\x85\xaf\xe0\x3d\xfa\x88\x08\x44\x8b\xd8\x23\x0d\x48\x69\x3e\x9f\x03\x2d\xc0\x40\xd2\xd9\xb6\x20\x46\x9d\x74\xc1\x04\x66\x0c\x09\x09\x48\x35\x32\x21\x33\x72\x5e\x2e\x97\x40\x07\x04\x20\xeb\xec\x3a\x34\x01\x94\x75\x11\x1a\x84\x00\xce\xc8\x30\xea\xd8\x19\x88\x1a\xd7\x9f\x33\x46\xf4\x05\xce\x18\xe7\x8c\x13\x23\x30\x62\x8c\x38\x23\x62\x8a\x6f\x02\x55\xf0\x16\x91\x08\x44\x54\x55\xde\xda\x58\x79\x54\xbe\xaa\xbc\xb7\x7d\xb4\x11\x36\x5a\x1b\x7b\x1b\x63\x9d\x92\xfa\x45\x4b\xe0\x1a\xa9\x6d\xd1\xb6\x2d\x11\xd7\x75\x22\x06\x31\x11\x73\x3d\xa4\x3a\xa1\x4e\x75\x9d\x06\xca\x4c\x39\xab\x5f\x74\x0d\x02\x21\x77\x1d\xba\xae\x6b\x9a\x40\x94\x9b\x80\x26\x34\x4d\x08\xc4\x99\x32\x28\x93\x53\xc4\xa2\xa4\xd5\xba\x73\x46\x14\xb9\x2a\xe7\x9c\x38\x81\x13\xe3\xc4\x39\x11\xfd\x20\x30\x6a\x13\xbe\x47\x54\xd2\x55\xe5\x2b\xdf\xdb\xe8\x3d\xbc\xaf\xbc\xf7\x7d\x1f\xfb\x88\x3e\xda\x3e\xf6\x7d\x8c\xbe\x10\x57\x9b\xe0\x01\x49\x49\x13\x31\xf1\x50\x27\x66\x30\x13\x33\x0f\x43\x1a\x12\x86\x54\x0f\x69\x18\x52\xe2\x9c\x15\xb0\xb2\x0e\x8c\xac\xa4\x9b\x26\x34\x81\x29\x87\x80\x10\x9a\x10\x02\x73\xe6\x0c\xce\xc4\x99\x05\x8a\x55\x0a\x74\x31\xea\x52\xca\x1b\xc4\x89\x94\x9b\x14\x25\x25\x5e\x02\x17\x4b\x38\x34\x1a\xd6\xc6\xc2\x3a\xf6\x50\xd2\xc5\x7a\x2c\xb7\x58\x94\x26\x08\x56\xb9\x96\x70\xa4\x1a\x0a\xb8\xb0\xd6\x4c\x0d\x75\x2a\xd6\x53\xb9\xa5\xa2\x92\x66\x05\xca\xb5\x84\x43\xa3\x44\x94\x0b\x6b\xcd\x14\x53\x2e\xd6\x73\xb9\xe5\xa2\x46\x5b\xff\x9c\xbb\xf8\xf0\x08\xdb\xe3\xf5\xe8\x64\xfa\xca\xd1\x8f\x9f\x7c\xf0\xee\xc5\xc5\xa5\xf5\xb5\xd7\x6f\x6f\xee\x9c\x7f\xe0\xf6\x37\x47\x7b\x9f\xae\xd6\xe7\x9f\x5e\xbd\xf5\xd0\xfe\xec\x70\xe7\x89\x2b\xfc\xe0\xe1\xde\x6f\xcf\x7f\x38\x5d\x7c\x7b\xfc\xc7\xfd\xdb\xf7\x4e\x1f\xa5\xfd\xef\x1f\xf9\x62\xb6\xf5\xf1\xf5\xf1\xdd\xe3\x4b\x1b\xa7\x15\x3b\xad\xd8\x69\xc5\xfe\x5f\xb1\x5b\x7f\x95\x8a\xe1\xcc\x7a\xf4\xbb\x56\x6c\xf6\xce\x7f\x2b\xf6\x93\x7b\xf3\xf3\xd9\xea\xfd\x0b\xf7\xbd\x7d\xfc\xf7\xe4\xbb\xf1\x9d\xc5\x62\xfe\xa5\xdb\xfe\xf5\x60\xf7\xf2\xf4\xeb\xdd\x0b\xcb\xcb\x3f\x7c\xf4\xcc\xcf\x5f\xbd\x61\x6f\xbe\xfa\xc2\x7b\x4f\xfe\x32\x8e\xaf\xfd\x79\xf0\xd2\x67\x37\xce\x9e\xc1\x53\xff\x06\x00\x00\xff\xff\x92\xfe\xa3\x1e\xed\x06\x00\x00")
     71 
     72 func dataSampleGifBytes() ([]byte, error) {
     73 	return bindataRead(
     74 		_dataSampleGif,
     75 		"data/sample.gif",
     76 	)
     77 }
     78 
     79 func dataSampleGif() (*asset, error) {
     80 	bytes, err := dataSampleGifBytes()
     81 	if err != nil {
     82 		return nil, err
     83 	}
     84 
     85 	info := bindataFileInfo{name: "data/sample.gif", size: 1773, mode: os.FileMode(420), modTime: time.Unix(1527504134, 0)}
     86 	a := &asset{bytes: bytes, info: info}
     87 	return a, nil
     88 }
     89 
     90 var _dataSample2Gif = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x93\xb1\x8b\x5d\x45\x14\xc6\x3f\x31\xe8\x26\x0a\xee\x53\x14\x0b\x0b\xf3\x60\x21\x48\x90\xe4\x2d\x0b\x6a\x6c\xd6\xcc\x8b\x0c\xde\xcd\x2c\xea\x41\x2d\x2e\x6a\xb2\x5c\x08\xd8\x68\x91\x5b\x5a\xf8\xc4\x09\xa6\x30\xb9\x46\x1c\x08\x97\xd5\x05\x8b\xd3\x0a\x0b\x32\x8d\x5b\xb9\xc5\x01\xc5\x46\xb7\x18\xb0\x11\xb4\x19\x14\x04\x95\x45\x47\xce\x80\x45\xfe\x87\x7d\xcd\x39\x9c\xf3\x8a\xdf\xfc\xee\x77\x9e\xb7\x17\x9e\x7a\xfa\xcd\x65\x2c\x03\xc0\xc9\x72\xdf\xc5\xf9\xcb\x2f\x9d\x5f\xdf\x9c\xcf\x9e\x3c\x73\xf7\x5d\x3a\xfa\xfb\x18\x66\x00\x4e\xeb\x5e\xff\xf6\x81\x36\x30\x80\x07\x44\xab\x31\x30\x1e\x46\x74\xe0\x0d\xbc\x87\x17\x08\x20\x06\xe2\x21\x82\x94\x26\x93\x09\x40\x40\x00\x92\x56\x22\x34\x01\x36\xe9\x20\x34\x08\x01\x43\x42\x02\x92\x45\x1a\x90\x47\xe4\x3c\x9d\x4e\x81\x0e\x60\x20\x6b\xed\x3a\x10\xc3\x65\x1d\x30\x81\x19\x63\x46\x06\xb2\x43\x21\x14\x46\x29\xab\xab\xab\x40\x0f\x44\xa0\x68\xed\x7b\xb4\x11\x54\x74\x10\x5b\xc4\x08\x2e\x28\x30\x4a\xec\x0d\x44\xc1\xf5\xe7\x8d\x11\x7d\x81\x37\xc6\x7b\xe3\xc5\x08\x8c\x18\x23\xde\x88\x98\xca\x4d\xa0\x06\xc1\x22\x11\x81\x88\x9a\x26\x58\x9b\x9a\x80\x26\x34\x4d\x08\x76\x48\x36\xc1\x26\x6b\xd3\x60\x53\x72\x39\x2b\x2f\x3a\x02\x3b\xe4\xae\x43\xd7\x75\x44\xec\x5c\x26\x06\x31\x11\xb3\x1b\xb3\xcb\x70\xd9\xb9\x3c\x52\x61\x2a\x45\x79\xd1\xb7\x88\x84\xd2\xf7\xe8\xfb\xbe\x6d\x23\x51\x69\x23\xda\xd8\xb6\x31\x12\x17\x2a\xa0\x42\x5e\x15\x8b\x9a\x56\x74\xef\x8d\xa8\x72\xed\xbc\xf7\xe2\x05\x5e\x8c\x17\xef\x45\xf4\x83\xc0\x28\x26\xc2\x80\xa4\xa6\x9b\x26\x34\x61\xb0\x29\x04\x84\xd0\x84\x10\x86\x21\x0d\x09\x43\xb2\x43\x1a\x86\x94\x42\x35\xae\x98\xe0\x11\x59\x4d\x13\x31\xf1\xe8\x32\x33\x98\x89\x99\xc7\x31\x8f\x19\x63\x76\x63\x1e\xc7\x9c\xb9\x14\x15\xac\xae\x23\xa3\xa8\xe9\xb6\x8d\x6d\x64\x2a\x31\x22\xc6\x36\xc6\xc8\x5c\xb8\x80\x0b\x71\x61\x81\x6a\x95\x2a\x5d\x8c\x52\x4a\x7d\x83\x78\x91\xba\x93\xda\x49\x8d\x97\xc0\xa7\x1a\x0e\x8d\x86\xb5\xa9\xba\x4e\x03\xd4\x74\x45\x4f\x75\x97\x6a\xa7\x09\x82\x55\xaf\x35\x1c\xd9\x41\x05\x57\xd7\x9a\xa9\xd1\xe5\x8a\x9e\xeb\x2e\xd7\x2e\x6b\x56\xa0\x5e\x6b\x38\x34\x4a\x44\xa5\xba\xd6\x4c\x31\x95\x8a\x5e\xea\xae\xd4\x6e\x69\x03\xf8\x71\xf9\xd5\xef\x7e\x5a\x5f\x1c\x7f\xe8\x41\xb3\xbf\xf9\xd9\xf9\xf7\x27\x2b\x17\x1f\xfb\x6b\x73\xfa\x65\x2b\xa7\x66\x87\x7f\x3e\x70\xf9\xb9\xeb\x72\xe6\xea\x1f\xa7\x66\x3b\x5f\xdf\x28\x57\x6f\x6c\xfd\x3a\xc1\x37\x9f\x9c\x3d\xf7\xc5\xc7\x07\xb3\xcb\x1b\x37\x4f\x6e\xe4\x85\x7d\xe7\x87\xf9\xad\xe9\xda\x89\xfb\x97\x8e\x2e\xec\xe8\xc2\x8e\x2e\xec\xce\x0b\x7b\xfd\xff\x0b\xc3\x89\x63\x4f\x98\xfd\xdf\x1e\xdf\x5b\x60\x6b\x69\xe1\x3f\xfa\x7c\x7e\xed\xd1\xb5\x67\x9e\xdd\xff\xfd\xd2\x85\xf7\x1e\x5e\x7f\x64\x6b\xf7\xc3\x83\xbd\x6b\xf7\x86\x7f\x0e\x5f\xf9\xfe\x92\xed\x56\x5e\xdb\xbd\x7e\xe5\xc5\x6d\x79\x37\x76\xf9\xad\xe3\x6f\xac\xb8\xed\xd3\x6f\xdf\xf3\xf3\x95\x9b\xbf\x34\x9f\xae\xdd\xfa\xf7\xf6\x57\x2f\xec\x7c\x7b\xfb\xac\xd3\x9b\x3b\xf7\x5f\x00\x00\x00\xff\xff\x24\xe4\xf7\x2e\xf7\x06\x00\x00")
     91 
     92 func dataSample2GifBytes() ([]byte, error) {
     93 	return bindataRead(
     94 		_dataSample2Gif,
     95 		"data/sample2.gif",
     96 	)
     97 }
     98 
     99 func dataSample2Gif() (*asset, error) {
    100 	bytes, err := dataSample2GifBytes()
    101 	if err != nil {
    102 		return nil, err
    103 	}
    104 
    105 	info := bindataFileInfo{name: "data/sample2.gif", size: 1783, mode: os.FileMode(420), modTime: time.Unix(1527519351, 0)}
    106 	a := &asset{bytes: bytes, info: info}
    107 	return a, nil
    108 }
    109 
    110 // Asset loads and returns the asset for the given name.
    111 // It returns an error if the asset could not be found or
    112 // could not be loaded.
    113 func Asset(name string) ([]byte, error) {
    114 	cannonicalName := strings.Replace(name, "\\", "/", -1)
    115 	if f, ok := _bindata[cannonicalName]; ok {
    116 		a, err := f()
    117 		if err != nil {
    118 			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
    119 		}
    120 		return a.bytes, nil
    121 	}
    122 	return nil, fmt.Errorf("Asset %s not found", name)
    123 }
    124 
    125 // MustAsset is like Asset but panics when Asset would return an error.
    126 // It simplifies safe initialization of global variables.
    127 func MustAsset(name string) []byte {
    128 	a, err := Asset(name)
    129 	if err != nil {
    130 		panic("asset: Asset(" + name + "): " + err.Error())
    131 	}
    132 
    133 	return a
    134 }
    135 
    136 // AssetInfo loads and returns the asset info for the given name.
    137 // It returns an error if the asset could not be found or
    138 // could not be loaded.
    139 func AssetInfo(name string) (os.FileInfo, error) {
    140 	cannonicalName := strings.Replace(name, "\\", "/", -1)
    141 	if f, ok := _bindata[cannonicalName]; ok {
    142 		a, err := f()
    143 		if err != nil {
    144 			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
    145 		}
    146 		return a.info, nil
    147 	}
    148 	return nil, fmt.Errorf("AssetInfo %s not found", name)
    149 }
    150 
    151 // AssetNames returns the names of the assets.
    152 func AssetNames() []string {
    153 	names := make([]string, 0, len(_bindata))
    154 	for name := range _bindata {
    155 		names = append(names, name)
    156 	}
    157 	return names
    158 }
    159 
    160 // _bindata is a table, holding each asset generator, mapped to its name.
    161 var _bindata = map[string]func() (*asset, error){
    162 	"data/sample.gif": dataSampleGif,
    163 	"data/sample2.gif": dataSample2Gif,
    164 }
    165 
    166 // AssetDir returns the file names below a certain
    167 // directory embedded in the file by go-bindata.
    168 // For example if you run go-bindata on data/... and data contains the
    169 // following hierarchy:
    170 //     data/
    171 //       foo.txt
    172 //       img/
    173 //         a.png
    174 //         b.png
    175 // then AssetDir("data") would return []string{"foo.txt", "img"}
    176 // AssetDir("data/img") would return []string{"a.png", "b.png"}
    177 // AssetDir("foo.txt") and AssetDir("notexist") would return an error
    178 // AssetDir("") will return []string{"data"}.
    179 func AssetDir(name string) ([]string, error) {
    180 	node := _bintree
    181 	if len(name) != 0 {
    182 		cannonicalName := strings.Replace(name, "\\", "/", -1)
    183 		pathList := strings.Split(cannonicalName, "/")
    184 		for _, p := range pathList {
    185 			node = node.Children[p]
    186 			if node == nil {
    187 				return nil, fmt.Errorf("Asset %s not found", name)
    188 			}
    189 		}
    190 	}
    191 	if node.Func != nil {
    192 		return nil, fmt.Errorf("Asset %s not found", name)
    193 	}
    194 	rv := make([]string, 0, len(node.Children))
    195 	for childName := range node.Children {
    196 		rv = append(rv, childName)
    197 	}
    198 	return rv, nil
    199 }
    200 
    201 type bintree struct {
    202 	Func     func() (*asset, error)
    203 	Children map[string]*bintree
    204 }
    205 var _bintree = &bintree{nil, map[string]*bintree{
    206 	"data": &bintree{nil, map[string]*bintree{
    207 		"sample.gif": &bintree{dataSampleGif, map[string]*bintree{}},
    208 		"sample2.gif": &bintree{dataSample2Gif, map[string]*bintree{}},
    209 	}},
    210 }}
    211 
    212 // RestoreAsset restores an asset under the given directory
    213 func RestoreAsset(dir, name string) error {
    214 	data, err := Asset(name)
    215 	if err != nil {
    216 		return err
    217 	}
    218 	info, err := AssetInfo(name)
    219 	if err != nil {
    220 		return err
    221 	}
    222 	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
    223 	if err != nil {
    224 		return err
    225 	}
    226 	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
    227 	if err != nil {
    228 		return err
    229 	}
    230 	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
    231 	if err != nil {
    232 		return err
    233 	}
    234 	return nil
    235 }
    236 
    237 // RestoreAssets restores an asset under the given directory recursively
    238 func RestoreAssets(dir, name string) error {
    239 	children, err := AssetDir(name)
    240 	// File
    241 	if err != nil {
    242 		return RestoreAsset(dir, name)
    243 	}
    244 	// Dir
    245 	for _, child := range children {
    246 		err = RestoreAssets(dir, filepath.Join(name, child))
    247 		if err != nil {
    248 			return err
    249 		}
    250 	}
    251 	return nil
    252 }
    253 
    254 func _filePath(dir, name string) string {
    255 	cannonicalName := strings.Replace(name, "\\", "/", -1)
    256 	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
    257 }
    258