HackaProfile 0.1.0__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/PKG-INFO +47 -8
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/requires.txt +1 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/PKG-INFO +47 -8
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/README.md +42 -7
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/pyproject.toml +7 -2
- hackaprofile-1.1.0/src/agent.py +94 -0
- hackaprofile-1.1.0/src/configTemplate/slack.hackaprofile.conf +61 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/frontend.py +1 -0
- hackaprofile-0.1.0/src/agent.py +0 -106
- hackaprofile-0.1.0/src/configTemplate/slack.hackaprofile.conf +0 -11
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/SOURCES.txt +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/dependency_links.txt +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/entry_points.txt +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/HackaProfile.egg-info/top_level.txt +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/setup.cfg +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/__init__.py +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/backend.py +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/configTemplate/agent.pid +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/configTemplate/hackaprofile.conf +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/configTemplate/hackatime.hackaprofile.conf +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/hackatimeOA.py +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/logTemplate/agent.log +0 -0
- {hackaprofile-0.1.0 → hackaprofile-1.1.0}/src/slackOA.py +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: HackaProfile
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A simple tool to automatically update Slack user profile based on their Hackatime/Wakatime heartbeat!
|
|
5
|
+
Project-URL: Repository, https://github.com/zibuyin/HackaProfile
|
|
6
|
+
Project-URL: Issues, https://github.com/zibuyin/HackaProfile/issues
|
|
7
|
+
Project-URL: Homepage, https://github.com/zibuyin/HackaProfile
|
|
5
8
|
Requires-Python: >=3.10
|
|
6
9
|
Description-Content-Type: text/markdown
|
|
7
10
|
Requires-Dist: annotated-doc==0.0.4
|
|
@@ -36,6 +39,7 @@ Requires-Dist: urllib3==2.7.0
|
|
|
36
39
|
Requires-Dist: wcwidth==0.8.1
|
|
37
40
|
Requires-Dist: Werkzeug==3.1.8
|
|
38
41
|
Requires-Dist: platformdirs==4.10.0
|
|
42
|
+
Requires-Dist: Jinja2==3.1.6
|
|
39
43
|
|
|
40
44
|
# HackaProfile
|
|
41
45
|
<img src="./assets/icon.png" width=30% alt="HackaProfile logo"></img>
|
|
@@ -48,13 +52,16 @@ Requires-Dist: platformdirs==4.10.0
|
|
|
48
52
|
- More features #TODO ~~(I don't wanna write README.md >:3)~~
|
|
49
53
|
|
|
50
54
|
## installation
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
### Install pipx
|
|
56
|
+
Check [pipx docs](https://pipx.pypa.io/stable/how-to/install-pipx/)
|
|
57
|
+
|
|
58
|
+
### Install Hackaprofile
|
|
59
|
+
```bash
|
|
60
|
+
pipx install hackaprofile
|
|
61
|
+
hackaprofile setup
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then follow the guided setup
|
|
58
65
|
|
|
59
66
|
## Placeholder Variables
|
|
60
67
|
A key feature of HackaProfile is that it allows you to customise your profile however you like (just like how you would change it on Slack/other platforms) BUT it **also allows you to use dynamic values** (i.e. Placeholder variables).
|
|
@@ -77,3 +84,35 @@ Example
|
|
|
77
84
|
- `{{entity}}` Path to the file workng on
|
|
78
85
|
- `{{machine}}` Current machine's hostname
|
|
79
86
|
|
|
87
|
+
## Logic Operators
|
|
88
|
+
You could not only dynamically set variables, but you could also **choose how they are represented dynamically*
|
|
89
|
+
|
|
90
|
+
### If Statements:
|
|
91
|
+
`{% if [condition] %} ... {% elif [condition] %} ... {% else %} ... {% endif %}
|
|
92
|
+
### Filters:
|
|
93
|
+
|
|
94
|
+
Transforms the string to lowercase
|
|
95
|
+
```
|
|
96
|
+
{{string|lower}}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Transforms the STRING to UPPERCASE
|
|
100
|
+
```
|
|
101
|
+
{{string|upper}}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Transforms the String into a Title format
|
|
105
|
+
```
|
|
106
|
+
{{string|title}}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Escaping:
|
|
110
|
+
```
|
|
111
|
+
{{ "string to be escaped" }}
|
|
112
|
+
```
|
|
113
|
+
or
|
|
114
|
+
```
|
|
115
|
+
{% raw %}
|
|
116
|
+
string to be escaped
|
|
117
|
+
{% endraw %}
|
|
118
|
+
```
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: HackaProfile
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A simple tool to automatically update Slack user profile based on their Hackatime/Wakatime heartbeat!
|
|
5
|
+
Project-URL: Repository, https://github.com/zibuyin/HackaProfile
|
|
6
|
+
Project-URL: Issues, https://github.com/zibuyin/HackaProfile/issues
|
|
7
|
+
Project-URL: Homepage, https://github.com/zibuyin/HackaProfile
|
|
5
8
|
Requires-Python: >=3.10
|
|
6
9
|
Description-Content-Type: text/markdown
|
|
7
10
|
Requires-Dist: annotated-doc==0.0.4
|
|
@@ -36,6 +39,7 @@ Requires-Dist: urllib3==2.7.0
|
|
|
36
39
|
Requires-Dist: wcwidth==0.8.1
|
|
37
40
|
Requires-Dist: Werkzeug==3.1.8
|
|
38
41
|
Requires-Dist: platformdirs==4.10.0
|
|
42
|
+
Requires-Dist: Jinja2==3.1.6
|
|
39
43
|
|
|
40
44
|
# HackaProfile
|
|
41
45
|
<img src="./assets/icon.png" width=30% alt="HackaProfile logo"></img>
|
|
@@ -48,13 +52,16 @@ Requires-Dist: platformdirs==4.10.0
|
|
|
48
52
|
- More features #TODO ~~(I don't wanna write README.md >:3)~~
|
|
49
53
|
|
|
50
54
|
## installation
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
### Install pipx
|
|
56
|
+
Check [pipx docs](https://pipx.pypa.io/stable/how-to/install-pipx/)
|
|
57
|
+
|
|
58
|
+
### Install Hackaprofile
|
|
59
|
+
```bash
|
|
60
|
+
pipx install hackaprofile
|
|
61
|
+
hackaprofile setup
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then follow the guided setup
|
|
58
65
|
|
|
59
66
|
## Placeholder Variables
|
|
60
67
|
A key feature of HackaProfile is that it allows you to customise your profile however you like (just like how you would change it on Slack/other platforms) BUT it **also allows you to use dynamic values** (i.e. Placeholder variables).
|
|
@@ -77,3 +84,35 @@ Example
|
|
|
77
84
|
- `{{entity}}` Path to the file workng on
|
|
78
85
|
- `{{machine}}` Current machine's hostname
|
|
79
86
|
|
|
87
|
+
## Logic Operators
|
|
88
|
+
You could not only dynamically set variables, but you could also **choose how they are represented dynamically*
|
|
89
|
+
|
|
90
|
+
### If Statements:
|
|
91
|
+
`{% if [condition] %} ... {% elif [condition] %} ... {% else %} ... {% endif %}
|
|
92
|
+
### Filters:
|
|
93
|
+
|
|
94
|
+
Transforms the string to lowercase
|
|
95
|
+
```
|
|
96
|
+
{{string|lower}}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Transforms the STRING to UPPERCASE
|
|
100
|
+
```
|
|
101
|
+
{{string|upper}}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Transforms the String into a Title format
|
|
105
|
+
```
|
|
106
|
+
{{string|title}}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Escaping:
|
|
110
|
+
```
|
|
111
|
+
{{ "string to be escaped" }}
|
|
112
|
+
```
|
|
113
|
+
or
|
|
114
|
+
```
|
|
115
|
+
{% raw %}
|
|
116
|
+
string to be escaped
|
|
117
|
+
{% endraw %}
|
|
118
|
+
```
|
|
@@ -9,13 +9,16 @@
|
|
|
9
9
|
- More features #TODO ~~(I don't wanna write README.md >:3)~~
|
|
10
10
|
|
|
11
11
|
## installation
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
### Install pipx
|
|
13
|
+
Check [pipx docs](https://pipx.pypa.io/stable/how-to/install-pipx/)
|
|
14
|
+
|
|
15
|
+
### Install Hackaprofile
|
|
16
|
+
```bash
|
|
17
|
+
pipx install hackaprofile
|
|
18
|
+
hackaprofile setup
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then follow the guided setup
|
|
19
22
|
|
|
20
23
|
## Placeholder Variables
|
|
21
24
|
A key feature of HackaProfile is that it allows you to customise your profile however you like (just like how you would change it on Slack/other platforms) BUT it **also allows you to use dynamic values** (i.e. Placeholder variables).
|
|
@@ -38,3 +41,35 @@ Example
|
|
|
38
41
|
- `{{entity}}` Path to the file workng on
|
|
39
42
|
- `{{machine}}` Current machine's hostname
|
|
40
43
|
|
|
44
|
+
## Logic Operators
|
|
45
|
+
You could not only dynamically set variables, but you could also **choose how they are represented dynamically*
|
|
46
|
+
|
|
47
|
+
### If Statements:
|
|
48
|
+
`{% if [condition] %} ... {% elif [condition] %} ... {% else %} ... {% endif %}
|
|
49
|
+
### Filters:
|
|
50
|
+
|
|
51
|
+
Transforms the string to lowercase
|
|
52
|
+
```
|
|
53
|
+
{{string|lower}}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Transforms the STRING to UPPERCASE
|
|
57
|
+
```
|
|
58
|
+
{{string|upper}}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Transforms the String into a Title format
|
|
62
|
+
```
|
|
63
|
+
{{string|title}}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Escaping:
|
|
67
|
+
```
|
|
68
|
+
{{ "string to be escaped" }}
|
|
69
|
+
```
|
|
70
|
+
or
|
|
71
|
+
```
|
|
72
|
+
{% raw %}
|
|
73
|
+
string to be escaped
|
|
74
|
+
{% endraw %}
|
|
75
|
+
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "HackaProfile"
|
|
7
|
-
version = "
|
|
7
|
+
version = "1.1.0"
|
|
8
8
|
description = "A simple tool to automatically update Slack user profile based on their Hackatime/Wakatime heartbeat!"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -41,8 +41,13 @@ dependencies = [
|
|
|
41
41
|
"wcwidth==0.8.1",
|
|
42
42
|
"Werkzeug==3.1.8",
|
|
43
43
|
"platformdirs==4.10.0",
|
|
44
|
-
|
|
44
|
+
"Jinja2==3.1.6",
|
|
45
45
|
|
|
46
|
+
]
|
|
47
|
+
[project.urls]
|
|
48
|
+
Repository = "https://github.com/zibuyin/HackaProfile"
|
|
49
|
+
Issues = "https://github.com/zibuyin/HackaProfile/issues"
|
|
50
|
+
Homepage = "https://github.com/zibuyin/HackaProfile"
|
|
46
51
|
[project.scripts]
|
|
47
52
|
hackaprofile = "src.frontend:app"
|
|
48
53
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import time
|
|
2
|
+
try:
|
|
3
|
+
from . import backend
|
|
4
|
+
except ImportError:
|
|
5
|
+
import backend
|
|
6
|
+
import dotenv
|
|
7
|
+
import os
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
import platformdirs
|
|
10
|
+
from jinja2 import Template
|
|
11
|
+
|
|
12
|
+
print("***** WORKER AGENT STARTER *****")
|
|
13
|
+
hackatime = backend.hackatime()
|
|
14
|
+
slack = backend.slack()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
active_services = ["slack"]
|
|
18
|
+
interval = 20
|
|
19
|
+
HOME = Path.home()
|
|
20
|
+
CONFIG_DIR = Path(platformdirs.user_config_dir("hackaprofile"))
|
|
21
|
+
LOG_DIR = Path(platformdirs.user_log_dir("hackaprofile"))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# langauge = ""
|
|
25
|
+
|
|
26
|
+
pid = os.getpid()
|
|
27
|
+
with open(CONFIG_DIR / "agent.pid", "w") as f:
|
|
28
|
+
f.write(str(pid))
|
|
29
|
+
f.close()
|
|
30
|
+
|
|
31
|
+
def clean_value(value: str) -> str:
|
|
32
|
+
"""
|
|
33
|
+
Makes the values clean for slack (Value passed for `name` contained unallowed special characters)
|
|
34
|
+
"""
|
|
35
|
+
return value.replace("<", "").replace(">", "")
|
|
36
|
+
|
|
37
|
+
def parse_config(config: dict, map):
|
|
38
|
+
parsed_config = {}
|
|
39
|
+
for key, template_str in config.items():
|
|
40
|
+
template = Template(template_str)
|
|
41
|
+
result = template.render(**map)
|
|
42
|
+
|
|
43
|
+
# # if the config field is empty, don't append it
|
|
44
|
+
# if key == "status_expiration":
|
|
45
|
+
# parsed_value = int(parsed_value)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
parsed_config[key] = result
|
|
49
|
+
|
|
50
|
+
# print(parsed)
|
|
51
|
+
print("===")
|
|
52
|
+
print(parsed_config)
|
|
53
|
+
print("===")
|
|
54
|
+
return parsed_config
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
while True:
|
|
58
|
+
json = hackatime.fetch_hb()
|
|
59
|
+
|
|
60
|
+
# for _, field in enumerate(json):
|
|
61
|
+
# key = field
|
|
62
|
+
# value = json.get(field, "")
|
|
63
|
+
|
|
64
|
+
# project =
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
map = {
|
|
68
|
+
"id": json.get("id", ""),
|
|
69
|
+
"created_at": json.get("created_at", ""),
|
|
70
|
+
"time": json.get("time", ""),
|
|
71
|
+
"category": json.get("category", ""),
|
|
72
|
+
"project": json.get("project", ""),
|
|
73
|
+
"language": json.get("language", ""),
|
|
74
|
+
"editor": json.get("editor", ""),
|
|
75
|
+
"operating_system": json.get("operating_system", ""),
|
|
76
|
+
"machine": json.get("machine", ""),
|
|
77
|
+
"entity": json.get("entity", "")
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
print(f'Language: {map["language"]}')
|
|
83
|
+
print("---HT HB---")
|
|
84
|
+
print(json)
|
|
85
|
+
print("---EO HT HB---")
|
|
86
|
+
if "slack" in active_services:
|
|
87
|
+
print(slack.fetch_config())
|
|
88
|
+
config = parse_config(slack.fetch_config(), map)
|
|
89
|
+
print(config)
|
|
90
|
+
|
|
91
|
+
res = slack.set_profile(config)
|
|
92
|
+
print(res)
|
|
93
|
+
print("---")
|
|
94
|
+
time.sleep(interval)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#--------------------------------------#
|
|
2
|
+
# Don't change this plz (it will break...)
|
|
3
|
+
client_id = "2210535565.11339190985360"
|
|
4
|
+
#--------------------------------------#
|
|
5
|
+
|
|
6
|
+
# Fill values by uncommenting the field ID line under each label.
|
|
7
|
+
# WARNING: An empty string WILL literally set that field to empty (i.e. clear it), comment out field you don't want to be automatically updated
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Docs: https://docs.slack.dev/reference/methods/users.profile.set#profile-fields
|
|
11
|
+
|
|
12
|
+
# title =
|
|
13
|
+
# phone =
|
|
14
|
+
# real_name =
|
|
15
|
+
# display_name =
|
|
16
|
+
|
|
17
|
+
# Docs: https://docs.slack.dev/reference/methods/users.profile.set#status
|
|
18
|
+
|
|
19
|
+
# status_text =
|
|
20
|
+
# status_emoji =
|
|
21
|
+
|
|
22
|
+
# ONLY SET TO INT (See docs)
|
|
23
|
+
# status_expiration =
|
|
24
|
+
|
|
25
|
+
# status_clear_on_focus_end =
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# Hackclub Slack specific
|
|
30
|
+
|
|
31
|
+
# Github URL
|
|
32
|
+
# Xf09V176UVK5 =
|
|
33
|
+
|
|
34
|
+
# Birthday (YYYY-MM-DD)
|
|
35
|
+
# Xf0A06G5MKJM =
|
|
36
|
+
|
|
37
|
+
# Dog or Cat or Infrastructure?
|
|
38
|
+
# Xf09VB64B1PE =
|
|
39
|
+
|
|
40
|
+
# PFP Credit
|
|
41
|
+
# Xf09V5HE0MU6 =
|
|
42
|
+
|
|
43
|
+
# Website
|
|
44
|
+
# Xf09V45UG8AZ =
|
|
45
|
+
|
|
46
|
+
# Fav Languages/Tools
|
|
47
|
+
# Xf09V1775W91 =
|
|
48
|
+
|
|
49
|
+
# Start Date (YYYY-MM-DD)
|
|
50
|
+
# Xf09UWTTJF6Z =
|
|
51
|
+
|
|
52
|
+
# Fandoms
|
|
53
|
+
# Xf0AC8RUMQCT =
|
|
54
|
+
|
|
55
|
+
# Favorite Emoji
|
|
56
|
+
# Xf0APVLWEUC8 =
|
|
57
|
+
|
|
58
|
+
# HAM Callsign
|
|
59
|
+
# Xf0A06G5TTKK =
|
|
60
|
+
|
|
61
|
+
# Check README.md
|
hackaprofile-0.1.0/src/agent.py
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
try:
|
|
3
|
-
from . import backend
|
|
4
|
-
except ImportError:
|
|
5
|
-
import backend
|
|
6
|
-
import dotenv
|
|
7
|
-
import os
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
import platformdirs
|
|
10
|
-
|
|
11
|
-
hackatime = backend.hackatime()
|
|
12
|
-
slack = backend.slack()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
active_services = ["slack"]
|
|
16
|
-
interval = 20
|
|
17
|
-
HOME = Path.home()
|
|
18
|
-
CONFIG_DIR = Path(platformdirs.user_config_dir("hackaprofile"))
|
|
19
|
-
LOG_DIR = Path(platformdirs.user_log_dir("hackaprofile"))
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# langauge = ""
|
|
23
|
-
|
|
24
|
-
pid = os.getpid()
|
|
25
|
-
with open(CONFIG_DIR / "agent.pid", "w") as f:
|
|
26
|
-
f.write(str(pid))
|
|
27
|
-
f.close()
|
|
28
|
-
|
|
29
|
-
def clean_value(value: str) -> str:
|
|
30
|
-
"""
|
|
31
|
-
Makes the values clean for slack (Value passed for `name` contained unallowed special characters)
|
|
32
|
-
"""
|
|
33
|
-
return value.replace("<", "").replace(">", "")
|
|
34
|
-
|
|
35
|
-
def parse_config(config: dict, map):
|
|
36
|
-
parsed_config = {}
|
|
37
|
-
for _, field in enumerate(config):
|
|
38
|
-
key = field
|
|
39
|
-
template: str = config[field]
|
|
40
|
-
# Replace {{key}} placeholders directly from the map.
|
|
41
|
-
for map_key, map_value in map.items():
|
|
42
|
-
template = template.replace(map_key, str(map_value))
|
|
43
|
-
try:
|
|
44
|
-
parsed_value = clean_value(template.format_map(map))
|
|
45
|
-
|
|
46
|
-
# if the config field is empty, don't append it
|
|
47
|
-
if parsed_value != "":
|
|
48
|
-
parsed_config[key] = parsed_value
|
|
49
|
-
except KeyError:
|
|
50
|
-
pass
|
|
51
|
-
|
|
52
|
-
# print(parsed)
|
|
53
|
-
|
|
54
|
-
return parsed_config
|
|
55
|
-
|
|
56
|
-
while True:
|
|
57
|
-
json = hackatime.fetch_hb()
|
|
58
|
-
|
|
59
|
-
# for _, field in enumerate(json):
|
|
60
|
-
# key = field
|
|
61
|
-
# value = json.get(field, "")
|
|
62
|
-
|
|
63
|
-
# project =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
map = {
|
|
67
|
-
"{{id}}": json.get("id", ""),
|
|
68
|
-
"{{created_at}}": json.get("created_at", ""),
|
|
69
|
-
"{{time}}": json.get("time", ""),
|
|
70
|
-
"{{category}}": json.get("category", ""),
|
|
71
|
-
"{{project}}": json.get("project", ""),
|
|
72
|
-
"{{language}}": json.get("language", ""),
|
|
73
|
-
"{{editor}}": json.get("editor", ""),
|
|
74
|
-
"{{operating_system}}": json.get("operating_system", ""),
|
|
75
|
-
"{{machine}}": json.get("machine", ""),
|
|
76
|
-
"{{entity}}": json.get("entity", "")
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
print(f'Language: {map["{{language}}"]}')
|
|
82
|
-
print(json)
|
|
83
|
-
|
|
84
|
-
if "slack" in active_services:
|
|
85
|
-
print(slack.fetch_config())
|
|
86
|
-
config = parse_config(slack.fetch_config(), map)
|
|
87
|
-
print(config)
|
|
88
|
-
|
|
89
|
-
res = slack.set_profile(config)
|
|
90
|
-
print(res)
|
|
91
|
-
# for _, field in enumerate(slack_config):
|
|
92
|
-
# print((field, slack_config[field]))
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
# slack.set_profile(
|
|
96
|
-
# profile={
|
|
97
|
-
# "status_text": "test status text",
|
|
98
|
-
# "status_emoji": ":67:",
|
|
99
|
-
# "status_expiration": 0
|
|
100
|
-
# })
|
|
101
|
-
print("---")
|
|
102
|
-
time.sleep(interval)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|