Skip to content

Commit

Permalink
Better MVC plugin naming
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 17, 2019
1 parent 4b6c119 commit 10ff5f9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions mvc/src/mvc_utils/__init__.py
Expand Up @@ -41,9 +41,9 @@
from . import system
from . import utils

from .exceptions import MvcUtilsExceptionException, InvalidValidationMethod, InvalidAttributeName,\
from .exceptions import MVCUtilsExceptionException, InvalidValidationMethod, InvalidAttributeName,\
InsufficientHttpInformation, NotFoundError, ValidationError, ModelValidationError,\
ControllerValidationError, ControllerValidationReasonFailed, ValidationMethodError,\
ModelApplyException
from .system import MvcUtils
from .system import MVCUtils
from .utils import validated, transaction, eager, serialized, Controller
32 changes: 16 additions & 16 deletions mvc/src/mvc_utils/controller.py
Expand Up @@ -836,7 +836,7 @@ def url_for(self, request, reference, filename = None, *args, **kwargs):
"""
Resolves the relative url to a request resource (either static or dynamic)
the details of the resolution process should be described in the lower layer
of the mvc system.
of the MVC system.
The provided values should include the reference to that is meant to be
retrieved (static or the resource path) and the various dynamic arguments
Expand All @@ -854,7 +854,7 @@ def url_for(self, request, reference, filename = None, *args, **kwargs):
this value should be called using a non named strategy.
:rtype: String
:return: The relative url path value to the resource taking into account the
base path or the mvc path defined for the current request.
base path or the MVC path defined for the current request.
"""

