slackoff.slack   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 16
dl 0
loc 30
rs 10
c 0
b 0
f 0

6 Functions

Rating   Name   Duplication   Size   Complexity  
A activate() 0 2 1
A signout() 0 2 1
A ready() 0 2 1
A signin() 0 2 1
A mute() 0 2 1
A unmute() 0 2 1
1
from pathlib import Path
2
3
from . import script
4
5
FUNCTIONS = Path(__file__).parent / "slack.applescript"
6
7
8
def activate() -> bool:
9
    return script.call(FUNCTIONS, "activate()")
10
11
12
def ready(workspace: str) -> bool:
13
    return script.call(FUNCTIONS, f'ready("{workspace}")', show_error=False)
14
15
16
def signin(workspace: str) -> bool:
17
    return script.call(FUNCTIONS, f'signin("{workspace}")')
18
19
20
def signout(workspace: str) -> bool:
21
    return script.call(FUNCTIONS, f'signout("{workspace}")', show_error=False)
22
23
24
def mute(workspace: str, channel: str) -> bool:
25
    return script.call(FUNCTIONS, f'mute("{workspace}", "{channel}")')
26
27
28
def unmute(workspace: str, channel: str) -> bool:
29
    return script.call(FUNCTIONS, f'unmute("{workspace}", "{channel}")')
30