MCPcopy
hub / github.com/p-e-w/argos / _update

Method _update

argos@pew.worldwidemann.com/button.js:77–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 }
76
77 _update() {
78 if (this._updateRunning)
79 return;
80
81 this._updateRunning = true;
82
83 let envp = GLib.get_environ();
84 envp.push("ARGOS_VERSION=2");
85 envp.push("ARGOS_MENU_OPEN=" + (this.menu.isOpen ? "true" : "false"));
86
87 try {
88 Utilities.spawnWithCallback(null, [this._file.get_path()], envp, 0, null,
89 (standardOutput) => {
90 this._updateRunning = false;
91
92 if (this._isDestroyed)
93 return;
94
95 this._processOutput(standardOutput.split("\n"));
96
97 if (this._updateInterval !== null) {
98 this._updateTimeout =
99 GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT,
100 this._updateInterval,
101 () => {
102 this._updateTimeout = null;
103 this._update();
104 return false;
105 });
106 }
107 });
108 } catch (error) {
109 log("Unable to execute file '" + this._file.get_basename() + "': " + error);
110 this._updateRunning = false;
111 }
112 }
113
114 _processOutput(output) {
115 let buttonLines = [];

Callers 2

_initMethod · 0.95
updateMethod · 0.95

Calls 1

_processOutputMethod · 0.95

Tested by

no test coverage detected