Skip to content

Commit

Permalink
moved source code into own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wolff committed Aug 20, 2024
1 parent 82936b7 commit c60d271
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ affiliated with SIFF)
API: https://developers.google.com/calendar/api/quickstart/python
2. Update the workspace + constants
* Once you have your API credentials, create a file in the workspace root called `credentials.json`
* You'll then need to update the [`constants.py`](./constants.py) so that the `GoogleCalendar` enum points at your
* You'll then need to update the [`constants.py`](src/constants.py) so that the `GoogleCalendar` enum points at your
calendar(s)
3. Install dependencies
```bash
Expand Down
6 changes: 3 additions & 3 deletions runner
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import os
from concurrent.futures import ThreadPoolExecutor

from constants import SIFFTheatre, GoogleCalendar
from siff_calendar_updater import update_calendar
from util import get_logger
from src.constants import SIFFTheatre, GoogleCalendar
from src.siff_calendar_updater import update_calendar
from src.util import get_logger


def update_single_calendar(calendar_id: GoogleCalendar, theatre: SIFFTheatre):
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions siff_calendar_updater.py → src/siff_calendar_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build

from constants import SIFFTheatre, GoogleCalendar
from model import MovieShowing, ShowTime, HashableMovieEvent
from siff_scraper import scrape_showings
from util import get_logger, get_calendar_name
from src.constants import SIFFTheatre, GoogleCalendar
from src.model import MovieShowing, ShowTime, HashableMovieEvent
from src.siff_scraper import scrape_showings
from src.util import get_logger, get_calendar_name

CREDENTIALS_FILE = 'credentials.json'
TOKEN_FILE = 'token.json'
Expand Down
6 changes: 3 additions & 3 deletions siff_scraper.py → src/siff_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import requests

from constants import SIFFTheatre
from model import MovieShowing
from util import *
from src.constants import SIFFTheatre
from src.model import MovieShowing
from src.util import *

SIFF_ROOT = "https://siff.net"

Expand Down
6 changes: 3 additions & 3 deletions util.py → src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

from bs4 import BeautifulSoup

from constants import GoogleCalendar, PACIFIC_TIMEZONE, MILLISEC_PER_SEC
from model import ShowTime
from src.constants import GoogleCalendar, PACIFIC_TIMEZONE, MILLISEC_PER_SEC
from src.model import ShowTime


def get_logger(filename, level=logging.INFO):
logger = logging.getLogger(filename)
logging.basicConfig(encoding='utf-8',
filename="update_calendar.log",
filename="../update_calendar.log",
level=level,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger.addHandler(logging.StreamHandler())
Expand Down
8 changes: 4 additions & 4 deletions test/test_siff_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import unittest
from datetime import datetime

from constants import PACIFIC_TIMEZONE
from model import ShowTime
from siff_scraper import _get_metadata, _extract_showings, _extract_locations
from util import read_html_files, assert_equal_showtime
from src.constants import PACIFIC_TIMEZONE
from src.model import ShowTime
from src.siff_scraper import _get_metadata, _extract_showings, _extract_locations
from src.util import read_html_files, assert_equal_showtime


class TestSIFFScraper(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from util import *
from src.util import *


class TestUtilMethods(unittest.TestCase):
Expand Down

0 comments on commit c60d271

Please sign in to comment.