Remove explicit inherits from object
This commit is contained in:
parent
95eadafb9b
commit
3d6a2a639a
@ -3,7 +3,7 @@ import anki.storage
|
|||||||
|
|
||||||
import os, errno
|
import os, errno
|
||||||
|
|
||||||
class CollectionWrapper(object):
|
class CollectionWrapper:
|
||||||
"""A simple wrapper around an anki.storage.Collection object.
|
"""A simple wrapper around an anki.storage.Collection object.
|
||||||
|
|
||||||
This allows us to manage and refer to the collection, whether it's open or not. It
|
This allows us to manage and refer to the collection, whether it's open or not. It
|
||||||
@ -84,7 +84,7 @@ class CollectionWrapper(object):
|
|||||||
"""Returns True if the collection is open, False otherwise."""
|
"""Returns True if the collection is open, False otherwise."""
|
||||||
return self.__col is not None
|
return self.__col is not None
|
||||||
|
|
||||||
class CollectionManager(object):
|
class CollectionManager:
|
||||||
"""Manages a set of CollectionWrapper objects."""
|
"""Manages a set of CollectionWrapper objects."""
|
||||||
|
|
||||||
collection_wrapper = CollectionWrapper
|
collection_wrapper = CollectionWrapper
|
||||||
|
|||||||
@ -276,7 +276,7 @@ class SyncMediaHandler(anki.sync.MediaSyncer):
|
|||||||
|
|
||||||
return {'data': result, 'err':''}
|
return {'data': result, 'err':''}
|
||||||
|
|
||||||
class SyncUserSession(object):
|
class SyncUserSession:
|
||||||
def __init__(self, name, path, collection_manager, setup_new_collection=None):
|
def __init__(self, name, path, collection_manager, setup_new_collection=None):
|
||||||
import time
|
import time
|
||||||
self.skey = self._generate_session_key()
|
self.skey = self._generate_session_key()
|
||||||
@ -319,7 +319,7 @@ class SyncUserSession(object):
|
|||||||
handler.col = col
|
handler.col = col
|
||||||
return handler
|
return handler
|
||||||
|
|
||||||
class SimpleSessionManager(object):
|
class SimpleSessionManager:
|
||||||
"""A simple session manager that keeps the sessions in memory."""
|
"""A simple session manager that keeps the sessions in memory."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -339,7 +339,7 @@ class SimpleSessionManager(object):
|
|||||||
def delete(self, hkey):
|
def delete(self, hkey):
|
||||||
del self.sessions[hkey]
|
del self.sessions[hkey]
|
||||||
|
|
||||||
class SyncApp(object):
|
class SyncApp:
|
||||||
valid_urls = SyncCollectionHandler.operations + SyncMediaHandler.operations + ['hostKey', 'upload', 'download']
|
valid_urls = SyncCollectionHandler.operations + SyncMediaHandler.operations + ['hostKey', 'upload', 'download']
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from queue import Queue
|
|||||||
|
|
||||||
import time, logging
|
import time, logging
|
||||||
|
|
||||||
class ThreadingCollectionWrapper(object):
|
class ThreadingCollectionWrapper:
|
||||||
"""Provides the same interface as CollectionWrapper, but it creates a new Thread to
|
"""Provides the same interface as CollectionWrapper, but it creates a new Thread to
|
||||||
interact with the collection."""
|
interact with the collection."""
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import os
|
|||||||
import sqlite3 as sqlite
|
import sqlite3 as sqlite
|
||||||
|
|
||||||
|
|
||||||
class SimpleUserManager(object):
|
class SimpleUserManager:
|
||||||
"""A simple user manager that always allows any user."""
|
"""A simple user manager that always allows any user."""
|
||||||
|
|
||||||
def __init__(self, collection_path=''):
|
def __init__(self, collection_path=''):
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import tempfile
|
|||||||
from anki import Collection
|
from anki import Collection
|
||||||
|
|
||||||
|
|
||||||
class CollectionUtils(object):
|
class CollectionUtils:
|
||||||
"""
|
"""
|
||||||
Provides utility methods for creating, inspecting and manipulating anki
|
Provides utility methods for creating, inspecting and manipulating anki
|
||||||
collections.
|
collections.
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import logging
|
|||||||
from anki.sync import HttpSyncer, RemoteServer, RemoteMediaServer
|
from anki.sync import HttpSyncer, RemoteServer, RemoteMediaServer
|
||||||
|
|
||||||
|
|
||||||
class MockServerConnection(object):
|
class MockServerConnection:
|
||||||
"""
|
"""
|
||||||
Mock for HttpSyncer's con attribute, a httplib2 connection. All requests
|
Mock for HttpSyncer's con attribute, a httplib2 connection. All requests
|
||||||
that would normally got to the remote server will be redirected to our
|
that would normally got to the remote server will be redirected to our
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user