Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit cfd4681

Browse files
committed
basic setup
1 parent a6973f8 commit cfd4681

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

MANIFEST.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
include LICENSE.txt
2-
include README.rst
3-
recursive-include config *
2+
include README.md
3+
recursive-exclude * __pycache__
4+
recursive-exclude * *.pyc
5+
recursive-include termicoder/data *.yml
6+
recursive-include termicoder/ *.js
47
recursive-include termicoder/utils/scripts *
58
recursive-include termicoder/utils/templates *
69
include termicoder/utils/*.json
710
include termicoder/judges/codechef/*.json
811
global-exclude *.dump
12+
global-exclude __pycache__
913
prune termicoder/judges/spoj
1014
prune .ropeproject
1115
graft documentation

setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ def readme():
1111

1212
setup(
1313
name='termicoder',
14-
version='0.2.2',
14+
version='0.3.0',
1515
url='https://github.com/termicoder/termicoder',
1616
author='Divesh Uttamchandani',
1717
author_email='diveshuttamchandani@gmail.com',
1818
license='MIT',
1919
description='CLI to view, code & submit problems directly from terminal',
2020
long_description=readme(),
2121
long_description_content_type='text/markdown',
22-
keywords='competitive iarcs codechef oj',
22+
keywords='competitive codechef oj',
2323
classifiers=[
2424
'Development Status :: 3 - Alpha',
2525

@@ -28,7 +28,6 @@ def readme():
2828

2929
'License :: OSI Approved :: MIT License',
3030

31-
'Programming Language :: Python :: 3',
3231
'Programming Language :: Python :: 3.4',
3332
'Programming Language :: Python :: 3.5',
3433
'Programming Language :: Python :: 3.6',
@@ -57,5 +56,10 @@ def readme():
5756
termicoder=termicoder.cli:main
5857
[termicoder.judge_plugins]
5958
codechef=termicoder.judges:Codechef
60-
'''
59+
''',
60+
project_urls={
61+
'Bug Reports': 'https://github.com/termicoder/termicoder/issues',
62+
'Say Thanks!': 'https://saythanks.io/to/diveshuttam',
63+
'Source': 'https://github.com/termicoder/termicoder/',
64+
}
6165
)

termicoder/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# and use single exception
2222
@click.group(context_settings=CONTEXT_SETTINGS)
2323
@click.version_option()
24-
@click_log.simple_verbosity_option(logger, envvar='TERMICODER_VERBOSITY')
24+
@click_log.simple_verbosity_option(logger, envvar='TERMICODER_VERBOSE', default='info')
2525
@handle_exceptions(BaseException)
2626
def main():
2727
'''

termicoder/cli/config/man.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import click
2+
from ...utils.exceptions import handle_exceptions
23

34

45
@click.command()
6+
@handle_exceptions(BaseException)
57
def main():
68
"""
79
Setup man pages.
810
"""
9-
raise NotImplementedError
11+
raise NotImplementedError("Not implemented in this version")

termicoder/cli/ls/contest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66

77
judge_factory = JudgeFactory()
88
OJs = judge_factory.available_judges
9+
if default_judge is None:
10+
try:
11+
default_judge = OJs[0]
12+
except IndexError:
13+
pass
914

1015

1116
@click.command(short_help="List a particular contest.")
1217
@click.option('-j', '--judge', type=click.Choice(OJs),
13-
prompt="Please provide a judge("+'|'.join(OJs)+")",
18+
# prompt="Please provide a judge("+'|'.join(OJs)+")",
1419
default=default_judge)
1520
@handle_exceptions(BaseException)
1621
def main(judge):

termicoder/cli/setup/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
from ...utils.setup import output_problem, output_contest
44
from ...utils.constants import default_judge
55
from ...utils.exceptions import handle_exceptions
6+
from ...utils.logging import logger
67

78
judge_factory = JudgeFactory()
89
OJs = judge_factory.available_judges
910

11+
if default_judge is None:
12+
default_judge = OJs[0]
1013

1114
@click.command()
1215
@click.option('-j', '--judge', 'judge_name', type=click.Choice(OJs),
@@ -51,6 +54,9 @@ def main(judge_name, contest, problem, status):
5154
contest = judge.get_contest(contest_code=contest)
5255
contest_directory = "."
5356
output_contest(contest, contest_directory)
57+
elif(not contest and not problem and not status):
58+
logger.warn('No arguments passed : assumed login')
59+
judge.login()
5460

5561

5662
__all__ = ['main']

0 commit comments

Comments
 (0)