Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/ardupilotwaf/ap_persistent.py
Views: 1798
# Copyright (C) 2016 Intel Corporation. All rights reserved.1#2# This file is free software: you can redistribute it and/or modify it3# under the terms of the GNU General Public License as published by the4# Free Software Foundation, either version 3 of the License, or5# (at your option) any later version.6#7# This file is distributed in the hope that it will be useful, but8# WITHOUT ANY WARRANTY; without even the implied warranty of9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.10# See the GNU General Public License for more details.11#12# You should have received a copy of the GNU General Public License along13# with this program. If not, see <http://www.gnu.org/licenses/>.14"""15Module that changes Waf to keep persistent information across clean operations16in for performance improvement.17"""18from waflib import Build, Task1920Build.SAVED_ATTRS.append('ap_persistent_task_sigs')21Build.SAVED_ATTRS.append('ap_persistent_imp_sigs')22Build.SAVED_ATTRS.append('ap_persistent_node_deps')2324_original_signature = Task.Task.signature2526_original_sig_implicit_deps = Task.Task.sig_implicit_deps27if hasattr(_original_sig_implicit_deps, '__func__'):28_original_sig_implicit_deps = _original_sig_implicit_deps.__func__2930def _signature(self):31s = _original_signature(self)32real_fn = self.sig_implicit_deps.__func__33if not self.scan or _original_sig_implicit_deps != real_fn:34return s35bld = self.generator.bld36bld.ap_persistent_imp_sigs[self.uid()] = bld.imp_sigs[self.uid()]37bld.ap_persistent_node_deps[self.uid()] = bld.node_deps[self.uid()]38return s39Task.Task.signature = _signature4041class CleanContext(Build.CleanContext):42def clean(self):43if not self.options.clean_all_sigs:44saved_task_sigs = dict(self.ap_persistent_task_sigs)45saved_imp_sigs = dict(self.ap_persistent_imp_sigs)46saved_node_deps = dict(self.ap_persistent_node_deps)4748super(CleanContext, self).clean()4950if not self.options.clean_all_sigs:51self.task_sigs.update(saved_task_sigs)52self.ap_persistent_task_sigs.update(saved_task_sigs)5354self.imp_sigs.update(saved_imp_sigs)55self.ap_persistent_imp_sigs.update(saved_imp_sigs)5657self.node_deps.update(saved_node_deps)58self.ap_persistent_node_deps.update(saved_node_deps)596061