-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init refactoring with basic python structure stuff.
- Loading branch information
Showing
10 changed files
with
394 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .about import (__name__, __version__, __author__, __author_email__, | ||
__description__, __license__, __url__) | ||
|
||
__all__ = [__name__, __version__, __author__, __author_email__, | ||
__description__, __license__, __url__] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
__name__ = "bwds" | ||
__version__ = "0.0.1" | ||
__author__ = "Amir Sarabadani" | ||
__author_email__ = "[email protected]" | ||
__description__ = "A library for performing automatic detection of the " + \ | ||
"badwords added to Wikipedia articles" | ||
__url__ = "https://github.com/wiki-ai/bwds" | ||
__license__ = "MIT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
""" | ||
This script provides access to a set of utilities for extracting features and | ||
building edit quality predictors. | ||
* process_api -- Processes a sample of revisions using the API | ||
* process_dump -- Processes an XML dump | ||
Usage: | ||
bwds (-h | --help) | ||
bwds <utility> [-h | --help] | ||
Options: | ||
-h | --help Prints this documentation | ||
<utility> The name of the utility to run | ||
""" | ||
import sys | ||
import traceback | ||
from importlib import import_module | ||
|
||
|
||
USAGE = """Usage: | ||
bwds (-h | --help) | ||
bwds <utility> [-h | --help]\n""" | ||
|
||
|
||
def main(): | ||
|
||
if len(sys.argv) < 2: | ||
sys.stderr.write(USAGE) | ||
sys.exit(1) | ||
elif sys.argv[1] in ("-h", "--help"): | ||
sys.stderr.write(__doc__ + "\n") | ||
sys.exit(1) | ||
elif sys.argv[1][:1] == "-": | ||
sys.stderr.write(USAGE) | ||
sys.exit(1) | ||
|
||
module_name = sys.argv[1] | ||
try: | ||
module = import_module(".utilities." + module_name, | ||
package="bwds") | ||
except ImportError: | ||
sys.stderr.write(traceback.format_exc()) | ||
sys.stderr.write("Could not load utility {0}.\n".format(module_name)) | ||
sys.exit(1) | ||
|
||
module.main(sys.argv[2:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.