This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import os | |
from scrapy import signals | |
from scrapy.exceptions import NotConfigured | |
from scrapy.utils.project import data_path | |
def json_serial(obj): | |
"""JSON serializer for objects not serializable by default json code""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import itertools | |
import json | |
from urllib.parse import urljoin | |
import requests | |
from ics import Calendar, Event | |
from parsel import Selector | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ics import Calendar | |
from telegram.ext import Updater, CommandHandler | |
def ics_calendar(): | |
with open("lhc.ics", "r") as f: | |
calendar = Calendar(f.read()) | |
return calendar | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from spidermon import Monitor, MonitorSuite | |
from spidermon.core.suites import MonitorSuite | |
from spidermon.runners import TextMonitorRunner | |
from spidermon.core.actions import Action | |
class StandaloneMonitor(Monitor): | |
def test_number_of_errors(self): | |
num_errors = self.data["num_errors"] | |
self.assertLessEqual(num_errors, 10, msg="Many errors!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from collections import namedtuple | |
from spidermon import Monitor, MonitorSuite, monitors | |
def check_coverage(expected, current, parent_field=None): | |
CoverageResult = namedtuple("CoverageResult", ("status", "failures")) | |
failures = [] | |
for field, value in expected.items(): |
OlderNewer