Ejemplo n.º 1
0
def main():
    freeze_support()
    from filerockclient.util.utilities import install_excepthook_for_threads

    install_excepthook_for_threads()

    # Command line argument parsing
    parser = argparse.ArgumentParser(description="The tool for accessing " "your cloud storage files securely.")

    parser.add_argument(
        "-c",
        "--configdir",
        help="Set the configuration directory",
        type=unicode,
        default=None,
        metavar="<configuration directory>",
    )

    parser.add_argument(
        "-i",
        "--interface",
        help="User interface mode: g=gui (default), c=console, n=none",
        type=unicode,
        default=u"g",
        metavar="<user interface mode>",
    )

    parser.add_argument(
        "--no-bug-report",
        dest="bugreport",
        action="store_false",
        help="In case of unhandled exceptions do not trigger the bug-report \
        subsystem but shows exceptions on terminal. This options is intended \
        to be used by developers.",
    )

    parser.add_argument(
        "--show-panel",
        dest="showpanel",
        action="store_true",
        help="If this param is specified the software will open the Gui " "panel on startup",
    )

    parser.add_argument(
        "--no-startup-slides",
        dest="startupslides",
        action="store_false",
        help="Whether to show the presentation slides at startup.",
    )

    parser.add_argument("-d", "--develop", help="Enable develop mode", action="store_true")

    parser.add_argument(
        "--restart-count", dest="restartcount", help="Internal use", type=int, default=0, metavar="<restart count>"
    )

    # Just parse known options
    args, _ = parser.parse_known_args()

    application = Application(
        args.develop,
        args.bugreport,
        args.configdir,
        args.startupslides,
        args.restartcount,
        args.showpanel,
        args.interface,
        get_command_line(),
        "filerock.py",
    )

    application.main_loop()

    # Despite our efforts, it still happens to have hanging threads.
    # We use _exit() as a temporary fix to make the application close.
    os._exit(0)
Ejemplo n.º 2
0
def main():

    freeze_support()
    from filerockclient.util.utilities import install_excepthook_for_threads
    install_excepthook_for_threads()

    # Command line argument parsing
    parser = argparse.ArgumentParser(
        description='The tool for accessing '
        'your cloud storage files securely.')

    parser.add_argument(
        '-c', '--configdir',
        help='Set the configuration directory', type=unicode, default=None,
        metavar="<configuration directory>")

    parser.add_argument(
        '-i', '--interface',
        help='User interface mode: g=gui (default), c=console, n=none',
        type=unicode, default=u"g", metavar="<user interface mode>")

    parser.add_argument(
        '--no-bug-report',
        dest='bugreport', action='store_false',
        help="In case of unhandled exceptions do not trigger the bug-report \
        subsystem but shows exceptions on terminal. This options is intended \
        to be used by developers.")

    parser.add_argument(
        '--show-panel',
        dest='showpanel', action='store_true',
        help="If this param is specified the software will open the Gui " \
             "panel on startup")

    parser.add_argument(
        '--no-startup-slides',
        dest='startupslides', action='store_false',
        help="Whether to show the presentation slides at startup.")

    parser.add_argument(
        '-d', '--develop',
        help='Enable develop mode', action='store_true')

    parser.add_argument(
        '-e', '--executable',
        dest='executable', help='Executable file name', default=None,
        metavar='<executable name>')

    parser.add_argument(
        '--restart-count',
        dest='restartcount', help='Internal use', type=int, default=0,
        metavar="<restart count>")

    # Just parse known options
    args, _ = parser.parse_known_args()

    # On some OSX installations sys.executable isn't reliable. It doesn't seem
    # to return the executable filename that was actually launched. A comment
    # in Python's source code states that when Python is installed as an "app
    # bundle" argv[0] doesn't return the correct executed pathname. Maybe it's
    # related to our problem. As a patch, we accept the executable pathname as
    # a command line parameter. Damn OSX.
    if args.executable is not None:
        executable_name = args.executable
    else:
        executable_name = sys.executable

    main_script = 'FileRock.py'

    # Sets the current working directory to dirname(sys.executable)
    # (Fix for all packaged clients except darwin)
    if hasattr(sys, 'frozen') and not sys.platform.startswith('darwin'):
        os.chdir(os.path.dirname(os.path.realpath(sys.executable)))

    application = Application(
        args.develop, args.bugreport, args.configdir, args.startupslides,
        args.restartcount, args.showpanel, args.interface, executable_name,
        main_script)

    application.main_loop()

    # Despite our efforts, it still happens to have hanging threads.
    # We use _exit() as a temporary fix to make the application close.
    os._exit(0)
