Update Channel List

This commit is contained in:
Mickael 2019-07-18 21:05:15 +02:00
parent a76844be70
commit 3767942a07
3 changed files with 8 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -4,6 +4,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from pprint import pprint from pprint import pprint
from colorama import init, Fore
from rocketchat_API.rocketchat import RocketChat from rocketchat_API.rocketchat import RocketChat
import json import json
import dev_config as cfg import dev_config as cfg
@ -13,6 +14,8 @@ from common.channelhelper import getNodesOrigin, getAllChannels, Tsunami
def main(): def main():
init()
colorInfo = { colorInfo = {
'global': 'orange', 'global': 'orange',
'technologie': 'gray', 'technologie': 'gray',
@ -35,13 +38,14 @@ def main():
cohortescolor = { 'fr': 'green' } cohortescolor = { 'fr': 'green' }
nbChannels = 0 nbChannels = 0
nbCohorte = 0 nbCohorte = 0
totalChannels = 0
for channel in getAllChannels(rocket): for channel in getAllChannels(rocket):
print("{}".format(channel['name'])) print("{}".format(channel['name']))
if channel['name'].find('cohorte') != -1: if channel['name'].find('cohorte') != -1:
if 'description' in channel: if 'description' in channel:
m = re.findall(r'#([\w-]+)', channel['description']) m = re.findall(r'#([\w-]+)', channel['description'])
if m.count == 0:
print(Fore.RED + "\tmissing region information", 'red')
for region in m: for region in m:
cohortescolor.update( { region: 'green' } ) cohortescolor.update( { region: 'green' } )
cohortes.update( { region: { 'link': channel['name']}}) cohortes.update( { region: { 'link': channel['name']}})

View file

@ -1,2 +1,3 @@
rocketchat_API==0.6.32 rocketchat_API==0.6.32
MonthDelta==0.9.1 MonthDelta==0.9.1
colorama==0.4.1