Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
b951097a
Commit
b951097a
authored
May 24, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed no more used formatter/output/... structs
parent
3b98cef7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
106 deletions
+0
-106
common/formatter/output/board_structs.go
common/formatter/output/board_structs.go
+0
-60
common/formatter/output/common_structs.go
common/formatter/output/common_structs.go
+0
-46
No files found.
common/formatter/output/board_structs.go
deleted
100644 → 0
View file @
3b98cef7
/*
* This file is part of arduino-cli.
*
* Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
*
* This software is released under the GNU General Public License version 3,
* which covers the main part of arduino-cli.
* The terms of this license can be found at:
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* You can be released from the requirements of the above licenses by purchasing
* a commercial license. Buying such a license is mandatory if you want to modify or
* otherwise use the software for commercial activities involving the Arduino
* software without disclosing the source code of your own applications. To purchase
* a commercial license, send an email to license@arduino.cc.
*/
package
output
import
(
"fmt"
"github.com/gosuri/uitable"
)
// SerialBoardListItem represents a board connected using serial port.
type
SerialBoardListItem
struct
{
Name
string
`json:"name,required"`
Fqbn
string
`json:"fqbn,required"`
Port
string
`json:"port,required"`
UsbID
string
`json:"usbID,reqiured"`
}
// NetworkBoardListItem represents a board connected via network.
type
NetworkBoardListItem
struct
{
Name
string
`json:"name,required"`
Fqbn
string
`json:"fqbn,required"`
Location
string
`json:"location,required"`
}
// AttachedBoardList is a list of attached boards.
type
AttachedBoardList
struct
{
SerialBoards
[]
SerialBoardListItem
`json:"serialBoards,required"`
NetworkBoards
[]
NetworkBoardListItem
`json:"networkBoards,required"`
}
func
(
bl
*
AttachedBoardList
)
String
()
string
{
table
:=
uitable
.
New
()
table
.
MaxColWidth
=
100
table
.
Wrap
=
true
// wrap columns
table
.
AddRow
(
"FQBN"
,
"Port"
,
"ID"
,
"Board Name"
)
for
_
,
item
:=
range
bl
.
SerialBoards
{
table
.
AddRow
(
item
.
Fqbn
,
item
.
Port
,
item
.
UsbID
[
:
9
],
item
.
Name
)
}
for
_
,
item
:=
range
bl
.
NetworkBoards
{
table
.
AddRow
(
item
.
Fqbn
,
"network://"
+
item
.
Location
,
""
,
item
.
Name
)
}
return
fmt
.
Sprintln
(
table
)
}
common/formatter/output/common_structs.go
deleted
100644 → 0
View file @
3b98cef7
/*
* This file is part of arduino-cli.
*
* Copyright 2018 ARDUINO SA (http://www.arduino.cc/)
*
* This software is released under the GNU General Public License version 3,
* which covers the main part of arduino-cli.
* The terms of this license can be found at:
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* You can be released from the requirements of the above licenses by purchasing
* a commercial license. Buying such a license is mandatory if you want to modify or
* otherwise use the software for commercial activities involving the Arduino
* software without disclosing the source code of your own applications. To purchase
* a commercial license, send an email to license@arduino.cc.
*/
package
output
import
(
"fmt"
"strings"
)
// ProcessResult contains info about a completed process.
type
ProcessResult
struct
{
ItemName
string
`json:"name,required"`
Status
string
`json:"status,omitempty"`
Error
string
`json:"error,omitempty"`
Path
string
`json:"path,omitempty"`
}
// String returns a string representation of the object.
// EXAMPLE:
// ToolName - ErrorText: Error explaining why failed
// ToolName - StatusText: PATH = /path/to/result/dir
func
(
lr
ProcessResult
)
String
()
string
{
ret
:=
lr
.
ItemName
if
lr
.
Status
!=
""
{
ret
+=
fmt
.
Sprint
(
" - "
,
lr
.
Status
)
}
if
lr
.
Error
!=
""
{
ret
+=
fmt
.
Sprint
(
" - "
,
lr
.
Error
)
}
return
strings
.
TrimSpace
(
ret
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment