Skip to content

Commit

Permalink
Merge pull request #50 from Code4GovTech/dev
Browse files Browse the repository at this point in the history
library for markdown changed
  • Loading branch information
jaanbaaz authored Aug 7, 2024
2 parents 1a72e6d + e711754 commit 4339643
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def get_issues_by_owner_id(owner, issue):
if val['body_text']:
if "Weekly Goals" in val['body_text'] and not w_goal_url:
w_goal_url = val['body_text']
plain_text_body = markdown2.markdown(val['body_text'])
plain_text_body = markdown.markdown(val['body_text'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ python-dotenv==1.0.1
supabase==2.4.5
gunicorn==22.0.0
flasgger==0.9.7.1
markdown2==2.4.13
markdown==3.4.1
requests==2.32.2
flask-cors==4.0.1
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import requests,re,markdown2,os
import requests,re,markdown,os
from collections import defaultdict
from datetime import datetime, timedelta
from dateutil import parser
Expand Down Expand Up @@ -115,7 +115,7 @@ def find_week_data(issue_details):

for week in weekly_updates:

plain_text_body = markdown2.markdown(week['val']['body'])
plain_text_body = markdown.markdown(week['val']['body'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down Expand Up @@ -154,7 +154,7 @@ def find_week_avg(url):

if "Weekly Goals" in item['body']:
w_goal_url = item['body']
plain_text_body = markdown2.markdown(issue_details[0]['body'])
plain_text_body = markdown.markdown(issue_details[0]['body'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down
6 changes: 3 additions & 3 deletions v2_app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import traceback,re
from flask import Blueprint, jsonify, request
import markdown2
import markdown
from utils import require_secret_key
from db import SupabaseInterface
from utils import determine_week
Expand Down Expand Up @@ -51,15 +51,15 @@ def get_issues_by_owner_id_v2(owner, issue):
if val['body_text']:
if ("Weekly Goals" in val['body_text'] and not w_goal_url):
w_goal_url = val['body_text']
plain_text_body = markdown2.markdown(val['body_text'])
plain_text_body = markdown.markdown(val['body_text'])
tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
completed_tasks = tasks.count('x')
avg = round((completed_tasks/total_tasks)*100) if total_tasks!=0 else 0

if ("Weekly Learnings" in val['body_text'] and not w_learn_url):
w_learn_url = val['body_text']
plain_text_wurl = markdown2.markdown(val['body_text'])
plain_text_wurl = markdown.markdown(val['body_text'])


# mentors = mentors_data['mentors']
Expand Down
2 changes: 1 addition & 1 deletion v2_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging,re,markdown2
import logging,re,markdown

# Func to create name and link for all mentors and contributors
def define_link_data(usernames):
Expand Down

0 comments on commit 4339643

Please sign in to comment.