Skip to content

Commit 9cfc460

Browse files
committed
Remove graphical workarounds in linux since we no longer use display manager
1 parent 01fb9d4 commit 9cfc460

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
### Deprecated
1414

1515
### Removed
16+
- Linux wrapper no longer bails out on long-running commands. That behavior was possible in Arduino 1.6.x that might pop up a graphical error message, but with the display manager removed this is no longer a concern
1617

1718
### Fixed
1819

lib/arduino_ci/arduino_cmd_linux.rb

-58
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,13 @@ module ArduinoCI
55

66
# Implementation of Arduino linux IDE commands
77
class ArduinoCmdLinux < ArduinoCmd
8-
9-
attr_reader :prefs_response_time
10-
118
flag :get_pref, "--get-pref"
129
flag :set_pref, "--pref"
1310
flag :save_prefs, "--save-prefs"
1411
flag :use_board, "--board"
1512
flag :install_boards, "--install-boards"
1613
flag :install_library, "--install-library"
1714
flag :verify, "--verify"
18-
19-
def initialize
20-
super
21-
@prefs_response_time = nil
22-
end
23-
24-
# fetch preferences in their raw form
25-
# @return [String] Preferences as a set of lines
26-
def _prefs_raw
27-
start = Time.now
28-
resp = run_and_capture(flag_get_pref)
29-
@prefs_response_time = Time.now - start
30-
return nil unless resp[:success]
31-
32-
resp[:out]
33-
end
34-
35-
def run_with_gui_guess(message, *args, **kwargs)
36-
# On Travis CI, we get an error message in the GUI instead of on STDERR
37-
# so, assume that if we don't get a rapid reply that things are not installed
38-
39-
prefs if @prefs_response_time.nil?
40-
x3 = @prefs_response_time * 3
41-
Timeout.timeout(x3) do
42-
result = run_and_capture(*args, **kwargs)
43-
result[:success]
44-
end
45-
rescue Timeout::Error
46-
puts "No response in #{x3} seconds. Assuming graphical modal error message#{message}."
47-
false
48-
end
49-
50-
# underlying preference-setter.
51-
# @param key [String] the preference key
52-
# @param value [String] the preference value
53-
# @return [bool] whether the command succeeded
54-
def _set_pref(key, value)
55-
run_with_gui_guess(" about preferences", flag_set_pref, "#{key}=#{value}", flag_save_prefs)
56-
end
57-
58-
# check whether a board is installed
59-
# we do this by just selecting a board.
60-
# the arduino binary will error if unrecognized and do a successful no-op if it's installed
61-
# @param boardname [String] The name of the board
62-
# @return [bool]
63-
def board_installed?(boardname)
64-
run_with_gui_guess(" about board not installed", flag_use_board, boardname)
65-
end
66-
67-
# use a particular board for compilation
68-
# @param boardname [String] The name of the board
69-
def use_board(boardname)
70-
run_with_gui_guess(" about board not installed", flag_use_board, boardname, flag_save_prefs)
71-
end
72-
7315
end
7416

7517
end

0 commit comments

Comments
 (0)