-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨enabled plugins dir via command line * 📚 update exit code * 🔬 test -pd on command line * 📚 update readme * 🐛 fix unit test which failed to detect the missing feature * 🔨 code refactor copy engine and strip content processor * 📚 here is the way to write modelines remover. #36 * 🔨 code refactoring
- Loading branch information
Showing
31 changed files
with
303 additions
and
130 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
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 |
---|---|---|
|
@@ -4,8 +4,8 @@ organisation: moremoban | |
author: C. W. | ||
contact: [email protected] | ||
license: MIT | ||
version: 0.7.6 | ||
current_version: 0.7.6 | ||
version: 0.7.7 | ||
current_version: 0.7.7 | ||
release: 0.7.6 | ||
branch: master | ||
master: index | ||
|
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = "0.7.6" | ||
__version__ = "0.7.7" | ||
__author__ = "C. W." |
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
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,51 @@ | ||
import logging | ||
|
||
from lml.plugin import PluginInfo | ||
|
||
from moban import constants | ||
|
||
LOG = logging.getLogger(__name__) | ||
|
||
|
||
class ContentProcessor(PluginInfo): | ||
""" | ||
@ContentProcessor('strip', 'Stripping', 'Stripped'): | ||
def strip(template_file: str) -> str: | ||
ret = template_file.strip() | ||
return ret | ||
""" | ||
|
||
def __init__(self, action, action_continuing_tense, action_past_tense): | ||
super(ContentProcessor, self).__init__( | ||
constants.TEMPLATE_ENGINE_EXTENSION, tags=[action] | ||
) | ||
self.action = action | ||
self.action_continuing_tense = action_continuing_tense | ||
self.action_past_tense = action_continuing_tense | ||
|
||
def __call__(self, a_content_processor_function): | ||
continuing_tense = self.action_continuing_tense | ||
past_tense = self.action_past_tense | ||
|
||
class CustomEngine(object): | ||
ACTION_IN_PRESENT_CONTINUOUS_TENSE = continuing_tense | ||
ACTION_IN_PAST_TENSE = past_tense | ||
|
||
def __init__(self, template_fs, extensions=None): | ||
self.template_fs = template_fs | ||
|
||
def get_template(self, template_file): | ||
content = self.template_fs.readbytes(template_file) | ||
ret = a_content_processor_function(content) | ||
return ret | ||
|
||
def get_template_from_string(self, a_string): | ||
ret = a_content_processor_function(a_string) | ||
return ret | ||
|
||
def apply_template(self, template, *_): | ||
ret = a_content_processor_function(template) | ||
return ret | ||
|
||
super(ContentProcessor, self).__call__(CustomEngine) | ||
return a_content_processor_function |
Oops, something went wrong.