Dependencies   A
last analyzed

Complexity

Total Complexity 25

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 90
rs 10
c 1
b 0
f 0
wmc 25

21 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 4 2
A reconfigureOrGetConfiguration() 0 4 2
A getListener() 0 3 1
A getSerializer() 0 3 1
A getCamera() 0 3 1
A getPictureCache() 0 3 1
A getUsers() 0 3 1
A getFormatFactory() 0 3 1
A getFileFactory() 0 3 1
A getFileFilter() 0 3 1
A getQuery() 0 3 1
A getLocationFactory() 0 3 1
A getHasher() 0 3 1
A getPipelineFactory() 0 3 1
A getConfiguration() 0 2 1
A getExternals() 0 3 1
A getRepository() 0 7 3
A getFilesystem() 0 3 1
A getMediumFactory() 0 3 1
A getClock() 0 3 1
A getLibraries() 0 3 1
1
from niprov.config import Configuration
2
3
4
class Dependencies(object):
5
6
    def __init__(self, config=None):
7
        if config is None:
8
            config = Configuration()
9
        self.config = config
10
11
    def reconfigureOrGetConfiguration(self, newConfiguration):
12
        if newConfiguration is not None:
13
            self.config = newConfiguration
14
        return self.config
15
16
    def getCamera(self):
17
        import niprov.camera
18
        return niprov.camera.Camera(dependencies=self)
19
20
    def getClock(self):
21
        import niprov.clock
22
        return niprov.clock.Clock()
23
24
    def getConfiguration(self):
25
        return self.config
26
27
    def getExternals(self):
28
        import niprov.externals
29
        return niprov.externals.Externals()
30
31
    def getFileFactory(self):
32
        import niprov.files
33
        return niprov.files.FileFactory(dependencies=self)
34
35
    def getFileFilter(self):
36
        import niprov.filefilter
37
        return niprov.filefilter.FileFilter(dependencies=self)
38
39
    def getFilesystem(self):
40
        import niprov.filesystem
41
        return niprov.filesystem.Filesystem()
42
43
    def getFormatFactory(self):
44
        import niprov.formatfactory
45
        return niprov.formatfactory.FormatFactory(dependencies=self)
46
47
    def getHasher(self):
48
        import niprov.hashing
49
        return niprov.hashing.Hasher()
50
51
    def getLibraries(self):
52
        import niprov.libraries
53
        return niprov.libraries.Libraries()
54
55
    def getListener(self):
56
        import niprov.commandline
57
        return niprov.commandline.Commandline(dependencies=self)
58
59
    def getLocationFactory(self):
60
        import niprov.locationfactory
61
        return niprov.locationfactory.LocationFactory(dependencies=self)
62
63
    def getMediumFactory(self):
64
        import niprov.mediumfactory
65
        return niprov.mediumfactory.MediumFactory(dependencies=self)
66
67
    def getRepository(self):
68
        import niprov.jsonfile
69
        import niprov.mongo
70
        if self.config.database_type == 'file':
71
            return niprov.jsonfile.JsonFile(dependencies=self)
72
        elif self.config.database_type == 'MongoDB':
73
            return niprov.mongo.MongoRepository(dependencies=self)
74
75
    def getSerializer(self):
76
        import niprov.formatjson
77
        return niprov.formatjson.JsonFormat(self)
78
79
    def getPictureCache(self):
80
        import niprov.pictures
81
        return niprov.pictures.PictureCache(dependencies=self)
82
83
    def getPipelineFactory(self):
84
        import niprov.pipelinefactory
85
        return niprov.pipelinefactory.PipelineFactory(dependencies=self)
86
87
    def getQuery(self):
88
        import niprov.querying
89
        return niprov.querying.Query(dependencies=self)
90
91
    def getUsers(self):
92
        import niprov.users
93
        return niprov.users.Users(dependencies=self)
94
95