Test Setup Failed
Push — develop ( e459d6...12ef70 )
by Dean
02:19
created

Pull.stop()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
cc 1
dl 0
loc 7
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
1 1
from plugin.sync.core.enums import SyncMode
2 1
from plugin.sync.modes.core.base import Mode
3 1
from plugin.sync.modes.pull.movies import Movies
4 1
from plugin.sync.modes.pull.shows import Shows
5 1
from plugin.sync.modes.pull.lists import LikedLists, PersonalLists, Watchlist
6 1
import elapsed
7 1
import logging
8
9 1
log = logging.getLogger(__name__)
10
11
12 1
class Pull(Mode):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13 1
    mode = SyncMode.Pull
14
15 1
    children = [
16
        Movies,
17
        Shows,
18
19
        LikedLists,
20
        PersonalLists,
21
        Watchlist
22
    ]
23
24 1
    @elapsed.clock
25
    def construct(self):
26
        # Start progress tracking
27
        self.current.progress.start()
28
29
        # Construct children
30
        self.execute_children('construct')
31
32
    @elapsed.clock
33
    def start(self):
34
        # Fetch changes from trakt.tv
35
        self.trakt.refresh()
36
37
        # Build key table for lookups
38
        self.trakt.build_table()
39
40
        # Start children
41
        self.execute_children('start')
42
43
    @elapsed.clock
44
    def run(self):
45
        # Run children
46
        self.execute_children('run')
47
48
    @elapsed.clock
49
    def stop(self):
50
        # Stop children
51
        self.execute_children('stop')
52
53
        # Stop progress tracking
54
        self.current.progress.stop()
55