capabilities: don't show progress bar when stderr is redirected to a file

This commit is contained in:
Willi Ballenthin
2024-05-06 12:35:53 +02:00
committed by Willi Ballenthin
parent 6869ef6520
commit d26897afca
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -6,6 +6,7 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
import sys
import logging
import itertools
import collections
@@ -146,6 +147,10 @@ def find_dynamic_capabilities(
# to disable progress completely
def pbar(s, *args, **kwargs):
return s
elif not sys.stderr.isatty():
# don't display progress bar when stderr is redirected to a file
def pbar(s, *args, **kwargs):
return s
processes = list(extractor.get_processes())
+5
View File
@@ -6,6 +6,7 @@
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
import sys
import time
import logging
import itertools
@@ -155,6 +156,10 @@ def find_static_capabilities(
# to disable progress completely
def pbar(s, *args, **kwargs):
return s
elif not sys.stderr.isatty():
# don't display progress bar when stderr is redirected to a file
def pbar(s, *args, **kwargs):
return s
functions = list(extractor.get_functions())
n_funcs = len(functions)