def configure(self, binder):

        binder.bind(guiinjectorkeys.EVENT_CROSS_REFERENCES_FACTORY_KEY,
                    ClassProvider(EventCrossReferencesWidgetFactory),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_EVENT_REFERENCES_FACTORY_KEY,
                    ClassProvider(DocumentEventReferencesWidgetFactory),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_DOCUMENT_REFERENCES_FACTORY_KEY,
                    ClassProvider(EventDocumentReferencesWidgetFactory),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_FILE_REFERENCES_FACTORY_KEY,
                    ClassProvider(DocumentFileReferencesWidgetFactory),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_TYPE_REFERENCES_FACTORY_KEY,
                    ClassProvider(EventTypeReferencesWidgetFactory),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_CROSS_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(EventCrossReferencesView),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_FILE_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(DocumentFileReferencesView),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_EVENT_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(DocumentEventReferencesView),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_DOCUMENT_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(EventDocumentReferencesView),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_TYPE_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(EventTypeReferencesView),
                    scope=singleton)
Exemplo n.º 2
0
    def configure(self, binder):

        binder.bind(MESSENGER_KEY,
                    ClassProvider(ConsoleMessenger),
                    scope=singleton)
        binder.bind(GENERATOR_ENGINE_KEY,
                    ClassProvider(GenerationEngine),
                    scope=singleton)
        binder.bind(EXPORT_DATA_ASSEMBLER_KEY,
                    ClassProvider(CDDataAssembler),
                    scope=singleton)
        binder.bind(THUMBNAIL_RUNNER_KEY,
                    ClassProvider(SymLinkThumbnailRunner),
                    scope=singleton)
        binder.bind(DISPLAY_FILE_RUNNER_KEY,
                    ClassProvider(SymLinkDisplayFileRunner),
                    scope=singleton)
        binder.bind(PDF_RUNNER_KEY,
                    ClassProvider(SymLinkPdfFileRunner),
                    scope=singleton)
        binder.bind(EVENT_SORT_RUNNER_KEY,
                    ClassProvider(EventSortRunner),
                    scope=singleton)
        binder.bind(DOCUMENT_SORT_RUNNER_KEY,
                    ClassProvider(DocumentSortRunner),
                    scope=singleton)
        binder.bind(MULTI_MEDIA_FILE_RUNNER_KEY,
                    ClassProvider(SymLinkMultimediaRunner),
                    scope=singleton)
Exemplo n.º 3
0
    def configure(self, binder):

        binder.bind(DOCUMENT_DEFAULT_VIEWER_KEY,
                    ClassProvider(DefaultViewer),
                    scope=singleton)
        binder.bind(DOCUMENT_GRAPHICS_VIEWER_KEY,
                    ClassProvider(GraphicsViewer),
                    scope=singleton)
        binder.bind(DOCUMENT_EXTERNAL_VIEWER_FACTORY_KEY,
                    ClassProvider(ExternalViewerFactory),
                    scope=singleton)
 def configure(self, binder):
     
     binder.bind(guiinjectorkeys.MAIN_RUNNER_KEY,
                 ClassProvider(MainRunner), scope=singleton)
     binder.bind(baseinjectorkeys.CREATOR_PROVIDER_KEY,
                 ClassProvider(BasicCreatorProvider), scope=singleton)
     binder.bind(guiinjectorkeys.SETUP_RUNNER_KEY,
                 ClassProvider(SetupRunner), scope=singleton)
     binder.bind(guiinjectorkeys.CHECK_DATABASE_VERSION_KEY,
                 ClassProvider(StartupTaskCheckDatabaseVersion), scope=singleton)
     #binder.bind(guiinjectorkeys.LOGIN_KEY,
     #            ClassProvider(StartupTaskLogin), scope=singleton)
     binder.bind(guiinjectorkeys.POPULATE_WINDOWS_KEY,
                 ClassProvider(StartupTaskPopulateWindows), scope=singleton)
