Compare commits
No commits in common. "master" and "0.1" have entirely different histories.
|
@ -11,17 +11,15 @@ jobs:
|
|||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10', '3.11']
|
||||
python-version: [3.7, 3.8, 3.9]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
appdirs==1.4.4
|
||||
requests==2.31.0
|
||||
ruamel.yaml==0.18.5
|
||||
ruamel.yaml.clib==0.2.8
|
||||
requests==2.25.1
|
||||
ruamel.yaml==0.17.4
|
||||
ruamel.yaml.clib==0.2.2
|
||||
urllib3==1.26.4
|
||||
|
|
|
@ -3,26 +3,27 @@ import sys
|
|||
|
||||
from ruamel.yaml import YAML, scalarstring
|
||||
|
||||
from blimp.misc import local_file_present
|
||||
from .misc import local_file_present
|
||||
|
||||
|
||||
class ProcessBlocklist:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
||||
@classmethod
|
||||
def process(self, blacklist, outfile, dryrun: bool):
|
||||
"""
|
||||
function to build and compare the local yaml file to the remote file
|
||||
if the remote file is different, the local file gets overwritten
|
||||
"""
|
||||
# cheeky none catch
|
||||
try:
|
||||
# load local blacklist outfile
|
||||
if local_file_present(outfile):
|
||||
with open(outfile, "r", encoding="utf-8") as local_file:
|
||||
local_blacklist = local_file.read()
|
||||
|
||||
except (TypeError, FileNotFoundError):
|
||||
except TypeError:
|
||||
# no local copy use empty one instead
|
||||
local_blacklist = YAML(typ="safe")
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import argparse
|
||||
|
||||
from blimp.main import Blimp
|
||||
from .main import Blimp
|
||||
|
||||
|
||||
def cli():
|
||||
|
|
|
@ -6,8 +6,8 @@ from pathlib import Path
|
|||
import requests
|
||||
from appdirs import user_cache_dir
|
||||
|
||||
from blimp.bl_process import ProcessBlocklist
|
||||
from blimp.misc import local_file_present
|
||||
from .bl_process import ProcessBlocklist
|
||||
from .misc import local_file_present
|
||||
|
||||
|
||||
class Blimp:
|
||||
|
@ -91,5 +91,5 @@ class Blimp:
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from blimp.cli import cli
|
||||
from .cli import cli
|
||||
cli()
|
||||
|
|
Loading…
Reference in New Issue