# Path: momo/utils.py
# MIN_PAGE_LINES = 50
# PY3 = sys.version_info[0] == 3
# def eval_path(path):
# def smart_print(*args, **kwargs):
# def utf8_decode(s):
# def utf8_encode(s):
# def run_cmd(cmd_str=None, cmd=None, cmd_args=None, stdout=sys.stdout,
#             stderr=sys.stderr, stdin=None):
# def open_default(path):
# def mkdir_p(path):
# def page_lines(lines):


from momo.utils import run_cmd, open_default, txt_type
import re
        if exclude is not None:
            del subs[exclude]
        return t.format(**subs)

    @staticmethod
    def is_expandable(s):
        if isinstance(s, txt_type):
            if re.search('{\S*}', s):
                return True
        return False

    def _get_expand_subs(self):
        subs = {
            k: self.elem.attrs[k].content for k in self.elem.attrs
        }
        return subs

    def get_attr(self, attrname):
        """
        Get an Attribute object by the name `attrname`.
        """
        if attrname in self.elem.attrs:
            return self.elem.attrs[attrname]
        else:
            msg = txt_type(u'{} attribute does not exist in {} {}'.format(
                attrname, self.elem.type.lower(), self.elem.name))
            raise ActionError(msg)

    def open(self, attrname='path'):
        attr = self.get_attr(attrname)

# Path: momo/utils.py
# MIN_PAGE_LINES = 50
# PY3 = sys.version_info[0] == 3
# def eval_path(path):
# def smart_print(*args, **kwargs):
# def utf8_decode(s):
# def utf8_encode(s):
# def run_cmd(cmd_str=None, cmd=None, cmd_args=None, stdout=sys.stdout,
#             stderr=sys.stderr, stdin=None):
# def open_default(path):
# def mkdir_p(path):
# def page_lines(lines):


# Path: momo/actions.py
from momo.utils import run_cmd, open_default, txt_type
import re

        if exclude is not None:
            del subs[exclude]
        return t.format(**subs)

    @staticmethod
    def is_expandable(s):
        if isinstance(s, txt_type):
            if re.search('{\S*}', s):
                return True
        return False

    def _get_expand_subs(self):
        subs = {
            k: self.elem.attrs[k].content for k in self.elem.attrs
        }
        return subs

    def get_attr(self, attrname):
        """
        Get an Attribute object by the name `attrname`.
        """
        if attrname in self.elem.attrs:
            return self.elem.attrs[attrname]
        else:
            msg = txt_type(u'{} attribute does not exist in {} {}'.format(
                attrname, self.elem.type.lower(), self.elem.name))
            raise ActionError(msg)

    def open(self, attrname='path'):
        attr = self.get_attr(attrname)

        open_default(attr.content)