Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use namespaced modules #37

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ venv
*silpa.min.*
/.testrepository/
/cover/

env/
src/
.eggs/
32 changes: 17 additions & 15 deletions etc/silpa.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,21 @@ log_name = silpa.log
# These section provides list of modules use
# 'yes' to enable them and 'no' to disable
spellchecker = no
inexactsearch = no
inexactsearch = yes
soundex = yes
transliteration = no
hyphenation = no
chardetails = no
payyans = no
indicsyllabifier = no
indicfortune = no
ucasort = no
indicngram = no
shingling = no
hyphenation = yes
guesslanguage = yes
chardetails = yes
payyans = yes
syllabifier = yes
fortune = yes
ucasort = yes
ngram = yes
shingling = yes
textsimilarity = no
indicstemmer = no
katapayadi = no
stemmer = yes
katapayadi = yes
#scriptrender = yes

[module_display]
Expand All @@ -49,12 +50,13 @@ transliteration = Transliteration
hyphenation = Hyphenate
chardetails = Chardetails
payyans = Payyans
indicsyllabifier = Syllabalizer
indicfortune = Fortune
syllabifier = Syllabifier
fortune = Fortune
ucasort = UCA Sort
indicngram = N-gram
ngram = N-gram
shingling = Shingling
textsimilarity = Similar Texts
indicstemmer = Stemmer
stemmer = Stemmer
katapayadi = Katapayadi Numbers
scriptrender = Script Render
guesslanguage = Guess Language
38 changes: 19 additions & 19 deletions requirements-modules.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
-e git+https://github.com/Project-SILPA/Transliteration.git#egg=transliteration
-e git+https://github.com/Project-SILPA/text-similarity.git#egg=textsimilarity
-e git+https://github.com/Project-SILPA/ucasort.git#egg=ucasort
-e git+https://github.com/Project-SILPA/spellchecker.git#egg=spellchecker
-e git+https://github.com/Project-SILPA/Soundex.git@development#egg=soundex
-e git+https://github.com/Project-SILPA/silpa-common.git#egg=silpa_common
-e git+https://github.com/Project-SILPA/shingling.git#egg=shingling
#-e git+https://github.com/Project-SILPA/scriptrender.git#egg=scriptrender
-e git+https://github.com/Project-SILPA/payyans.git#egg=payyans
-e git+https://github.com/Project-SILPA/normalizer.git#egg=normalizer
-e git+https://github.com/Project-SILPA/inexactsearch.git#egg=inexactsearch
-e git+https://github.com/Project-SILPA/syllabalizer.git#egg=indicsyllabifier
-e git+https://github.com/Project-SILPA/indicngram.git#egg=indicngram
-e git+https://github.com/Project-SILPA/indicfortune.git#egg=indicfortune
-e git+https://github.com/Project-SILPA/Hyphenation.git#egg=hyphenation
-e git+https://github.com/Project-SILPA/guesslanguage.git#egg=guesslanguage
-e git+https://github.com/Project-SILPA/chardetails.git#egg=chardetails
-e git+https://github.com/Project-SILPA/katapayadi.git#egg=katapayadi
-e git+https://github.com/Project-SILPA/indicstemmer.git#egg=indicstemmer
#-e git+https://github.com/libindic/Transliteration.git#egg=transliteration
#-e git+https://github.com/libindic/scriptrender.git#egg=scriptrender
#-e git+https://github.com/libindic/silpa-common.git#egg=silpa_common
#-e git+https://github.com/libindic/spellchecker.git#egg=spellchecker
#-e git+https://github.com/libindic/text-similarity.git#egg=textsimilarity
-e git+https://github.com/libindic/Hyphenation.git@development#egg=libindic_hyphenation
-e git+https://github.com/libindic/Soundex.git@namespaced-development#egg=libindic_soundex
-e git+https://github.com/libindic/chardetails.git@development#egg=libindic_chardetails
-e git+https://github.com/libindic/guesslanguage.git@development#egg=libindic_guesslanguage
-e git+https://github.com/libindic/indicfortune.git@development#egg=libindic_fortune
-e git+https://github.com/libindic/indicngram.git@development#egg=libindic_ngram
-e git+https://github.com/libindic/indicstemmer.git@development#egg=libindic_stemmer
-e git+https://github.com/libindic/inexactsearch.git@development#egg=libindic_inexactsearch
-e git+https://github.com/libindic/katapayadi.git@development#egg=libindic_katapayadi
-e git+https://github.com/libindic/normalizer.git#egg=libindic_normalizer
-e git+https://github.com/libindic/payyans.git@development#egg=libindic_payyans
-e git+https://github.com/libindic/shingling.git@development#egg=libindic_shingling
-e git+https://github.com/libindic/syllabalizer.git@development#egg=libindic-syllabifier
-e git+https://github.com/libindic/ucasort.git@development#egg=libindic_ucasort
1 change: 1 addition & 0 deletions silpa/api/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, data):
def __call__(self):
# process request here
module, method = self.request.method.split('.')
module = "libindic." + module
if module not in sys.modules:
# Module is not yet loaded or the request module is not
# enabled pass an error here.
Expand Down
1 change: 1 addition & 0 deletions silpa/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ def load_module_templates(app):
modules = ModuleConfigHelper.get_modules()
templates = [app.jinja_loader]
for module in modules:
module = "libindic." + module
templates.append(PackageLoader(module))
app.jinja_loader = ChoiceLoader(templates)
1 change: 1 addition & 0 deletions silpa/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def get_baseurl(cls):
@classmethod
def load_modules(cls):
for module in cls.module_names:
module = "libindic." + module
try:
importlib.import_module(module)
except ImportError as e:
Expand Down