# Path: rummage/lib/__meta__.py
# RE_VER = re.compile(
#     r'''(?x)
#     (?P<major>\d+)(?:\.(?P<minor>\d+))?(?:\.(?P<micro>\d+))?
#     (?:(?P<type>a|b|rc)(?P<pre>\d+))?
#     (?:\.post(?P<post>\d+))?
#     (?:\.dev(?P<dev>\d+))?
#     '''
# )
# REL_MAP = {
#     ".dev": "",
#     ".dev-alpha": "a",
#     ".dev-beta": "b",
#     ".dev-candidate": "rc",
#     "alpha": "a",
#     "beta": "b",
#     "candidate": "rc",
#     "final": ""
# }
# DEV_STATUS = {
#     ".dev": "2 - Pre-Alpha",
#     ".dev-alpha": "2 - Pre-Alpha",
#     ".dev-beta": "2 - Pre-Alpha",
#     ".dev-candidate": "2 - Pre-Alpha",
#     "alpha": "3 - Alpha",
#     "beta": "4 - Beta",
#     "candidate": "4 - Beta",
#     "final": "5 - Production/Stable"
# }
# PRE_REL_MAP = {"a": 'alpha', "b": 'beta', "rc": 'candidate'}
# class Version(namedtuple("Version", ["major", "minor", "micro", "release", "pre", "post", "dev"])):
#     def __new__(cls, major, minor, micro, release="final", pre=0, post=0, dev=0):
#     def _is_pre(self):
#     def _is_dev(self):
#     def _is_post(self):
#     def _get_dev_status(self):  # pragma: no cover
#     def _get_canonical(self):
# def parse_version(ver):
# 
# Path: rummage/lib/gui/app/rummage_app.py
# class RummageApp(PipeApp):
#     def __init__(self, argv, **kwargs):
#     def OnInit(self):
#     def OnExit(self):
#     def on_pipe_args(self, event):
#     def process_args(self, arguments):
#     def MacReopenApp(self):  # noqa


import sys
import os  # noqa: E402
import argparse  # noqa: E402
from .lib import __meta__  # noqa: E402
from .lib.gui.app import rummage_app  # noqa: E402
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
from __future__ import absolute_import
if '' in sys.path:
    # Prevent us from loading local packages with `python -m`
    # Comment this out if you want rummage to load a local package
    # for testing.
    sys.path.remove('')

if sys.executable.endswith("pythonw.exe"):
    sys.stdout = open(os.devnull, "w")
    sys.stderr = open(os.devnull, "w")


def parse_arguments():
    """Parse the arguments."""

    parser = argparse.ArgumentParser(prog=__meta__.__app__, description='A python grep like tool.')
    # Flag arguments

# Path: rummage/lib/__meta__.py
# RE_VER = re.compile(
#     r'''(?x)
#     (?P<major>\d+)(?:\.(?P<minor>\d+))?(?:\.(?P<micro>\d+))?
#     (?:(?P<type>a|b|rc)(?P<pre>\d+))?
#     (?:\.post(?P<post>\d+))?
#     (?:\.dev(?P<dev>\d+))?
#     '''
# )
# REL_MAP = {
#     ".dev": "",
#     ".dev-alpha": "a",
#     ".dev-beta": "b",
#     ".dev-candidate": "rc",
#     "alpha": "a",
#     "beta": "b",
#     "candidate": "rc",
#     "final": ""
# }
# DEV_STATUS = {
#     ".dev": "2 - Pre-Alpha",
#     ".dev-alpha": "2 - Pre-Alpha",
#     ".dev-beta": "2 - Pre-Alpha",
#     ".dev-candidate": "2 - Pre-Alpha",
#     "alpha": "3 - Alpha",
#     "beta": "4 - Beta",
#     "candidate": "4 - Beta",
#     "final": "5 - Production/Stable"
# }
# PRE_REL_MAP = {"a": 'alpha', "b": 'beta', "rc": 'candidate'}
# class Version(namedtuple("Version", ["major", "minor", "micro", "release", "pre", "post", "dev"])):
#     def __new__(cls, major, minor, micro, release="final", pre=0, post=0, dev=0):
#     def _is_pre(self):
#     def _is_dev(self):
#     def _is_post(self):
#     def _get_dev_status(self):  # pragma: no cover
#     def _get_canonical(self):
# def parse_version(ver):
# 
# Path: rummage/lib/gui/app/rummage_app.py
# class RummageApp(PipeApp):
#     def __init__(self, argv, **kwargs):
#     def OnInit(self):
#     def OnExit(self):
#     def on_pipe_args(self, event):
#     def process_args(self, arguments):
#     def MacReopenApp(self):  # noqa


# Path: rummage/__main__.py
import sys
import os  # noqa: E402
import argparse  # noqa: E402
from .lib import __meta__  # noqa: E402
from .lib.gui.app import rummage_app  # noqa: E402

documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
from __future__ import absolute_import
if '' in sys.path:
    # Prevent us from loading local packages with `python -m`
    # Comment this out if you want rummage to load a local package
    # for testing.
    sys.path.remove('')

if sys.executable.endswith("pythonw.exe"):
    sys.stdout = open(os.devnull, "w")
    sys.stderr = open(os.devnull, "w")


def parse_arguments():
    """Parse the arguments."""

    parser = argparse.ArgumentParser(prog=__meta__.__app__, description='A python grep like tool.')
    # Flag arguments

    parser.add_argument('--version', action='version', version=('%(prog)s ' + __meta__.__version__))