Exemplo n.º 5
0
 def __init__(self, engine: Engine):
     injector = get_injector()
     injector.binder.bind(MyRepository,
                          to=ClassProvider(sqla_crud(MyRepository)))
     self._engine = engine
     self.repository = injector.get(MyRepository)
     metadata.drop_all(bind=self._engine)
     metadata.create_all(bind=self._engine)
Exemplo n.º 6
0
    def configure(self, binder):

        super().configure(binder)

        binder.bind(MESSENGER_KEY,
                    ClassProvider(MessageBarMessenger),
                    scope=singleton)

        binder.bind(CHRONO_DIALOG_PRESENTER_KEY,
                    ClassProvider(ChronoDialogPresenter),
                    scope=singleton)
        binder.bind(CHRONO_DIALOG_KEY,
                    ClassProvider(ChronoDialog),
                    scope=singleton)
        binder.bind(CD_EXPORTER_MENU_ADDITIONS_PRESENTER_KEY,
                    ClassProvider(CDExporterMenuAdditionsPresenter),
                    scope=singleton)
        binder.bind(TEXT_GENERATOR_KEY,
                    ClassProvider(ChronoTextGenerator),
                    scope=singleton)

        binder.bind(EXPORT_INFO_WIZARD_KEY,
                    ClassProvider(ExportInfoWizard),
                    scope=singleton)
        binder.bind(EXPORT_INFO_WIZARD_PRESENTER,
                    ClassProvider(ExportInfoWizardPresenter),
                    scope=singleton)
    def configure(self, binder):

        binder.bind(guiinjectorkeys.WINDOW_MANAGER_KEY,
                    ClassProvider(WindowManager),
                    scope=singleton)

        binder.bind(guiinjectorkeys.EVENT_WINDOW_KEY,
                    ClassProvider(EventWindow),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_WINDOW_KEY,
                    ClassProvider(DocumentWindow),
                    scope=singleton)

        binder.bind(guiinjectorkeys.EVENT_MENU_ADDITIONS_KEY,
                    InstanceProvider([]))
        binder.bind(guiinjectorkeys.DOCUMENT_MENU_ADDITIONS_KEY,
                    InstanceProvider([]))

        binder.bind(guiinjectorkeys.DOCUMENT_WINDOW_ADDITIONAL_REFERENCES_KEY,
                    InstanceProvider([]))
        binder.bind(guiinjectorkeys.EVENT_WINDOW_ADDITIONAL_REFERENCES_KEY,
                    InstanceProvider([]))
