Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
style(core): remove ASCII banners, empty docstrings and the 0 code exit
Browse files Browse the repository at this point in the history
  • Loading branch information
upsetbit committed Aug 15, 2018
1 parent a2710d0 commit c1a2d72
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/dora.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,27 @@


# Standard libraries. Should not fail.
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter
import sys
import textwrap
from argparse import ArgumentParser
from argparse import RawTextHelpFormatter

# Required 3rd-parth libraries.
try:
import dns.resolver
from flask import Flask
from flask import make_response
from flask import render_template

from flask_restful import Api
from flask_restful import Resource

import dns.resolver

except ImportError as e:
print('DORA: impossible to import 3rd-party libraries.\n'
'Latest traceback: {0}' . format(e.args[0]))

sys.exit(1)


# ____ _ ___
# / ___| | | |_ _|
# | | | | | |
# | |___ _| |___ _ | | _
# \____(_)_____(_)___(_)
class CLI:
"""Command-line interface handling class.
Expand Down Expand Up @@ -130,7 +123,6 @@ def __init__(self):
help='enable debug mode')

def act(self):
"""."""
argp = self.parser.parse_args()

if argp.copyright:
Expand All @@ -149,11 +141,9 @@ def act(self):
sys.exit(1)

def show_copyright(self):
"""."""
print(__copyright__)

def _start(self, f_port, debug_mode):
"""."""
dora.run(debug=debug_mode,
host='0.0.0.0',
use_reloader=True,
Expand Down Expand Up @@ -221,11 +211,6 @@ def unknown_record_type(self):
)


# ____ _
# | _ \ ___ ___ ___ | |_ _____ _ __
# | |_) / _ \/ __|/ _ \| \ \ / / _ \ '__|
# | _ < __/\__ \ (_) | |\ V / __/ |
# |_| \_\___||___/\___/|_| \_/ \___|_|
class Resolver:
def __init__(self, domain, record):
self.domain = domain
Expand Down Expand Up @@ -303,11 +288,6 @@ def dig_txt(self):
return records


# _ _
# __| | ___ _ __ __ _ _ __ ___ __ _(_)_ __
# / _` |/ _ \| '__/ _` | | '_ ` _ \ / _` | | '_ \
# | (_| | (_) | | | (_| |_| | | | | | (_| | | | | |
# \__,_|\___/|_| \__,_(_)_| |_| |_|\__,_|_|_| |_|
class DoraSplashPageHandler(Resource):
def get(self):
return make_response(render_template('splash.html'))
Expand All @@ -330,5 +310,3 @@ def get(self, domain, record):
if __name__ == '__main__':
_cli = CLI()
_cli.act()

sys.exit(0)

0 comments on commit c1a2d72

Please sign in to comment.