Esempio n. 1
0
    def interval(self):
        if SIReaderClient().is_alive() != self.sportident_status:
            self.toolbar_property['sportident'].setIcon(
                QtGui.QIcon(
                    config.icon_dir(
                        self.sportident_icon[SIReaderClient().is_alive()])))
            self.sportident_status = SIReaderClient().is_alive()
        if Teamwork().is_alive() != self.teamwork_status:
            self.toolbar_property['teamwork'].setIcon(
                QtGui.QIcon(
                    config.icon_dir(
                        self.teamwork_icon[Teamwork().is_alive()])))
            self.teamwork_status = Teamwork().is_alive()

        try:
            if self.get_configuration().get('autosave_interval'):
                if self.file:
                    if time.time() - self.last_update > int(
                            self.get_configuration().get('autosave_interval')):
                        self.save_file()
                        logging.info(_('Auto save'))
                else:
                    logging.debug(_('No file to auto save'))
        except Exception as e:
            logging.error(str(e))

        while not self.log_queue.empty():
            text = self.log_queue.get()
            self.statusbar_message(text)
            if hasattr(self, 'logging_tab'):
                self.logging_tab.write(text)
Esempio n. 2
0
    def interval(self):
        if SIReaderClient().is_alive() != self.sportident_status:
            self.toolbar_property['sportident'].setIcon(
                QtGui.QIcon(config.icon_dir(self.sportident_icon[SIReaderClient().is_alive()])))
            self.sportident_status = SIReaderClient().is_alive()
        if Teamwork().is_alive() != self.teamwork_status:
            self.toolbar_property['teamwork'].setIcon(
                QtGui.QIcon(config.icon_dir(self.teamwork_icon[Teamwork().is_alive()])))
            self.teamwork_status = Teamwork().is_alive()

        if self.saving:
            if self.file:
                self.save_file()
                logging.info(_('Auto save'))
            else:
                logging.warning(_('No file to auto save'))
            self.saving = False

        while not self.log_queue.empty():
            text = self.log_queue.get()
            self.statusbar_message(text)
            if hasattr(self, 'logging_tab'):
                self.logging_tab.write(text)
Esempio n. 3
0
def toolbar_list():
    return [
        (config.icon_dir('file.svg'), _('New'), 'NewAction'),
        (config.icon_dir('folder.svg'), _('Open'), 'OpenAction'),
        (config.icon_dir('save.svg'), _('Save'), 'SaveAction'),
        (config.icon_dir('form.svg'), _('Event Settings'),
         'EventSettingsAction'),
        (config.icon_dir('sportident.png'), _('SPORTident readout'),
         'SPORTidentReadoutAction', 'sportident'),
        (config.icon_dir('network-off.svg'), _('Teamwork'),
         'TeamworkEnableAction', 'teamwork'),
        (config.icon_dir('flag.svg'), _('Manual finish'),
         'ManualFinishAction'),
    ]
