standartize use of my_configuration in github
This commit is contained in:
parent
8a800e9b06
commit
4ca872f711
1 changed files with 7 additions and 13 deletions
|
@ -1,13 +1,3 @@
|
|||
from functools import lru_cache
|
||||
|
||||
from ... import paths
|
||||
|
||||
@lru_cache()
|
||||
def ghexport():
|
||||
from ...common import import_file
|
||||
return import_file(paths.ghexport.repo / 'model.py')
|
||||
|
||||
|
||||
from typing import Dict, List, Union, Any, NamedTuple, Tuple, Optional
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
@ -15,6 +5,11 @@ import logging
|
|||
|
||||
import pytz
|
||||
|
||||
from ..common import get_files
|
||||
|
||||
from my_configuration import paths
|
||||
import my_configuration.repos.ghexport.model as ghexport
|
||||
|
||||
|
||||
def get_logger():
|
||||
return logging.getLogger('my.github') # TODO __package__???
|
||||
|
@ -76,8 +71,8 @@ def _get_summary(e) -> Tuple[str, Optional[str]]:
|
|||
|
||||
|
||||
def get_model():
|
||||
sources = list(sorted(paths.ghexport.export_dir.glob('*.json')))
|
||||
model = ghexport().Model(sources)
|
||||
sources = get_files(paths.github.export_dir, glob='*.json')
|
||||
model = ghexport.Model(sources)
|
||||
return model
|
||||
|
||||
|
||||
|
@ -105,7 +100,6 @@ def get_events():
|
|||
|
||||
|
||||
def test():
|
||||
assert len(get_events()) > 100
|
||||
events = get_events()
|
||||
assert len(events) > 100
|
||||
for e in events:
|
Loading…
Add table
Add a link
Reference in a new issue