Exemplo n.º 8
0
    def configure(self, binder):

        super().configure(binder)

        binder.bind(SYSTEMATIC_POINT_SELECTION_DIALOG_KEY,
                    ClassProvider(SystematicPointSelectionDialog),
                    scope=singleton)
        binder.bind(SYSTEMATIC_POINT_SELECTION_PRESENTER_KEY,
                    ClassProvider(SystematicPointSelectionPresenter),
                    scope=singleton)

        binder.bind(DOCUMENT_SYSTEMATIC_REFERENCES_PRESENTER_KEY,
                    ClassProvider(DocumentSystematicReferencesPresenter),
                    scope=singleton)
        binder.bind(DOCUMENT_SYSTEMATIC_REFERENCES_VIEW_CLASS_KEY,
                    InstanceProvider(DocumentSystematicReferenceView),
                    scope=singleton)

        binder.bind(SYSTEMATIC_MENU_ADDITIONS_PRESENTER_KEY,
                    ClassProvider(SystematicMenuAdditionsPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_FILTER_DIALOG_KEY,
                    ClassProvider(SystematicDocumentFilterDialog),
                    scope=singleton)
    def configure(self, binder):
        binder.bind(SYSTEMATIC_DAO_KEY,
                    ClassProvider(SystematicDao), scope=singleton)
        binder.bind(DOCUMENT_SYSTEMATIC_RELATIONS_DAO_KEY,
                    ClassProvider(DocumentSystematicRelationsDao), scope=singleton)

        binder.bind(SYSTEMATIC_SERVICE_KEY,
                    ClassProvider(SystematicService), scope=singleton)
        binder.bind(SYSTEMATIC_PDF_GENERATION_SERVICE_KEY,
                    ClassProvider(SystematicPdfGenerationService), scope=singleton)
        binder.bind(SYSTEMATIC_HTML_GENERATION_SERVICE_KEY,
                    ClassProvider(SystematicHtmlGenerationService), scope=singleton)

        binder.bind(baseinjectorkeys.DOCUMENT_FILTER_EXPRESSION_BUILDER_KEY,
                    ClassProvider(SystematicDocumentFilterExpressionBuilder),
                    scope=singleton)
Exemplo n.º 10
0
    def configure(self, binder):
        # General
        binder.bind(guiinjectorkeys.MESSAGE_BROKER_KEY,
                    ClassProvider(MessageBroker),
                    scope=singleton)
        # References
        binder.bind(guiinjectorkeys.DOCUMENT_EVENT_REFERENCES_PRESENTER_KEY,
                    ClassProvider(DocumentEventReferencesPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_DOCUMENT_REFERENCES_PRESENTER_KEY,
                    ClassProvider(EventDocumentReferencesPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_CROSS_REFERENCES_PRESENTER_KEY,
                    ClassProvider(EventCrossReferencesPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_FILE_REFERENCES_PRESENTER_KEY,
                    ClassProvider(DocumentFileReferencesPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_TYPE_REFERENCES_PRESENTER_KEY,
                    ClassProvider(EventTypeReferencesPresenter),
                    scope=singleton)
        # MainWindows
        binder.bind(guiinjectorkeys.EVENT_WINDOW_PRESENTER_KEY,
                    ClassProvider(EventWindowPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.DOCUMENT_WINDOW_PRESENTER_KEY,
                    ClassProvider(DocumentWindowPresenter),
                    scope=singleton)
        # Dialogs
        binder.bind(guiinjectorkeys.GENERIC_INPUT_DIALOG_PRESENTER,
                    ClassProvider(GenericInputDialogPresenter))
        binder.bind(guiinjectorkeys.DATE_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(DateSelectionDialogPresenter))
        binder.bind(guiinjectorkeys.EVENT_ID_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(EventIdSelectionDialogPresenter))
        binder.bind(guiinjectorkeys.EVENT_CONFIRMATION_PRESENTER_KEY,
                    ClassProvider(AbstractInputDialogPresenter))
        binder.bind(guiinjectorkeys.DATERANGE_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(DateRangeSelectionDialogPresenter))
        binder.bind(guiinjectorkeys.YEAR_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(YearSelectionDialogPresenter))
        binder.bind(guiinjectorkeys.EVENT_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(EventSelectionPresenter))
        binder.bind(guiinjectorkeys.DOCUMENTID_SELECTION_DIALOG_PRESENTER_KEY,
                    ClassProvider(DocumentIdSelectionDialogPresenter))
        binder.bind(guiinjectorkeys.DOCUMENT_FILTER_DIALOG_PRESENTER_KEY,
                    ClassProvider(DocumentFilterDialogPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_FILTER_DIALOG_PRESENTER_KEY,
                    ClassProvider(EventFilterDialogPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.LOGIN_DIALOG_PRESENTER_KEY,
                    ClassProvider(LoginDialogPresenter),
                    scope=singleton)
        binder.bind(guiinjectorkeys.EVENT_TYPE_SELECTION_PRESENTER_KEY,
                    ClassProvider(EventTypeSelectionPresenter),
                    scope=singleton)

        # Postprocessors
        binder.bind(guiinjectorkeys.DOCUMENT_TYPE_POST_PROCESSOR_KEY,
                    ClassProvider(DocumentTypePostProcessor),
                    scope=singleton)
        binder.bind(guiinjectorkeys.JOURNAL_DOCUMENT_TYPE_POST_PROCESSOR_KEY,
                    ClassProvider(JournalDocTypePostProcessor),
                    scope=singleton)
    def configure(self, binder):

        binder.bind(guiinjectorkeys.MESSAGE_BROKER_KEY,
                    ClassProvider(MessageBroker),
                    scope=singleton)
Exemplo n.º 12
0
        import tornado

        configuration = injector.get("configuration")
        request_mapping = [
            (r'/im/(.*)',
             instant_message_websockets.InstantMessageWebSocketController)
        ]
        tornado_webapp = tornado.web.Application(
            request_mapping, configuration.get('HTTP_SETTINGS'))
        tornado_webapp.listen(configuration.get('TORNADO_LISTEN_PORT'))
        return tornado_webapp


interface_bindings = {
    "web_container": {
        "to": ClassProvider(web_container.WebContainer),
        "scope": singleton
    },
    "ioloop": {
        "to": IOLoopInstanceProvider(),
        "scope": singleton
    },
    "http_server": {
        "to": HTTPServerInstanceProvider(),
        "scope": singleton
    },
    "configuration": {
        "to": InstanceProvider(settings.read_configuration()),
        "scope": singleton
    },
    "msg_broker_client": {
Exemplo n.º 13
0
 def configure(self, binder):
     binder.bind(User, to=ClassProvider(LoserUser), scope=SingletonScope)
     pass
Exemplo n.º 14
0
def _to_class_provider(cls):
    if not isinstance(cls, Provider):
        return ClassProvider(cls)
    return cls
Exemplo n.º 15
0
 def configure(self, binder):
     binder.bind(Engine, engine)
     binder.bind(MyRepository,
                 to=ClassProvider(sqla_crud(MyRepository)),
                 scope=singleton)
 def configure(self, binder):
     binder.bind(guiinjectorkeys.EVENT_CONFIRMATION_DIALOG_KEY,
                 ClassProvider(EventConfirmationDialog))
     binder.bind(guiinjectorkeys.GENERIC_STRING_EDIT_DIALOG_KEY,
                 ClassProvider(GenericStringEditDialog))
     binder.bind(guiinjectorkeys.GENERIC_STRING_SELECTION_DIALOG_KEY,
                 ClassProvider(GenericStringSelectionDialog))
     binder.bind(guiinjectorkeys.GENERIC_BOOLEAN_SELECTION_DIALOG_KEY,
                 ClassProvider(GenericBooleanSelectionDialog))
     binder.bind(guiinjectorkeys.DATE_SELECTION_DIALOG_KEY,
                 ClassProvider(SimpleDateSelectionDialog))
     binder.bind(guiinjectorkeys.EVENT_ID_SELECTION_DIALOG_KEY,
                 ClassProvider(EventIdSelectionDialog))
     binder.bind(guiinjectorkeys.DATERANGE_SELECTION_DIALOG_KEY,
                 ClassProvider(DateRangeSelectionDialog))
     binder.bind(guiinjectorkeys.YEAR_SELECTION_DIALOG_KEY,
                 ClassProvider(YearSelectionDialog))
     binder.bind(guiinjectorkeys.EVENT_SELECTION_DIALOG_KEY,
                 ClassProvider(EventSelectionWizard))
     binder.bind(guiinjectorkeys.DOCUMENTID_SELECTION_DIALOG_KEY,
                 ClassProvider(DocumentIdSelectionDialog))
     binder.bind(guiinjectorkeys.DOCUMENT_FILTER_DIALOG_KEY,
                 ClassProvider(DocumentFilterDialog),
                 scope=singleton)
     binder.bind(guiinjectorkeys.EVENT_FILTER_DIALOG_KEY,
                 ClassProvider(EventFilterDialog),
                 scope=singleton)
     binder.bind(guiinjectorkeys.LOGIN_DIALOG_KEY,
                 ClassProvider(LoginDialog),
                 scope=singleton)
     binder.bind(guiinjectorkeys.FILE_SELECTION_DIALOG_KEY,
                 ClassProvider(FileSelectionDialog),
                 scope=singleton)
     binder.bind(guiinjectorkeys.EVENT_TYPE_SELECTION_DIALOG_KEY,
                 ClassProvider(EventTypeSelectionDialog),
                 scope=singleton)
Exemplo n.º 17
0
    def configure(self, binder):

        binder.bind(DOCUMENT_PDF_PLUGIN_PRESENTER_KEY,
                    ClassProvider(DocumentPdfMenuAdditionPresenter),
                    scope=singleton)