# retrieves the base path for the current request
Expand Down Expand Up @@ -1144,7 +1144,7 @@ def new_connection(self, parameters, connection_name = "default", channels = ())
"""
Creates a new connection for the communication sub-system, the
new connection is initially registered for the provided channels.
The mvc communication system is used for the creation/registration
The MVC communication system is used for the creation/registration
process of the new connection.
:type parameters: Dictionary
Expand Down Expand Up @@ -1179,7 +1179,7 @@ def delete_connection(self, parameters, connection):
"""
Deletes the provided connection from the communication sub-system,
the connection should no longer handle messages.
The mvc communication system is used for the deletion/unregistration
The MVC communication system is used for the deletion/unregistration
process of the connection.
:type parameters: Dictionary
Expand All @@ -1203,7 +1203,7 @@ def send(self, parameters, connection_name = "default", message = "", channels =
"""
Sends a message to the clients registered for the provided channels
in the the connection with the given name.
The mvc communication system is used for the unicast sending.
The MVC communication system is used for the unicast sending.
:type parameters: Dictionary
:param parameters: A dictionary of parameters.
Expand Down Expand Up @@ -1234,7 +1234,7 @@ def send_broadcast(self, parameters, connection_name = "default", message = ""):
"""
Sends a broadcast message to all the clients in the connection
with the given name.
The mvc communication system is used for the broadcast sending.
The MVC communication system is used for the broadcast sending.
:type parameters: Dictionary
:param parameters: A dictionary of parameters.
Expand Down Expand Up @@ -1676,16 +1676,16 @@ def validate_acl_session(

def get_mvc_path(self, request, delta_value = 1):
"""
Retrieves the mvc path according to
Retrieves the MVC path according to
the current request path.
:type request: Request
:param request: The request to be used to retrieve
the mvc path.
the MVC path.
:type delta_value: int
:param delta_value: The integer value that represents
the number of partial paths to be removed from the
original path to get the mvc path.
original path to get the MVC path.
:rtype: String
:return: The base path.
"""
Expand Down Expand Up @@ -2325,7 +2325,7 @@ def redirect_mvc_path(
Redirects the current request to the given
target (page).
This method updates the target to conform with the
current mvc path.
current MVC path.
:type request: Request
:param request: The request to be used.
Expand All @@ -2345,8 +2345,8 @@ def redirect_mvc_path(
redirect url.
"""

# retrieves the mvc path and uses it to crate
# the target mvc path using the provided target
# retrieves the MVC path and uses it to crate
# the target MVC path using the provided target
# then redirects the agent to it
mvc_path = self.get_mvc_path(request)
target_mvc_path = mvc_path + target
Expand Down Expand Up @@ -2987,7 +2987,7 @@ def apply_base_path_template_file(self, request, template_file):
:param template_file: The template to be "applied" with the base path.
"""

# retrieves both the mvc and the base path and uses these
# retrieves both the MVC and the base path and uses these
# values to assign them to the provided template file as
# expected by the call to this method
mvc_path = self.get_mvc_path(request)
Expand Down Expand Up @@ -3598,7 +3598,7 @@ def get_attribute_decoded(self, request, attribute_name, encoding = "utf-8"):
"""

# retrieves the attribute value from the attribute name
# using the mvc (sub) system
# using the MVC (sub) system
attribute_value = self._get_attribute(request, attribute_name)

# in case the attribute value is not valid returns an empty
Expand Down Expand Up @@ -4142,7 +4142,7 @@ def get_global_path(self):
"""
Retrieves the global path, that should contain
information and data relative to the global
configuration and variables in mvc.
configuration and variables in MVC.
:rtype: String
:return: The global path.
Expand Down Expand Up @@ -5497,7 +5497,7 @@ def _get_bundle(self, locale, bundle_name = "global"):
bundle_file = bundle_name + "." + locale + ".json"

# builds the base locales path from which to try to load the
# underlying base resources (from mvc) then uses it to construct
# underlying base resources (from MVC) then uses it to construct
# the inner loading path value for base resources, this is going
# to be used in case a project wide value is not "loadable"
locales_path = os.path.join(self.global_path, "locales")
Expand Down
32 changes: 16 additions & 16 deletions mvc/src/mvc_utils/exceptions.py
Expand Up @@ -39,15 +39,15 @@

import colony

class MvcUtilsExceptionException(colony.ColonyException):
class MVCUtilsExceptionException(colony.ColonyException):
"""
The mvc utils exception class.
The MVC utils exception class.
"""

message = None
""" The exception's message """

class InvalidValidationMethod(MvcUtilsExceptionException):
class InvalidValidationMethod(MVCUtilsExceptionException):
"""
The invalid validation method class.
"""
Expand All @@ -60,7 +60,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message

def __str__(self):
Expand All @@ -73,7 +73,7 @@ def __str__(self):

return "Invalid validation method - %s" % self.message

class InvalidAttributeName(MvcUtilsExceptionException):
class InvalidAttributeName(MVCUtilsExceptionException):
"""
The invalid attribute name class.
"""
Expand All @@ -86,7 +86,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message

def __str__(self):
Expand All @@ -99,7 +99,7 @@ def __str__(self):

return "Invalid attribute name - %s" % self.message

class InsufficientHttpInformation(MvcUtilsExceptionException):
class InsufficientHttpInformation(MVCUtilsExceptionException):
"""
The insufficient http information error class.
"""
Expand All @@ -112,7 +112,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message

def __str__(self):
Expand All @@ -125,7 +125,7 @@ def __str__(self):

return "Insufficient http information - %s" % self.message

class NotFoundError(MvcUtilsExceptionException):
class NotFoundError(MVCUtilsExceptionException):
"""
The not found error class.
"""
Expand All @@ -142,7 +142,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self, message)
MVCUtilsExceptionException.__init__(self, message)
self.message = message

def __str__(self):
Expand All @@ -155,7 +155,7 @@ def __str__(self):

return "Not found error - %s" % self.message

class ValidationError(MvcUtilsExceptionException):
class ValidationError(MVCUtilsExceptionException):
"""
The validation error class.
"""
Expand All @@ -174,7 +174,7 @@ def __init__(self, message, variable = None):
associated with the validation error.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message
self.variable = variable

Expand Down Expand Up @@ -335,7 +335,7 @@ def __str__(self):

return "Controller validation reason error - %s" % self.message

class ValidationMethodError(MvcUtilsExceptionException):
class ValidationMethodError(MVCUtilsExceptionException):
"""
The validation method error class.
"""
Expand All @@ -348,7 +348,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message

def __str__(self):
Expand All @@ -361,7 +361,7 @@ def __str__(self):

return "Validation method error - %s" % self.message

class ModelApplyException(MvcUtilsExceptionException):
class ModelApplyException(MVCUtilsExceptionException):
"""
The model apply exception class.
"""
Expand All @@ -374,7 +374,7 @@ def __init__(self, message):
:param message: The message to be printed.
"""

MvcUtilsExceptionException.__init__(self)
MVCUtilsExceptionException.__init__(self)
self.message = message

def __str__(self):
Expand Down
10 changes: 5 additions & 5 deletions mvc/src/mvc_utils/system.py
Expand Up @@ -105,9 +105,9 @@
)
""" The list of symbols to be used for pattern generation """

class MvcUtils(colony.System):
class MVCUtils(colony.System):
"""
The mvc utils class.
The MVC utils class.
"""

models_modules_map = {}
Expand Down Expand Up @@ -192,8 +192,8 @@ def import_module_mvc_utils(
# for latter reference
globals_map[symbol_name] = symbol

# sets the mvc utils in the globals map, this is useful
# allow later reference of the mvc utils in the created
# sets the MVC utils in the globals map, this is useful
# allow later reference of the MVC utils in the created
# module (export of symbols)
globals_map["mvc_utils"] = utils
globals_map["controllers"] = utils
Expand Down Expand Up @@ -798,7 +798,7 @@ def create_controllers(
# so that it may be referred latter by any controller logic
if models_module: setattr(system_instance, "models", models_module)

# imports the controllers module with the mvc utils support
# imports the controllers module with the MVC utils support
# this should allow the exporting of the various packages
# included in the utils structure (extra import)
controllers_module = self.import_module_mvc_utils(
Expand Down
10 changes: 5 additions & 5 deletions mvc/src/mvc_utils_plugin.py
Expand Up @@ -39,14 +39,14 @@

import colony

class MvcUtilsPlugin(colony.Plugin):
class MVCUtilsPlugin(colony.Plugin):
"""
The main class for the Mvc Utils plugin.
The main class for the MVC Utils plugin.
"""

id = "pt.hive.colony.plugins.mvc.utils"
name = "Mvc Utils"
description = "The plugin that offers the top-level abstractions for mvc processing"
name = "MVC Utils"
description = "The plugin that offers the top-level abstractions for MVC processing"
version = "1.0.0"
author = "Hive Solutions Lda. <development@hive.pt>"
platforms = [
Expand All @@ -73,7 +73,7 @@ class MvcUtilsPlugin(colony.Plugin):
def load_plugin(self):
colony.Plugin.load_plugin(self)
import mvc_utils
self.system = mvc_utils.MvcUtils(self)
self.system = mvc_utils.MVCUtils(self)

def assign_models(
self,
Expand Down

0 comments on commit 10ff5f9

Please sign in to comment.