# Path: ronin/utils/strings.py
# def stringify(value):
#     """
#     Casts the value to a Unicode string. If the value is a function, calls it using
#     :func:`ronin.contexts.current_context` as its only argument, and recurses until a
#     non-FunctionType value is returned.
#     
#     None values are preserved, whether None is directly sent to this function or is the return
#     value of function argument.
#     
#     This function is the heart of Rōnin's deferred value capability, as it allows lambdas to be
#     passed around instead of strings.
#     
#     :param value: value or None
#     :type value: str|FunctionType
#     :returns: stringified value or None
#     :rtype: str
#     """
#     
#     if value is None:
#         return None
#     elif hasattr(value, '__call__'):
#         with current_context() as ctx:
#             value = value(ctx)
#         return stringify(value)
#     else:
#         try:
#             return to_str(value)
#         except UnicodeDecodeError:
#             return str(value).decode(_ENCODING)
# 
# Path: ronin/contexts.py
# def current_context(immutable=True):
#     """
#     Returns the current context if there is one, otherwise raises :class:`NoContextException`.
#     
#     By default, the context will be treated as immutable.
#     
#     :param immutable: set to False in order to allow changes to the context
#     :type immutable: bool
#     :returns: current context
#     :rtype: :class:`Context`
#     """
# 
#     ctx = Context._peek_thread_local()
#     if ctx is None:
#         raise NoContextException()
#     return Context(ctx, True) if immutable else ctx


from .strings import stringify
from ..contexts import current_context
from subprocess import check_output, CalledProcessError
import sys, platform
# Copyright 2016-2018 Tal Liron
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

from __future__ import unicode_literals
from __future__ import absolute_import # so we can import 'platform'


DEFAULT_WHICH_COMMAND = '/usr/bin/which'

DEFAULT_PLATFORM_PREFIXES = {
    'linux64': 'x86_64-linux-gnu-',

# Path: ronin/utils/strings.py
# def stringify(value):
#     """
#     Casts the value to a Unicode string. If the value is a function, calls it using
#     :func:`ronin.contexts.current_context` as its only argument, and recurses until a
#     non-FunctionType value is returned.
#     
#     None values are preserved, whether None is directly sent to this function or is the return
#     value of function argument.
#     
#     This function is the heart of Rōnin's deferred value capability, as it allows lambdas to be
#     passed around instead of strings.
#     
#     :param value: value or None
#     :type value: str|FunctionType
#     :returns: stringified value or None
#     :rtype: str
#     """
#     
#     if value is None:
#         return None
#     elif hasattr(value, '__call__'):
#         with current_context() as ctx:
#             value = value(ctx)
#         return stringify(value)
#     else:
#         try:
#             return to_str(value)
#         except UnicodeDecodeError:
#             return str(value).decode(_ENCODING)
# 
# Path: ronin/contexts.py
# def current_context(immutable=True):
#     """
#     Returns the current context if there is one, otherwise raises :class:`NoContextException`.
#     
#     By default, the context will be treated as immutable.
#     
#     :param immutable: set to False in order to allow changes to the context
#     :type immutable: bool
#     :returns: current context
#     :rtype: :class:`Context`
#     """
# 
#     ctx = Context._peek_thread_local()
#     if ctx is None:
#         raise NoContextException()
#     return Context(ctx, True) if immutable else ctx


# Path: ronin/utils/platform.py
from .strings import stringify
from ..contexts import current_context
from subprocess import check_output, CalledProcessError
import sys, platform

# Copyright 2016-2018 Tal Liron
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

from __future__ import unicode_literals
from __future__ import absolute_import # so we can import 'platform'


DEFAULT_WHICH_COMMAND = '/usr/bin/which'

DEFAULT_PLATFORM_PREFIXES = {
    'linux64': 'x86_64-linux-gnu-',

    'linux32': 'x86_64-linux-gnu-', #'i686-linux-gnu-',