diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f2e0b4..5eabfbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,5 +11,14 @@ - Added flask-mailman for the default mail service. - Added flask-express for expressJs like service. -#### Bug fixes -- Added flask-express 0.1.2 to fix the issue releated to the admin panel. \ No newline at end of file +#### Bug Fixes +- Added flask-express 0.1.2 to fix the issue releated to the admin panel. + +## [0.0.5] + +#### Changed +- Changed the check version system. Now anybody can get the `Navycut` version by simply executing this command: `navycut -V` or `navycut --version` + +#### Bug Fixes +- Fixed static_server not working issue. +- Fixed paytm logo not found issue. \ No newline at end of file diff --git a/README.md b/README.md index 611fd6c..858f2f9 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ python3 setup.py install ### check for installation ```bash -navycut version -0.0.3 +navycut --version +0.0.5 ``` ### Introduction to Navycut @@ -338,7 +338,7 @@ admin.register_model(Author, AuthorAdminModelView) # Use the customized options
- + ### Contributors diff --git a/examples/aditi/aniket/models.py b/examples/aditi/aniket/models.py index 0c5d85e..4db11a2 100644 --- a/examples/aditi/aniket/models.py +++ b/examples/aditi/aniket/models.py @@ -16,7 +16,7 @@ class Blog(sql.Model): class Author(sql.Model): # id = sql.fields.Integer(pk=True, unique=True) name = sql.fields.Char(required=True, unique=True) - picture = sql.fields.Image(required=True) + picture = sql.fields.Image(required=False) is_active = sql.fields.Boolean(default=True) class ExtraUser(sql.Model): diff --git a/examples/aditi/uploads/images/1609533479162.jpg b/examples/aditi/uploads/images/1609533479162.jpg new file mode 100644 index 0000000..f909285 Binary files /dev/null and b/examples/aditi/uploads/images/1609533479162.jpg differ diff --git a/examples/aditi/uploads/images/RHEL-python-1569314-pixabay.jpg b/examples/aditi/uploads/images/RHEL-python-1569314-pixabay.jpg new file mode 100644 index 0000000..4f1e46a Binary files /dev/null and b/examples/aditi/uploads/images/RHEL-python-1569314-pixabay.jpg differ diff --git a/navycut/__init__.py b/navycut/__init__.py index 8f652a0..87e8496 100644 --- a/navycut/__init__.py +++ b/navycut/__init__.py @@ -5,13 +5,13 @@ """ -version_info = (0, 0, 4) +version_info = (0, 0, 5) __version__ = ".".join([str(v) for v in version_info]) __author__ = "Aniket Sarkar" -def get_version(ctx=None, param=None): +def get_version(): """ returns the default version. """ diff --git a/navycut/__main__.py b/navycut/__main__.py index 2de0be2..da1ca80 100644 --- a/navycut/__main__.py +++ b/navycut/__main__.py @@ -1,3 +1,10 @@ +from .cli import print_version +import click + + +@click.command() +@click.option('-V', '--version', is_flag=True, callback=print_version, + expose_value=False, is_eager=True) def _main(): from .cli import _execute_from_command_line return _execute_from_command_line() diff --git a/navycut/cli/__init__.py b/navycut/cli/__init__.py index 21b06f5..d7a9730 100644 --- a/navycut/cli/__init__.py +++ b/navycut/cli/__init__.py @@ -1,6 +1,13 @@ import click as c from ._exec_cli import _create_boiler_project -from navycut import get_version +from navycut import __version__ + +def print_version(ctx, param, value): + if not value or ctx.resilient_parsing: + return + c.echo(__version__) + ctx.exit() + @c.group() def _execute_from_command_line(): diff --git a/navycut/conf/__init__.py b/navycut/conf/__init__.py index f2ee287..cebc752 100644 --- a/navycut/conf/__init__.py +++ b/navycut/conf/__init__.py @@ -3,7 +3,7 @@ import typing as t from . import global_settings from ..errors.server import SettingsFileNotFoundError, ImproperlyConfigured -from ..errors.misc import DataTypeMismatchError, NCBaseError +from ..errors.misc import DataTypeMismatchError __all__ = ("get_settings_module", "settings") diff --git a/navycut/core/app_config.py b/navycut/core/app_config.py index 8469211..b293d29 100644 --- a/navycut/core/app_config.py +++ b/navycut/core/app_config.py @@ -57,7 +57,7 @@ def _attach_settings_modules(self): self.settings = settings self._add_config(settings) - self._configure_core_features() + self._configure_core_features(settings) self._perform_sister_registration(settings) self._perform_middleware_registration(settings) @@ -144,7 +144,7 @@ def _add_extra_config(self, settings) -> None: self.config[key] = value - def _configure_core_features(self): + def _configure_core_features(self, settings): """ add all the core features of navycut app here. """ diff --git a/navycut/helpers/upload_server/sister.py b/navycut/helpers/upload_server/sister.py index a50e6e0..ee4e10b 100644 --- a/navycut/helpers/upload_server/sister.py +++ b/navycut/helpers/upload_server/sister.py @@ -3,7 +3,7 @@ class UploadServerSister(AppSister): - seize_power = True + seize_power = False name = "upload_server_sister" static_folder = settings.BASE_DIR / "uploads", static_url_path = "/",