Esempio n. 4
0
def menu_list():
    return [
        {
            'title':
            _('File'),
            'actions': [
                {
                    'title': _('New'),
                    'shortcut': 'Ctrl+N',
                    'icon': config.icon_dir('file.svg'),
                    'action': 'NewAction'
                },
                {
                    'title': _('Save'),
                    'shortcut': 'Ctrl+S',
                    'icon': config.icon_dir('save.svg'),
                    'action': 'SaveAction'
                },
                {
                    'title': _('Open'),
                    'shortcut': 'Ctrl+O',
                    'icon': config.icon_dir('folder.svg'),
                    'action': 'OpenAction'
                },
                {
                    'title': _('Save As'),
                    'shortcut': 'Ctrl+Shift+S',
                    'icon': config.icon_dir('save.svg'),
                    'action': 'SaveAsAction'
                },
                {
                    'type': 'separator',
                },
                {
                    'title': _('Settings'),
                    'shortcut': 'Ctrl+Alt+S',
                    'icon': config.icon_dir('settings.svg'),
                    'action': 'SettingsAction'
                },
                {
                    'title': _('Event Settings'),
                    'icon': config.icon_dir('form.svg'),
                    'action': 'EventSettingsAction'
                },
                {
                    'type': 'separator',
                },
                {
                    'title':
                    _('Import'),
                    'actions': [
                        {
                            'title': _('Import from SportOrg file'),
                            'action': 'ImportSportOrgAction'
                        },
                        {
                            'title': _('CSV Winorient'),
                            'icon': config.icon_dir('csv.svg'),
                            'action': 'CSVWinorientImportAction'
                        },
                        {
                            'title': _('WDB Winorient'),
                            'action': 'WDBWinorientImportAction'
                        },
                        {
                            'title': _('Ocad txt v8'),
                            'action': 'OcadTXTv8ImportAction'
                        },
                        {
                            'title': _('IOF xml'),
                            'action': 'IOFEntryListImportAction'
                        },
                    ]
                },
                {
                    'title':
                    _('Export'),
                    'actions': [
                        {
                            'title': _('WDB Winorient'),
                            'action': 'WDBWinorientExportAction'
                        },
                        # {
                        #     'title': 'IOF xml',
                        #     'actions': [
                        #         {
                        #             'title': _('ResultList'),
                        #             'action': 'IOFResultListExportAction'
                        #         }
                        #     ]
                        # },
                    ]
                }
            ]
        },
        {
            'title':
            _('Edit'),
            'actions': [{
                'title': _('Add object'),
                'tabs': list(range(5)),
                'shortcut': ['insert', 'i'],
                'icon': config.icon_dir('add.svg'),
                'action': 'AddObjectAction'
            }, {
                'title': _('Delete'),
                'shortcut': 'Del',
                'tabs': list(range(5)),
                'icon': config.icon_dir('delete.svg'),
                'action': 'DeleteAction'
            }, {
                'title': _('Copy'),
                'shortcut': 'Ctrl+C',
                'tabs': list(range(5)),
                'action': 'CopyAction'
            }, {
                'title': _('Duplicate'),
                'shortcut': 'Ctrl+D',
                'tabs': list(range(5)),
                'action': 'DuplicateAction'
            }, {
                'title': _('Text exchange'),
                'action': 'TextExchangeAction'
            }, {
                'title': _('Mass edit'),
                'tabs': [0],
                'action': 'MassEditAction'
            }]
        },
        {
            'title':
            _('View'),
            'actions': [{
                'title': _('Refresh'),
                'icon': config.icon_dir('refresh.svg'),
                'shortcut': 'F5',
                'action': 'RefreshAction'
            }, {
                'title': _('Filter'),
                'shortcut': 'F2',
                'tabs': [0, 1],
                'icon': config.icon_dir('filter.svg'),
                'action': 'FilterAction'
            }, {
                'title': _('Search'),
                'shortcut': 'Ctrl+F',
                'tabs': list(range(5)),
                'icon': config.icon_dir('search.svg'),
                'action': 'SearchAction'
            }, {
                'type': 'separator',
            }, {
                'title': _('Start Preparation'),
                'shortcut': 'Ctrl+1',
                'action': 'ToStartPreparationAction'
            }, {
                'title': _('Race Results'),
                'shortcut': 'Ctrl+2',
                'action': 'ToRaceResultsAction'
            }, {
                'title': _('Groups'),
                'shortcut': 'Ctrl+3',
                'action': 'ToGroupsAction'
            }, {
                'title': _('Courses'),
                'shortcut': 'Ctrl+4',
                'action': 'ToCoursesAction'
            }, {
                'title': _('Teams'),
                'shortcut': 'Ctrl+5',
                'action': 'ToTeamsAction'
            }]
        },
        {
            'title':
            _('Start Preparation'),
            'actions': [
                {
                    'title': _('Start Preparation'),
                    'action': 'StartPreparationAction'
                },
                {
                    'title': _('Guess courses'),
                    'action': 'GuessCoursesAction'
                },
                {
                    'title': _('Guess corridors'),
                    'action': 'GuessCorridorsAction'
                },
                {
                    'title': _('Relay number assign mode'),
                    'tabs': [0],
                    'action': 'RelayNumberAction'
                },
                {
                    'title': _('Start time change'),
                    'action': 'StartTimeChangeAction'
                },
                {
                    'title': _('Handicap start time'),
                    'action': 'StartHandicapAction'
                },
                {
                    'title': _('Clone relay legs'),
                    'action': 'RelayCloneAction'
                },
                {
                    'title': _('Use bib as card number'),
                    'action': 'CopyBibToCardNumber'
                },
            ]
        },
        {
            'title':
            _('Race'),
            'actions': [
                {
                    'title': _('Manual finish'),
                    'shortcut': 'F3',
                    'icon': config.icon_dir('flag.svg'),
                    'action': 'ManualFinishAction'
                },
                {
                    'title': _('Add SPORTident result'),
                    'action': 'AddSPORTidentResultAction'
                },
            ]
        },
        {
            'title':
            _('Results'),
            'actions': [
                {
                    'title': _('Create report'),
                    'shortcut': 'Ctrl+P',
                    'action': 'CreateReportAction'
                },
                {
                    'title': _('Split printout'),
                    'shortcut': 'Ctrl+L',
                    'action': 'SplitPrintoutAction'
                },
                {
                    'type': 'separator',
                },
                {
                    'title': _('Rechecking'),
                    'shortcut': 'Ctrl+R',
                    'action': 'RecheckingAction'
                },
                {
                    'title': _('Find group by punches'),
                    'tabs': [1],
                    'action': 'GroupFinderAction'
                },
                {
                    'title': _('Penalty calculation'),
                    'action': 'PenaltyCalculationAction'
                },
                {
                    'title': _('Penalty removing'),
                    'action': 'PenaltyRemovingAction'
                },
                {
                    'title': _('Change status'),
                    'shortcut': 'F4',
                    'tabs': [1],
                    'action': 'ChangeStatusAction'
                },
                {
                    'title': _('Set DNS numbers'),
                    'action': 'SetDNSNumbersAction'
                },
                {
                    'title': _('Delete CP'),
                    'action': 'CPDeleteAction'
                },
                {
                    'title': _('Assign result by bib'),
                    'action': 'AssignResultByBibAction'
                },
                {
                    'title': _('Assign result by card number'),
                    'action': 'AssignResultByCardNumberAction'
                },
            ]
        },
        {
            'title':
            _('Service'),
            'actions': [
                {
                    'title': _('on/off SPORTident readout'),
                    'icon': config.icon_dir('sportident.png'),
                    'shortcut': 'F8',
                    'action': 'SPORTidentReadoutAction'
                },
                {
                    'title': _('on/off Sportiduino readout'),
                    'icon': config.icon_dir('sportiduino.png'),
                    'action': 'SportiduinoReadoutAction'
                },
                {
                    'title': _('on/off SFR readout'),
                    'icon': config.icon_dir('sfr.png'),
                    'action': 'SFRReadoutAction'
                },
                {
                    'title':
                    _('Teamwork'),
                    'icon':
                    config.icon_dir('network.svg'),
                    'actions': [{
                        'title': _('Send selected'),
                        'shortcut': 'Ctrl+K',
                        'tabs': list(range(5)),
                        'action': 'TeamworkSendAction'
                    }, {
                        'type': 'separator',
                    }, {
                        'title': _('On/Off'),
                        'action': 'TeamworkEnableAction'
                    }]
                },
                {
                    'title':
                    _('Telegram'),
                    'actions': [
                        {
                            'title': _('Send results'),
                            'tabs': [1],
                            'action': 'TelegramSendAction'
                        },
                    ]
                },
            ]
        },
        {
            'title':
            _('Options'),
            'actions': [
                {
                    'title': _('Timekeeping settings'),
                    'icon': config.icon_dir('stopwatch.svg'),
                    'action': 'TimekeepingSettingsAction'
                },
                {
                    'title': _('Teamwork'),
                    'icon': config.icon_dir('network.svg'),
                    'action': 'TeamworkSettingsAction'
                },
                {
                    'title': _('Printer settings'),
                    'icon': config.icon_dir('printer.svg'),
                    'action': 'PrinterSettingsAction'
                },
                {
                    'title': _('Live'),
                    'icon': config.icon_dir('live.svg'),
                    'action': 'LiveSettingsAction'
                },
                {
                    'title': _('Telegram'),
                    'action': 'TelegramSettingsAction'
                },
                {
                    'title': _('Rent cards'),
                    'action': 'RentCardsAction'
                },
            ]
        },
        {
            'title':
            _('Help'),
            'actions': [{
                'title': _('About'),
                'shortcut': 'F1',
                'action': 'AboutAction'
            }, {
                'title': _('Check updates'),
                'action': 'CheckUpdatesAction'
            }, {
                'title': _('Testing'),
                'show': config.DEBUG and not config.is_executable(),
                'shortcut': 'F10',
                'action': 'TestingAction',
                'debug': True
            }]
        },
    ]
Esempio n. 5
0
                 config.base_dir('ranking.txt'), config.SCRIPT_DIR, config.STYLE_DIR]
includes = ['atexit', 'codecs']
excludes = ['Tkinter']

options = {
    'build_exe': {
        'includes': includes,
        'excludes': excludes,
        "packages": ['idna', 'requests', 'encodings', 'asyncio', 'pywinusb/hid'],
        'include_files': include_files
    }
}

executables = [
    Executable(
        'SportOrg.pyw',
        base=base,
        icon=config.icon_dir('sportorg.ico'),
        shortcutDir=config.NAME.lower(),
        copyright='GNU GENERAL PUBLIC LICENSE {}'.format(config.NAME)
    )
]

setup(
    name=config.NAME,
    version=config.VERSION.file,
    description=config.NAME,
    options=options,
    executables=executables
)