From 7846d9017d05b2ca541c9519c4c2a3d8b8e17d1f Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 2 Jul 2018 08:33:21 +0200 Subject: [PATCH] [Refactor] Rename the app module to calsocial Just for clarity --- .gitignore | 2 +- {app => calsocial}/__init__.py | 14 +++++++------- {app => calsocial}/calendar_system/__init__.py | 0 {app => calsocial}/calendar_system/gregorian.py | 2 +- {app => calsocial}/config_dev.py | 0 {app => calsocial}/forms.py | 0 {app => calsocial}/models.py | 0 {app => calsocial}/security.py | 0 .../static/images/calendar-social-icon-16.png | Bin .../static/images/calendar-social-icon-192.png | Bin .../static/images/calendar-social-icon-32.png | Bin .../static/images/calendar-social-icon-400.png | Bin .../static/images/calendar-social-icon-96.png | Bin .../images/calendar-social-icon-no-circle.svg | 0 .../static/images/calendar-social-icon.svg | 0 {app => calsocial}/templates/base.html | 0 {app => calsocial}/templates/event-edit.html | 0 {app => calsocial}/templates/index.html | 0 {app => calsocial}/templates/month-view.html | 0 .../templates/registration-disabled.html | 0 {app => calsocial}/templates/registration.html | 0 {app => calsocial}/templates/welcome.html | 0 .../translations/hu/LC_MESSAGES/messages.po | 0 23 files changed, 9 insertions(+), 9 deletions(-) rename {app => calsocial}/__init__.py (91%) rename {app => calsocial}/calendar_system/__init__.py (100%) rename {app => calsocial}/calendar_system/gregorian.py (97%) rename {app => calsocial}/config_dev.py (100%) rename {app => calsocial}/forms.py (100%) rename {app => calsocial}/models.py (100%) rename {app => calsocial}/security.py (100%) rename {app => calsocial}/static/images/calendar-social-icon-16.png (100%) rename {app => calsocial}/static/images/calendar-social-icon-192.png (100%) rename {app => calsocial}/static/images/calendar-social-icon-32.png (100%) rename {app => calsocial}/static/images/calendar-social-icon-400.png (100%) rename {app => calsocial}/static/images/calendar-social-icon-96.png (100%) rename {app => calsocial}/static/images/calendar-social-icon-no-circle.svg (100%) rename {app => calsocial}/static/images/calendar-social-icon.svg (100%) rename {app => calsocial}/templates/base.html (100%) rename {app => calsocial}/templates/event-edit.html (100%) rename {app => calsocial}/templates/index.html (100%) rename {app => calsocial}/templates/month-view.html (100%) rename {app => calsocial}/templates/registration-disabled.html (100%) rename {app => calsocial}/templates/registration.html (100%) rename {app => calsocial}/templates/welcome.html (100%) rename {app => calsocial}/translations/hu/LC_MESSAGES/messages.po (100%) diff --git a/.gitignore b/.gitignore index 382c831..f97f5ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ __pycache__/ -/app/local.db +/calsocial/local.db /messages.pot /app/translations/*/LC_MESSAGES/*.mo diff --git a/app/__init__.py b/calsocial/__init__.py similarity index 91% rename from app/__init__.py rename to calsocial/__init__.py index 27d511b..bef298f 100644 --- a/app/__init__.py +++ b/calsocial/__init__.py @@ -46,8 +46,8 @@ def template_vars(): class CalendarSocialApp(Flask): def __init__(self, name, config=None): - from app.models import db, User, Role - from app.security import security + from .models import db, User, Role + from .security import security Flask.__init__(self, name) @@ -70,7 +70,7 @@ app = CalendarSocialApp(__name__) @app.route('/') def hello(): - from app.calendar_system.gregorian import GregorianCalendar + from .calendar_system.gregorian import GregorianCalendar if not current_user.is_authenticated: return render_template('welcome.html') @@ -85,8 +85,8 @@ def register(): if not current_app.config['REGISTRATION_ENABLED']: return render_template('registration-disabled.html') - from app.forms import RegistrationForm - from app.models import db, User + from .forms import RegistrationForm + from .models import db, User form = RegistrationForm() @@ -106,8 +106,8 @@ def register(): @app.route('/new-event', methods=['GET', 'POST']) @login_required def new_event(): - from app.forms import EventForm - from app.models import db, Event + from .forms import EventForm + from .models import db, Event form = EventForm() diff --git a/app/calendar_system/__init__.py b/calsocial/calendar_system/__init__.py similarity index 100% rename from app/calendar_system/__init__.py rename to calsocial/calendar_system/__init__.py diff --git a/app/calendar_system/gregorian.py b/calsocial/calendar_system/gregorian.py similarity index 97% rename from app/calendar_system/gregorian.py rename to calsocial/calendar_system/gregorian.py index 162bfd6..8eac2c9 100644 --- a/app/calendar_system/gregorian.py +++ b/calsocial/calendar_system/gregorian.py @@ -48,7 +48,7 @@ class GregorianCalendar(CalendarSystem): return day_list def day_events(self, date, user=None): - from app.models import Event + from ..models import Event events = Event.query diff --git a/app/config_dev.py b/calsocial/config_dev.py similarity index 100% rename from app/config_dev.py rename to calsocial/config_dev.py diff --git a/app/forms.py b/calsocial/forms.py similarity index 100% rename from app/forms.py rename to calsocial/forms.py diff --git a/app/models.py b/calsocial/models.py similarity index 100% rename from app/models.py rename to calsocial/models.py diff --git a/app/security.py b/calsocial/security.py similarity index 100% rename from app/security.py rename to calsocial/security.py diff --git a/app/static/images/calendar-social-icon-16.png b/calsocial/static/images/calendar-social-icon-16.png similarity index 100% rename from app/static/images/calendar-social-icon-16.png rename to calsocial/static/images/calendar-social-icon-16.png diff --git a/app/static/images/calendar-social-icon-192.png b/calsocial/static/images/calendar-social-icon-192.png similarity index 100% rename from app/static/images/calendar-social-icon-192.png rename to calsocial/static/images/calendar-social-icon-192.png diff --git a/app/static/images/calendar-social-icon-32.png b/calsocial/static/images/calendar-social-icon-32.png similarity index 100% rename from app/static/images/calendar-social-icon-32.png rename to calsocial/static/images/calendar-social-icon-32.png diff --git a/app/static/images/calendar-social-icon-400.png b/calsocial/static/images/calendar-social-icon-400.png similarity index 100% rename from app/static/images/calendar-social-icon-400.png rename to calsocial/static/images/calendar-social-icon-400.png diff --git a/app/static/images/calendar-social-icon-96.png b/calsocial/static/images/calendar-social-icon-96.png similarity index 100% rename from app/static/images/calendar-social-icon-96.png rename to calsocial/static/images/calendar-social-icon-96.png diff --git a/app/static/images/calendar-social-icon-no-circle.svg b/calsocial/static/images/calendar-social-icon-no-circle.svg similarity index 100% rename from app/static/images/calendar-social-icon-no-circle.svg rename to calsocial/static/images/calendar-social-icon-no-circle.svg diff --git a/app/static/images/calendar-social-icon.svg b/calsocial/static/images/calendar-social-icon.svg similarity index 100% rename from app/static/images/calendar-social-icon.svg rename to calsocial/static/images/calendar-social-icon.svg diff --git a/app/templates/base.html b/calsocial/templates/base.html similarity index 100% rename from app/templates/base.html rename to calsocial/templates/base.html diff --git a/app/templates/event-edit.html b/calsocial/templates/event-edit.html similarity index 100% rename from app/templates/event-edit.html rename to calsocial/templates/event-edit.html diff --git a/app/templates/index.html b/calsocial/templates/index.html similarity index 100% rename from app/templates/index.html rename to calsocial/templates/index.html diff --git a/app/templates/month-view.html b/calsocial/templates/month-view.html similarity index 100% rename from app/templates/month-view.html rename to calsocial/templates/month-view.html diff --git a/app/templates/registration-disabled.html b/calsocial/templates/registration-disabled.html similarity index 100% rename from app/templates/registration-disabled.html rename to calsocial/templates/registration-disabled.html diff --git a/app/templates/registration.html b/calsocial/templates/registration.html similarity index 100% rename from app/templates/registration.html rename to calsocial/templates/registration.html diff --git a/app/templates/welcome.html b/calsocial/templates/welcome.html similarity index 100% rename from app/templates/welcome.html rename to calsocial/templates/welcome.html diff --git a/app/translations/hu/LC_MESSAGES/messages.po b/calsocial/translations/hu/LC_MESSAGES/messages.po similarity index 100% rename from app/translations/hu/LC_MESSAGES/messages.po rename to calsocial/translations/hu/LC_MESSAGES/messages.po