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
6edf0dda
Commit
6edf0dda
authored
Aug 06, 2018
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed dead code experiment for event handler
parent
97bb3912
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
41 deletions
+0
-41
arduino/cores/packagemanager/package_manager.go
arduino/cores/packagemanager/package_manager.go
+0
-26
commands/commands.go
commands/commands.go
+0
-15
No files found.
arduino/cores/packagemanager/package_manager.go
View file @
6edf0dda
...
...
@@ -57,17 +57,6 @@ type PackageManager struct {
PackagesDir
*
paths
.
Path
DownloadDir
*
paths
.
Path
TempDir
*
paths
.
Path
// TODO: This might be a list in the future, but would it be of any help?
eventHandler
EventHandler
}
// EventHandler defines the events that are generated by the PackageManager
// Subscribing to such events allows, for instance, to print out logs of what is happening
// (say you use them for a CLI...)
type
EventHandler
interface
{
// FIXME: This is temporary, for prototyping (an handler should not return an handler; besides, this leakes
// the usage of releases...)
}
// NewPackageManager returns a new instance of the PackageManager
...
...
@@ -219,21 +208,6 @@ func (pm *PackageManager) ResolveFQBN(fqbn *cores.FQBN) (
return
targetPackage
,
platformRelease
,
board
,
buildProperties
,
buildPlatformRelease
,
nil
}
// FIXME add an handler to be invoked on each verbose operation, in order to let commands display results through the formatter
// as for the progress bars during download
func
(
pm
*
PackageManager
)
RegisterEventHandler
(
eventHandler
EventHandler
)
{
if
pm
.
eventHandler
!=
nil
{
panic
(
"Don't try to register another event handler to the PackageManager yet!"
)
}
pm
.
eventHandler
=
eventHandler
}
// GetEventHandlers returns a slice of the registered EventHandlers
func
(
pm
*
PackageManager
)
GetEventHandlers
()
[]
*
EventHandler
{
return
append
([]
*
EventHandler
{},
&
pm
.
eventHandler
)
}
// LoadPackageIndex loads a package index by looking up the local cached file from the specified URL
func
(
pm
*
PackageManager
)
LoadPackageIndex
(
URL
*
url
.
URL
)
error
{
indexPath
:=
pm
.
IndexDir
.
Join
(
path
.
Base
(
URL
.
Path
))
...
...
commands/commands.go
View file @
6edf0dda
...
...
@@ -94,13 +94,6 @@ func InitPackageManager() *packagemanager.PackageManager {
}
}
// TODO: were should we register the event handler? Multiple places?
if
len
(
pm
.
GetEventHandlers
())
==
0
{
// During tests this could get registered multiple times,
// since there is an underlying singleton
pm
.
RegisterEventHandler
(
&
CLIPackageManagerEventHandler
{})
}
if
err
:=
pm
.
LoadHardware
(
Config
);
err
!=
nil
{
formatter
.
PrintError
(
err
,
"Error loading hardware packages."
)
os
.
Exit
(
ErrCoreConfig
)
...
...
@@ -183,11 +176,3 @@ func InitSketch(sketchPath *paths.Path) (*sk.Sketch, error) {
logrus
.
Infof
(
"Reading sketch from dir: %s"
,
wd
)
return
sketches
.
NewSketchFromPath
(
wd
)
}
// CLIPackageManagerEventHandler defines an event handler which outputs the PackageManager events
// in the CLI format
type
CLIPackageManagerEventHandler
struct
{}
// Implement packagemanager.EventHandler interface
// END -- Implement packagemanager.EventHandler interface
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