From fbd08ed30517f12d2425bee348f2aa44d360a0db Mon Sep 17 00:00:00 2001 From: Grégoire Paris Date: Wed, 5 Jan 2022 21:05:00 +0100 Subject: Define matchup's MatchWord highlight --- colors/base16-atelier-cave-light.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'colors/base16-atelier-cave-light.vim') diff --git a/colors/base16-atelier-cave-light.vim b/colors/base16-atelier-cave-light.vim index 3fca434..8d9ee3d 100644 --- a/colors/base16-atelier-cave-light.vim +++ b/colors/base16-atelier-cave-light.vim @@ -510,6 +510,9 @@ call hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00 call hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "") call hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "") +" Matchup +call hi("MatchWord", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "underline", "") + " NERDTree call hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "") call hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "") -- cgit v1.2.3 itten in PythonMichaël Ball
summaryrefslogtreecommitdiff
blob: 4d4887fdae5fe1c875f67a5d2a37c35fff409acf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""Define a user."""
from os import urandom

from itsdangerous import URLSafeTimedSerializer

from common.security import pwd_context


class User(object):
    def __init__(self, **kwargs):
        for (key, value) in kwargs.items():
            setattr(self, key, value)

    def get_id(self):
        if self.id:
            return str(self.id)
        else:
            raise ValueError("No user")

    def is_authenticated(self):
        if self.authenticated > 0:
            return True
        else:
            return False

    def is_active(self):
        if self.active > 0:
            return True
        else:
            return False

    def is_anonymous(self):
        if self.anonymous > 0:
            return True
        else:
            return False

    def verify(self, password):
        if self.id and pwd_context.verify(password, self.password_hash):
            self.authenticated = 1
            return True
        else:
            return False

    def new_password(self, password, category=None):
        if self.id:
            the_hash = None

            if category:
                the_hash = pwd_context.encrypt(password, category=category)
            else:
                the_hash = pwd_context.encrypt(password)

            serializer = URLSafeTimedSerializer(password, salt=urandom(64))
            api_key = serializer.dumps(the_hash)

            return the_hash, api_key

        else:
            raise ValueError("No user")

    def to_dict(self):
        """Return a dict representation of the user."""
        return_dict = dict()
        for key, item in self.__dict__.items():
            try:
                return_dict[key] = item.to_dict()
            except AttributeError:
                return_dict[key] = item

        return return_dict