Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)

        def get_importer_class(type):
    global importers
    return importers.get(type)
        


src/a/n/anki-sync-server-HEAD/AnkiServer/apps/rest_app.py   anki-sync-server(Download)
    def _get_importer_class(self, data):
        filetype = data['filetype']
 
        from AnkiServer.importer import get_importer_class
        importer_class = get_importer_class(filetype)

src/a/n/AnkiServer-2.0.5/AnkiServer/apps/rest_app.py   AnkiServer(Download)
    def _get_importer_class(self, data):
        filetype = data['filetype']
 
        from AnkiServer.importer import get_importer_class
        importer_class = get_importer_class(filetype)

src/a/n/anki-sync-server-HEAD/tests/test_importer.py   anki-sync-server(Download)
 
import AnkiServer
from AnkiServer.importer import get_importer_class, import_file
 
import anki.storage
 
        # import it into the main collection
        import_file(get_importer_class('apkg'), self.collection, dst1_path)
 
        # make sure the note exists
 
        # first, import it without allow_update - no change should happen
        import_file(get_importer_class('apkg'), self.collection, dst2_path, allow_update=False)
        note = self.collection.getNote(note_id)
        self.assertEqual(note['Front'], 'The front')
        self.assertEqual(note.tags, ['Tag1', 'Tag2'])
 
        # now, import it with allow_update=True, so the note should change
        import_file(get_importer_class('apkg'), self.collection, dst2_path, allow_update=True)