Skip to content

Commit

Permalink
Merge pull request #228 from kmyk/issue/225
Browse files Browse the repository at this point in the history
  • Loading branch information
kmyk authored Jan 2, 2019
2 parents bb6e8cd + ae62713 commit 7b18af8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python Version: 3.x
name = 'online-judge-tools'
__package_name__ = 'online-judge-tools'
__author__ = 'Kimiyuki Onaka'
__email__ = '[email protected]'
__license__ = 'MIT License'
Expand Down
2 changes: 1 addition & 1 deletion onlinejudge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python Version: 3.x
from onlinejudge.implementation.version import *
from onlinejudge.__about__ import *
import onlinejudge.atcoder
import onlinejudge.yukicoder
import onlinejudge.anarchygolf
Expand Down
4 changes: 2 additions & 2 deletions onlinejudge/implementation/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Python Version: 3.x
# -*- coding: utf-8 -*-
import onlinejudge
import onlinejudge.__about__ as version
import onlinejudge.implementation.utils as utils
import onlinejudge.implementation.logging as log
import onlinejudge.implementation.version as version
from onlinejudge.implementation.command.download import download
from onlinejudge.implementation.command.login import login
from onlinejudge.implementation.command.submit import submit
Expand All @@ -25,7 +25,7 @@
def version_check() -> None:
if utils.is_update_available_on_pypi():
log.warning('update available: %s -> %s', version.__version__, utils.get_latest_version_from_pypi())
log.info('run: $ pip3 install -U %s', version.name)
log.info('run: $ pip3 install -U %s', version.__package_name__)


def get_parser() -> argparse.ArgumentParser:
Expand Down
10 changes: 5 additions & 5 deletions onlinejudge/implementation/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python Version: 3.x
# -*- coding: utf-8 -*-
import onlinejudge.implementation.logging as log
import onlinejudge.implementation.version as version
import onlinejudge.__about__ as version
from onlinejudge.problem import LabeledString, TestCase
import re
import os
Expand All @@ -24,9 +24,9 @@
from typing import *
from typing.io import *

config_dir = pathlib.Path(appdirs.user_config_dir(version.name))
data_dir = pathlib.Path(appdirs.user_data_dir(version.name))
cache_dir = pathlib.Path(appdirs.user_cache_dir(version.name))
config_dir = pathlib.Path(appdirs.user_config_dir(version.__package_name__))
data_dir = pathlib.Path(appdirs.user_data_dir(version.__package_name__))
cache_dir = pathlib.Path(appdirs.user_cache_dir(version.__package_name__))
html_parser = 'lxml'

def parcentformat(s: str, table: Dict[str, str]) -> str:
Expand Down Expand Up @@ -190,7 +190,7 @@ def request(method: str, url: str, session: requests.Session, raise_for_status:


def get_latest_version_from_pypi() -> str:
pypi_url = 'https://pypi.org/pypi/{}/json'.format(version.name)
pypi_url = 'https://pypi.org/pypi/{}/json'.format(version.__package_name__)
version_cache_path = cache_dir / "pypi.json"
update_interval = 60 * 60 * 8 # 8 hours

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ def load_module(module_path):
file, path, description = imp.find_module(name, path)
path = [ path ]
return imp.load_module(name, file, path[0], description)
version = load_module('onlinejudge.implementation.version')
version = load_module('onlinejudge.__about__')

with open('readme.md', encoding='utf-8') as fh:
readme = fh.read()

setup(
name=version.name,
name=version.__package_name__,
version=version.__version__,
description='Tools for online-judge services',
install_requires=[
Expand Down

0 comments on commit 7b18af8

Please sign in to comment.