Completed
Pull Request — master (#112)
by Jasper
01:09
created

Users.determineUser()   A

Complexity

Conditions 3

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 3
dl 0
loc 7
rs 9.4285
1
import getpass
2
3
class Users(object):
4
5
    def __init__(self, dependencies):
6
        self.config = dependencies.getConfiguration()
7
8
    def determineUser(self, passedUserValue):
9
        if passedUserValue is not None:
10
            return passedUserValue
11
        if self.config.user:
12
            return self.config.user
13
        else:
14
            return getpass.getuser()
15