Ejemplo n.º 3
0
def main():
    freeze_support()
    from filerockclient.util.utilities import install_excepthook_for_threads
    install_excepthook_for_threads()

    # Command line argument parsing
    parser = argparse.ArgumentParser(
        description='The tool for accessing '
        'your cloud storage files securely.')

    parser.add_argument(
        '-c', '--configdir',
        help='Set the configuration directory', type=unicode, default=None,
        metavar="<configuration directory>")

    parser.add_argument(
        '-i', '--interface',
        help='User interface mode: g=gui (default), c=console, n=none',
        type=unicode, default=u"g", metavar="<user interface mode>")

    parser.add_argument(
        '--no-bug-report',
        dest='bugreport', action='store_false',
        help="In case of unhandled exceptions do not trigger the bug-report "
        "subsystem but shows exceptions on terminal. This options is intended "
        "to be used by developers.")

    parser.add_argument(
        '--show-panel',
        dest='showpanel', action='store_true',
        help="If this param is specified the software will open the Gui "
             "panel on startup")

    parser.add_argument(
        '--no-startup-slides',
        dest='startupslides', action='store_false',
        help="Whether to show the presentation slides at startup.")

    parser.add_argument(
        '-d', '--develop',
        help='Enable develop mode', action='store_true')

    parser.add_argument(
        '--restart-count',
        dest='restartcount', help='Internal use', type=int, default=0,
        metavar="<restart count>")

    parser.add_argument(
        '--no-hard-reset',
        dest='hardreset_allowed', help='disable automatic restart of the '
                                       'application upon internal faults',
        action='store_false', default=True)

    # Just parse known options
    args, _ = parser.parse_known_args()

    application = Application(
        args.develop, args.bugreport, args.configdir, args.startupslides,
        args.restartcount, args.hardreset_allowed, args.showpanel,
        args.interface, get_command_line(), 'filerock.py')

    application.main_loop()

    # Despite our efforts, it still happens to have hanging threads.
    # We use _exit() as a temporary fix to make the application close.
    os._exit(0)
Ejemplo n.º 4
0
def main():
    freeze_support()
    from filerockclient.util.utilities import install_excepthook_for_threads
    install_excepthook_for_threads()

    # Command line argument parsing
    parser = argparse.ArgumentParser(description='The tool for accessing '
                                     'your cloud storage files securely.')

    parser.add_argument('-c',
                        '--configdir',
                        help='Set the configuration directory',
                        type=unicode,
                        default=None,
                        metavar="<configuration directory>")

    parser.add_argument(
        '-i',
        '--interface',
        help='User interface mode: g=gui (default), c=console, n=none',
        type=unicode,
        default=u"g",
        metavar="<user interface mode>")

    parser.add_argument(
        '--no-bug-report',
        dest='bugreport',
        action='store_false',
        help="In case of unhandled exceptions do not trigger the bug-report "
        "subsystem but shows exceptions on terminal. This options is intended "
        "to be used by developers.")

    parser.add_argument(
        '--show-panel',
        dest='showpanel',
        action='store_true',
        help="If this param is specified the software will open the Gui "
        "panel on startup")

    parser.add_argument(
        '--no-startup-slides',
        dest='startupslides',
        action='store_false',
        help="Whether to show the presentation slides at startup.")

    parser.add_argument('-d',
                        '--develop',
                        help='Enable develop mode',
                        action='store_true')

    parser.add_argument('--restart-count',
                        dest='restartcount',
                        help='Internal use',
                        type=int,
                        default=0,
                        metavar="<restart count>")

    parser.add_argument('--no-hard-reset',
                        dest='hardreset_allowed',
                        help='disable automatic restart of the '
                        'application upon internal faults',
                        action='store_false',
                        default=True)

    # Just parse known options
    args, _ = parser.parse_known_args()

    application = Application(args.develop, args.bugreport, args.configdir,
                              args.startupslides, args.restartcount,
                              args.hardreset_allowed, args.showpanel,
                              args.interface, get_command_line(),
                              'filerock.py')

    application.main_loop()

    # Despite our efforts, it still happens to have hanging threads.
    # We use _exit() as a temporary fix to make the application close.
    os._exit(0)