Commit b8db634d authored by Denis Salem's avatar Denis Salem
Browse files

wip on 2.0.0

parent b1dc7acb
......@@ -99,20 +99,18 @@
DONE | Clear white spaces in error messages.
DONE | Speed up blog exportation ( almost seven times faster!).
DONE | Implement RelativeLocation.
DONE | Massive refactorisation, code cleaning and optimisation.
WIP | Massive refactorisation, code cleaning and optimisation. (Fix pattern dictionary, must be more organized)
DONE | Optimisation of categories tree.
DONE | Code should be a little bit more PEP 8 compliant.
DONE | Handle currentLocale = locale.getlocale()[0].split('_')[0] AttributeError: 'NoneType'.
DONE | Clean up installation.
DONE | Add random number generator.
WIP | Change nomenclature: Most of the usual patterns are changed. Fix doc.
TODO | Add categories tree in entry.
TODO | Fix vertical scroll bar in code snippet.
TODO | Add relevant templates for themes.
TODO | Add function Include.
TODO | Add categories tree in entry.
TODO | Reorganize themes dependencies in setup (adding default templates, scripts, and pages to include).
TODO | Add relevant templates for themes.
TODO | Fix vertical scroll bar in code snippet.
TODO | Client-side search engine.
TODO | Add translation for Deutsch and Spanish.
TODO | SSH SUPPORT.
TODO | Add backup command.
TODO | Adding LaTeX support.
......@@ -124,5 +122,7 @@
TODO | fix FAQ https://stackoverflow.com/questions/14547631/python-locale-error-unsupported-locale-setting
TODO | add entry preview / full content.
TODO | Remove illegal character from path.
TODO | Fix unit test.
TODO | Open with navigator manual.
TODO | Add translation for Deutsch and Spanish.
TODO | Client-side search engine.
TODO | Fix unit test.
......@@ -42,6 +42,7 @@ from venc2.threads.main_thread import MainThread
from venc2.threads.dates_thread import DatesThread
from venc2.threads.categories_thread import CategoriesThread
from venc2.pattern.non_contextual import non_contextual_pattern_names
from venc2.pattern.contextual import contextual_pattern_names
non_contextual_pattern_names_datastore = {
# General entry data
......@@ -82,7 +83,7 @@ non_contextual_pattern_names_code_highlight = {
"GetStyleSheets" : "get_style_sheets"
}
contextual_patterns = {
contextual_patterns_location_names = {
"GetRelativeOrigin" : "get_relative_origin",
"IfInThread" : "if_in_thread",
"GetRelativeLocation" : "get_relative_location",
......@@ -132,8 +133,11 @@ def export_blog(argv=list()):
for pattern_name in non_contextual_pattern_names.keys():
processor.set_function(pattern_name, non_contextual_pattern_names[pattern_name])
# Setup contextual patterns
for pattern_name in contextual_patterns.keys():
# Blacklist contextual patterns
for pattern_name in contextual_patterns_location_names.keys():
processor.blacklist.append(pattern_name)
for pattern_name in contextual_patterns_names.keys():
processor.blacklist.append(pattern_name)
""" Ugly piece of code """
......
......@@ -26,7 +26,7 @@ def print_version(argv):
def print_help(argv=None):
print("-v\t--version")
print("-nb\t--new-blog <\""+messages.arg_blog_name.format("1")+"\"> [\""+Messages.argBlogName.format("2")+"\" ... ]")
print("-nb\t--new-blog <\""+messages.arg_blog_name.format("1")+"\"> [\""+messages.arg_blog_name.format("2")+"\" ... ]")
print("-ne\t--new-entry <\""+messages.arg_entry_name+"\"> [\""+messages.arg_template_name+"\"]")
print("-xb\t--export-blog ["+messages.theme_name+"]")
print("-ex\t--edit-and-xport <\""+messages.arg_input_filename+"\">")
......
#! /usr/bin/python3
# Copyright 2016, 2018 Denis Salem
#
# This file is part of VenC.
#
# VenC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# VenC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with VenC. If not, see <http://www.gnu.org/licenses/>.
import random
from venc2.helpers import PatternInvalidArgument
from venc2.l10n import messages
def get_random_number(in_argv):
arg_names=["min","max","decimal_number"]
argv = []
for i in range(0,3):
try:
argv.append(int(in_argv[i]))
except ValueError:
raise PatternInvalidArgument(arg_names[i],in_argv[i], messages.pattern_argument_must_be_integer)
v = argv[0] + random.random() * (argv[1] - argv[0] + 1)
return str(int(v)) if argv[2] == 0 else str(round(v, argv[2]))
contextual_pattern_names = [
"GetRandomNumber" : get_random_number
]
......@@ -18,27 +18,10 @@
# along with VenC. If not, see <http://www.gnu.org/licenses/>.
from venc2 import venc_version
from venc2.helpers import PatternInvalidArgument
from venc2.l10n import messages
import random
def get_random_number(in_argv):
arg_names=["min","max","decimal_number"]
argv = []
for i in range(0,3):
try:
argv.append(int(in_argv[i]))
except ValueError:
raise PatternInvalidArgument(arg_names[i],in_argv[i], messages.pattern_argument_must_be_integer)
v = argv[0] + random.random() * (argv[1] - argv[0] + 1)
return str(int(v)) if argv[2] == 0 else str(round(v, argv[2]))
def get_venc_version(argv):
return venc_version
non_contextual_pattern_names = {
"GetRandomNumber" : get_random_number,
"GetVenCVersion" : get_venc_version
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment