Skip to content

Commit

Permalink
Minor fixes made
Browse files Browse the repository at this point in the history
  • Loading branch information
PhongT16 committed Dec 7, 2022
1 parent 0ff4d1c commit 3d809b4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
4 changes: 0 additions & 4 deletions AuthenticateDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def connect(self):
#####################################################

g2 = Grab()
#self.debug_print_response(g)

scope = self.find_value_to_key(g, 'scope')
response_mode = self.find_value_to_key(g, 'response_mode')
Expand Down Expand Up @@ -252,12 +251,9 @@ def connect(self):


#####################################################

g2.submit()

#####################################################
g2.submit()

#####################################################
g2.submit()
# the response has _xsrf token
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM python:3
ENV TZ=America/Chicago
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY . /outlook-calendar-report-generator
WORKDIR /outlook-calendar-report-generator
RUN python -m pip install -r /outlook-calendar-report-generator/requirements.txt
COPY . /outlook_calendar_report_generator
WORKDIR /outlook_calendar_report_generator
RUN python -m pip install -r /outlook_calendar_report_generator/requirements.txt

RUN ln -s /home/.netrc /root/.netrc
RUN ln -s /home/microsoft_graph_auth.yaml /root/microsoft_graph_auth.yaml
Expand Down
10 changes: 1 addition & 9 deletions GenerateReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ def __init__(self, event, user) -> None:
self.start_date = self.date_parser(event['start']['dateTime'])
self.end_date = self.date_parser(event['end']['dateTime'])

# print("net_id type: " + str(type(self.net_id)))
# print("status type: " + str(type(self.status)))
# print("subject type: " + str(type(self.subject)))
# print("-------------------------")

def date_parser(self, date):
"""
Parses the date into a tuple of date (str) and time (str) and return the tuple
Expand Down Expand Up @@ -140,7 +135,6 @@ def __init__(self,calendar, group_members, mode, start_date, end_date) -> None:
The end date of the timeframe (YYYY-MM-DD)
"""

#print(calendar)
self.calendar = calendar
self.group_members = group_members
events = self.filter_dates(self.calendar)
Expand Down Expand Up @@ -219,7 +213,6 @@ def dump_calendar_to_json(self, filtered_calendar):
events = []
calendar_dict[key] = events
for item in value:
#print("here")
calendar_dict[key].append(item.get_event())

calendar_as_json = json.dumps(calendar_dict)
Expand Down Expand Up @@ -281,7 +274,7 @@ def print_table(self, filtered_calendar, start_date, end_date):
date = datetime(int(key[:4]), int(key[4:6]), int(key[6:]), 0, 0, 0)
day = date.strftime('%A')
header = [day + " " + key[4:6] + "-" + key[6:] + "-" + key[:4], ""]
#print(header)

if (first_row == False):
fake_header = [day + " " + key[4:6] + "-" + key[6:] + "-" + key[:4], ""]
first_row = True
Expand All @@ -290,7 +283,6 @@ def print_table(self, filtered_calendar, start_date, end_date):
table.append(SEPARATING_LINE)
for event in value:
if event.start_date[1] == "00:00" and event.end_date[1] == "00:00":
#print("LINE 168: TIME: " + str(event.start_date[1]) + event.subject)
row = [event.net_id, "All Day"]
else:
duration = self.calculate_mutliday_event_duration(str(event.start_date[1]), str(event.end_date[1]))
Expand Down
2 changes: 0 additions & 2 deletions OutlookCalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ def process_args():

# Retrieves each group member's default calendar
calendar = my_calendar.get_group_members_calendars(my_calendar.user_client, start_date, end_date)
#print(calendar)
#print("--------------------------------------")

if (args.report == True):
print("Generating Report")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ docker pull phongtran27/outlook_calendar_report_generator

# Build Container
```
docker run -it --name outlook-calendar-container --mount type=bind,source=$HOME,dst=/home outlook-calendar-report-generator
docker run -it --name outlook_calendar_container --mount type=bind,source=$HOME,dst=/home outlook_calendar_report_generator
```


Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
exchangelib
#exchangelib
grab == 0.6.40
tzlocal
PyYAML
git+https://github.com/andylytical/pyexch

#git+https://github.com/andylytical/pyexch

azure-core==1.23.1
azure-identity==1.10.0
Expand Down

0 comments on commit 3d809b4

Please sign in to comment.