summaryrefslogtreecommitdiffstats
path: root/package/video/icon.svg
blob: 905d46f661695b0aa876eebacb6d804471c69c33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.1"
   id="Settings_Active"
   x="0px"
   y="0px"
   viewBox="0 0 300 300"
   style="enable-background:new 0 0 300 300;"
   xml:space="preserve"
   inkscape:version="0.91 r13725"
   sodipodi:docname="video_inactive.svg"><metadata
     id="metadata5903"><rdf:RDF><cc:Work
         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
     id="defs5901" /><sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="1551"
     inkscape:window-height="804"
     id="namedview5899"
     showgrid="false"
     inkscape:zoom="0.78666667"
     inkscape:cx="-90.254237"
     inkscape:cy="150"
     inkscape:window-x="0"
     inkscape:window-y="27"
     inkscape:window-maximized="0"
     inkscape:current-layer="Settings_Active" /><style
     type="text/css"
     id="style5867">
	.st0{fill:url(#SVGID_1_);}
	.st1{fill:#231F20;}
	.st2{fill:none;stroke:url(#SVGID_2_);stroke-width:4;stroke-miterlimit:10;}
	.st3{fill:none;stroke:url(#SVGID_3_);stroke-width:4;stroke-miterlimit:10;}
	.st4{fill:none;stroke:url(#SVGID_4_);stroke-width:4;stroke-miterlimit:10;}
	.st5{fill:url(#SVGID_5_);}
	.st6{fill:none;stroke:url(#SVGID_6_);stroke-width:4;stroke-miterlimit:10;}
</style><g
     id="g5869"
     transform="matrix(1.3314132,0,0,1.3314313,5.608242,5.2068449)"><linearGradient
       id="SVGID_1_"
       gradientUnits="userSpaceOnUse"
       x1="-47.346401"
       y1="263.00369"
       x2="269.0914"
       y2="-40.3484"
       gradientTransform="matrix(1,0.00546456,-0.00546456,1,-2.3177,-2.7461)"><stop
         offset="0"
         style="stop-color:#00ADDC"
         id="stop5872" /><stop
         offset="1"
         style="stop-color:#6BFBFF"
         id="stop5874" /></linearGradient><path
       class="st0"
       d="m 108.5,213.9 c -0.2,0 -0.4,0 -0.6,0 C 49.9,213.5 3,166.1 3.3,108.1 3.6,50.4 50.7,3.6 108.4,3.6 c 0.2,0 0.4,0 0.6,0 58,0.3 104.9,47.7 104.6,105.7 l 0,0 c -0.3,57.8 -47.4,104.6 -105.1,104.6 z M 108.4,7.2 C 52.7,7.2 7.3,52.4 7,108.2 c -0.3,55.9 45,101.7 100.9,102 0.2,0 0.4,0 0.6,0 C 164.2,210.2 209.7,165 210,109.3 210.3,53.4 165,7.6 109.1,7.3 108.8,7.2 108.6,7.2 108.4,7.2 Z"
       id="path5876"
       style="fill:url(#SVGID_1_)"
       inkscape:connector-curvature="0" /></g><g
     id="g5878"
     transform="matrix(1.3314132,0,0,1.3314313,5.608242,5.2068449)"><g
       id="g5880"><g
         id="L7oFcc.tif"><g
           id="g5883"><linearGradient
             id="SVGID_2_"
             gradientUnits="userSpaceOnUse"
             x1="95.694397"
             y1="108.712"
             x2="131.1936"
             y2="108.712"><stop
               offset="0"
               style="stop-color:#00ADDC"
               id="stop5886" /><stop
               offset="1"
               style="stop-color:#6BFBFF"
               id="stop5888" /></linearGradient><path
             style="fill:url(#SVGID_2_)"
             d="m 95.7,108.5 c 0,-6 0,-11.9 0,-17.9 0,-4.3 1.1,-5 4.7,-2.8 9.5,6 18.9,12 28.3,18 3.3,2.1 3.3,3.5 0,5.6 -9.4,6.1 -18.8,12.1 -28.3,18.1 -3.5,2.2 -4.6,1.5 -4.7,-2.8 0,-6 0,-12.1 0,-18.2 z m 4.8,-16 c -1.7,0 -1.3,1.2 -1.3,2.1 0,9.4 0,18.8 -0.1,28.1 0,3 1,2.6 2.9,1.4 7,-4.5 13.9,-9 21,-13.3 2.6,-1.6 2.3,-2.5 -0.1,-4 -6.9,-4.3 -13.8,-8.8 -20.7,-13.1 -0.5,-0.5 -1.1,-0.9 -1.7,-1.2 z"
             id="path5890"
             inkscape:connector-curvature="0" /></g></g></g><linearGradient
       id="SVGID_3_"
       gradientUnits="userSpaceOnUse"
       x1="45.1595"
       y1="108.712"
       x2="171.7285"
       y2="108.712"><stop
         offset="0"
         style="stop-color:#00ADDC"
         id="stop5893" /><stop
         offset="1"
         style="stop-color:#6BFBFF"
         id="stop5895" /></linearGradient><path
       class="st3"
       d="m 169.7,95.5 0,36.9 c 0,11.6 -9.5,21 -21,21 l -80.5,0 c -11.6,0 -21,-9.5 -21,-21 l 0,-47.4 c 0,-11.6 9.5,-21 21,-21 l 80.5,0 c 7,0 13.3,3.5 17.1,8.8"
       id="path5897"
       style="fill:none;stroke:url(#SVGID_3_);stroke-width:4;stroke-miterlimit:10"
       inkscape:connector-curvature="0" /></g></svg>
="cm"> * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package main import ( "fmt" "os" "regexp" "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git/lib/xaapiv1" "github.com/urfave/cli" ) func initCmdSdks(cmdDef *[]cli.Command) { *cmdDef = append(*cmdDef, cli.Command{ Name: "sdks", Aliases: []string{"sdk"}, HideHelp: true, Usage: "SDKs commands group", Subcommands: []cli.Command{ { Name: "get", Usage: "Get a property of a SDK", Action: sdksGet, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Usage: "sdk id", EnvVar: "XDS_SDK_ID", }, }, }, { Name: "list", Aliases: []string{"ls"}, Usage: "List installed SDKs", Action: sdksList, Flags: []cli.Flag{ cli.BoolFlag{ Name: "all, a", Usage: "display all existing sdks (installed + downloadable)", }, cli.StringFlag{ Name: "filter, f", Usage: "regexp to filter output (filtering done only on ID, Name, Version and Arch fields) ", }, cli.BoolFlag{ Name: "verbose, v", Usage: "display verbose output", }, }, }, { Name: "install", Aliases: []string{"i"}, Usage: "Install a SDK", Action: sdksInstall, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Usage: "sdk id to install", EnvVar: "XDS_SDK_ID", }, cli.StringFlag{ Name: "file, f", Usage: "use this file to install SDK", }, cli.BoolFlag{ Name: "debug", Usage: "enable debug mode (useful to investigate install issue)", }, cli.BoolFlag{ Name: "force", Usage: "force SDK installation when already installed", }, }, }, { Name: "uninstall", Aliases: []string{"rm"}, Usage: "UnInstall an existing SDK", Action: sdksUnInstall, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Usage: "sdk id to un-install", EnvVar: "XDS_SDK_ID", }, cli.BoolFlag{ Name: "force, f", Usage: "remove confirmation prompt before removal", }, }, }, { Name: "abort", Aliases: []string{"a"}, Usage: "Abort an install action", Action: sdksAbort, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Usage: "sdk id to which abort action", EnvVar: "XDS_SDK_ID", }, }, }, }, }) } func sdksList(ctx *cli.Context) error { // Get SDKs list sdks := []xaapiv1.SDK{} if err := _sdksListGet(&sdks); err != nil { return cli.NewExitError(err.Error(), 1) } _displaySdks(sdks, ctx.Bool("verbose"), ctx.Bool("all"), ctx.String("filter")) return nil } func sdksGet(ctx *cli.Context) error { id := GetID(ctx) if id == "" { return cli.NewExitError("id parameter or option must be set", 1) } sdks := xaapiv1.SDK{} url := XdsServerComputeURL("/sdks/" + id) if err := HTTPCli.Get(url, &sdks); err != nil { return cli.NewExitError(err.Error(), 1) } _displaySdks([]xaapiv1.SDK{sdks}, true, true, "") return nil } func _displaySdks(sdks []xaapiv1.SDK, verbose bool, all bool, filter string) { // Display result first := true writer := NewTableWriter() for _, s := range sdks { if s.Status != xaapiv1.SdkStatusInstalled && s.Status != xaapiv1.SdkStatusInstalling && !all { continue } if filter != "" { re := regexp.MustCompile(filter) if !(re.MatchString(s.ID) || re.MatchString(s.Name) || re.MatchString(s.Profile) || re.MatchString(s.Arch) || re.MatchString(s.Version)) { continue } } if verbose { if !first { fmt.Fprintln(writer) } fmt.Fprintln(writer, "ID\t"+s.ID) fmt.Fprintln(writer, "Name\t"+s.Name) fmt.Fprintln(writer, "Description\t"+s.Description) fmt.Fprintln(writer, "Profile\t"+s.Profile) fmt.Fprintln(writer, "Arch\t"+s.Arch) fmt.Fprintln(writer, "Version\t"+s.Version) fmt.Fprintln(writer, "Status\t"+s.Status) fmt.Fprintln(writer, "Path\t"+s.Path) fmt.Fprintln(writer, "Url\t"+s.URL) } else { if first { if all { fmt.Fprintf(writer, "List of available SDKs: \n") } else { fmt.Fprintf(writer, "List of installed SDKs: \n") } fmt.Fprintf(writer, "ID\t NAME\t STATUS\t VERSION\t ARCH\n") } fmt.Fprintf(writer, "%s\t %s\t %s\t %s\t %s\n", s.ID[:8], s.Name, s.Status, s.Version, s.Arch) } first = false } writer.Flush() } func _sdksListGet(sdks *[]xaapiv1.SDK) error { url := XdsServerComputeURL("/sdks") if err := HTTPCli.Get(url, &sdks); err != nil { return err } Log.Debugf("Result of %s: %v", url, sdks) return nil } func sdksInstall(ctx *cli.Context) error { id := GetID(ctx) file := ctx.String("file") force := ctx.Bool("force") if id == "" && file == "" { return cli.NewExitError("id or file parameter or option must be set", 1) } // Process Socket IO events type exitResult struct { error string code int } exitChan := make(chan exitResult, 1) IOsk.On("disconnection", func(err error) { Log.Debugf("WS disconnection event with err: %v\n", err) errMsg := "" if err != nil { errMsg = err.Error() } exitChan <- exitResult{errMsg, 2} }) IOsk.On(xaapiv1.EVTSDKInstall, func(ev xaapiv1.EventMsg) { sdkEvt, _ := ev.DecodeSDKMsg() if sdkEvt.Stdout != "" { fmt.Printf("%s", sdkEvt.Stdout) } if sdkEvt.Stderr != "" { fmt.Fprintf(os.Stderr, "%s", sdkEvt.Stderr) } if sdkEvt.Exited { exitChan <- exitResult{sdkEvt.Error, sdkEvt.Code} } }) evReg := xaapiv1.EventRegisterArgs{Name: xaapiv1.EVTSDKInstall} if err := HTTPCli.Post("/events/register", &evReg, nil); err != nil { return cli.NewExitError(err, 1) } url := XdsServerComputeURL("/sdks") sdks := xaapiv1.SDKInstallArgs{ ID: id, Filename: file, Force: force, } if ctx.Bool("debug") { sdks.InstallArgs = []string{"--debug"} } newSdk := xaapiv1.SDK{} if err := HTTPCli.Post(url, &sdks, &newSdk); err != nil { return cli.NewExitError(err, 1) } Log.Debugf("Result of %s: %v", url, newSdk) fmt.Printf("Installation of '%s' SDK successfully started.\n", newSdk.Name) // TODO: trap CTRL+C and print question: "Installation of xxx is in progress, press 'a' to abort, 'b' to continue in background or 'c' to continue installation" // Wait exit select { case res := <-exitChan: if res.code == 0 { Log.Debugln("Exit successfully") fmt.Println("SDK ID " + newSdk.ID + " successfully installed.") } if res.error != "" { Log.Debugln("Exit with ERROR: ", res.error) } return cli.NewExitError(res.error, res.code) } } func sdksUnInstall(ctx *cli.Context) error { id := GetID(ctx) if id == "" { return cli.NewExitError("id parameter or option must be set", 1) } if !ctx.Bool("force") { if !Confirm("Do you permanently remove SDK id '" + id + "' [yes/No] ? ") { return nil } } delSdk := xaapiv1.SDK{} url := XdsServerComputeURL("/sdks/" + id) if err := HTTPCli.Delete(url, &delSdk); err != nil { return cli.NewExitError(err, 1) } Log.Debugf("Result of %s: %v", url, delSdk) fmt.Println("SDK ID " + delSdk.ID + " successfully deleted.") return nil } func sdksAbort(ctx *cli.Context) error { id := GetID(ctx) if id == "" { return cli.NewExitError("id parameter or option must be set", 1) } sdks := xaapiv1.SDKInstallArgs{ID: id} newSdk := xaapiv1.SDK{} url := XdsServerComputeURL("/sdks/abortinstall") if err := HTTPCli.Post(url, &sdks, &newSdk); err != nil { return cli.NewExitError(err, 1) } Log.Debugf("Result of %s: %v", url, newSdk) return nil }