def main(argv):
    """dbedit [-d]
    """
    debug = 0
    try:
        optlist, longopts, args = getopt.getopt(argv[1:], "?hdD")
    except getopt.GetoptError:
            print(main.__doc__)
            return
    for opt, val in optlist:
        if opt in ("-?", "-h"):
            print(main.__doc__)
            return
        elif opt == "-d":
            debug += 1
        elif opt == "-D":
            from pycopia import autodebug

    sess = models.get_session()
    try:
        app = DBEditor(sess, debug)
        try:
            app.run()
        except:
            if debug:
                ex, val, tb = sys.exc_info()
                from pycopia import debugger
                if 1 > debug:
                    from pycopia import IOurxvt
                    io = IOurxvt.UrxvtIO()
                else:
                    io = None
                debugger.post_mortem(tb, ex, val, io)
                if debug > 1:
                    io.close()
            else:
                raise
    finally:
        sess.close()
dataset/ETHPy150Open kdart/pycopia/storage/pycopia/db/tui/main.py/main/swapped operands of `>`