-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from jimustafa/update-checks
update checks
- Loading branch information
Showing
6 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
|
||
import pdfx | ||
|
||
|
||
pdf = pdfx.PDFx(sys.argv[1]) | ||
|
||
refs = [ref for ref in pdf.get_references() if ref.reftype == 'url'] | ||
|
||
status_codes = list(map(lambda ref: pdfx.downloader.get_status_code(ref.ref), refs)) | ||
|
||
broken_links = [refs[idx].ref for idx in range(len(refs)) if status_codes[idx] != 200] | ||
|
||
# it seems that Twitter does not respond well to the link checker and throws a 400 | ||
if all(['twitter.com' in url for url in broken_links]): | ||
sys.exit(0) | ||
else: | ||
print('Broken links:', broken_links) | ||
sys.exit(1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# | ||
# Check that a given pdf has a certain number of pages. | ||
# Usage: | ||
# check-num-pages.sh [pdffile] [num_pages] | ||
|
||
set -x | ||
pdffile=$1 | ||
num_pages=$2 | ||
[[ "$(pdfinfo $pdffile | grep Pages | awk '{print $2}')" == "$num_pages" ]] || exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
bump2version | ||
cartopy==0.19.0.post1 | ||
matplotlib==3.4.2 | ||
pdfx | ||
pip-tools | ||
pre-commit | ||
scipy | ||
|
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