Browse Source

Misago versioning convention changed

Ralfp 12 years ago
parent
commit
3a071d930a
4 changed files with 53 additions and 28 deletions
  1. 1 23
      misago/__init__.py
  2. 4 1
      misago/context_processors.py
  3. 2 2
      misago/management/commands/about.py
  4. 46 2
      refactoring.md

+ 1 - 23
misago/__init__.py

@@ -1,23 +1 @@
-VERSION = (0, 1, 0, 'alpha', 0)
-
-def get_version(version=None):
-    """Derives a PEP386-compliant version number from VERSION."""
-    if version is None:
-        version = VERSION
-    assert len(version) == 5
-    assert version[3] in ('alpha', 'beta', 'rc', 'final')
-
-    # Now build the two parts of the version number:
-    # main = X.Y[.Z]
-    # sub = .devN - for pre-alpha releases
-    #     | {a|b|c}N - for alpha, beta and rc releases
-
-    parts = 2 if version[2] == 0 else 3
-    main = '.'.join(str(x) for x in version[:parts])
-
-    sub = ''
-    if version[3] != 'final':
-        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
-        sub = mapping[version[3]] + str(version[4])
-
-    return main + sub
+__version__ = "0.0.1 DEV"

+ 4 - 1
misago/context_processors.py

@@ -1,6 +1,9 @@
+from misago import __version__
+
 def misago(request):
 def misago(request):
     return {
     return {
+        'version': __version__,
         'monitor': request.monitor,
         'monitor': request.monitor,
         'settings': request.settings,
         'settings': request.settings,
         'stopwatch': request.stopwatch.time(),
         'stopwatch': request.stopwatch.time(),
-    }
+    }

+ 2 - 2
misago/management/commands/about.py

@@ -1,6 +1,6 @@
 from django.core.management.base import BaseCommand, CommandError
 from django.core.management.base import BaseCommand, CommandError
 from django.utils import timezone
 from django.utils import timezone
-from misago import get_version
+from misago import __version__
 
 
 class Command(BaseCommand):
 class Command(BaseCommand):
     """
     """
@@ -16,7 +16,7 @@ class Command(BaseCommand):
         self.stdout.write('                      /_/ /_/ /_/_/____/\__,_/\__, /\____/ \n')
         self.stdout.write('                      /_/ /_/ /_/_/____/\__,_/\__, /\____/ \n')
         self.stdout.write('                                             /____/\n')
         self.stdout.write('                                             /____/\n')
         self.stdout.write('\n')
         self.stdout.write('\n')
-        self.stdout.write('                    Your community is powered by Misago v.%s' % get_version())
+        self.stdout.write('                    Your community is powered by Misago v.%s' % __version__)
         self.stdout.write('\n              For help and feedback visit http://misago-project.org')
         self.stdout.write('\n              For help and feedback visit http://misago-project.org')
         self.stdout.write('\n\n')
         self.stdout.write('\n\n')
         self.stdout.write('================================================================================')
         self.stdout.write('================================================================================')

+ 46 - 2
refactoring.md

@@ -7,17 +7,36 @@ Directory Tree
 ```
 ```
 misago/                        App root structure
 misago/                        App root structure
 +-admin/                       Admin apps
 +-admin/                       Admin apps
-+-common/                      Common apps
++-shared/                      Shared (Admin/Front) apps
 +-core/                        Core features
 +-core/                        Core features
+  +-forms/                     Misago forms
+    +-fields.py                Custom fields
+    +-forms.py                 Custom form base class
+    +-layouts.py               Forums layouts (wrapper around Django forms that enables templating)
+    +-widgets.py               Custom widgets
+  +-monitor.py                 Monitor controller that tracks forum stats
+  +-settings.py                DB based settings controller
+  +-stopwatch.py               Stopwatch controller for measuring request processing time
 +-fixtures/                    Starting data
 +-fixtures/                    Starting data
+  +-basicsettings.py           "Basic Settings" group fixture
+  +-usersmonitor.py            Users Monitor fixture
 +-front/                       Frontend apps
 +-front/                       Frontend apps
 +-management/                  manage.py commands
 +-management/                  manage.py commands
 +-migrations/                  South DB migrations
 +-migrations/                  South DB migrations
 +-models/                      Models
 +-models/                      Models
 +-middleware/                  Middlewares
 +-middleware/                  Middlewares
+  +-monitor.py                 Middleware that makes Monitor accessible from request.monitor
+  +-settings.py                Middleware that makes DB Settings accessible from request.settings
+  +-stopwatch.py               Middleware that makes Stopwatch accessible from request.stopwatch
 +-templatetags/                Template tags
 +-templatetags/                Template tags
 +-utils/                       Small helpers that are imported by models/views
 +-utils/                       Small helpers that are imported by models/views
-+-validators/                  Validators
+  +-avatars.py                 Functions for working with avatars sizes
+  +-datesformats.py            Functions for formatting dates and times
+  +-fixtures.py                Fixture loaders
+  +-pagination.py              Pagination helper
+  +-strings.py                 Strings utilities (make slug from string, generate random string, etc. ect.)
+  +-timezones.py               Generate fancy timezones list
+  +-translation.py             Functions for working with translation strings
 +-__init__.py                  Misago init, contains Misago version
 +-__init__.py                  Misago init, contains Misago version
 +-context_processors.py        Misago context processors
 +-context_processors.py        Misago context processors
 +-settingsbase.py              Base configuration
 +-settingsbase.py              Base configuration
@@ -75,6 +94,8 @@ Firewalls
 
 
 Forms
 Forms
 -----
 -----
+* Moved package under core package.
+* Split __init__.py into three modules.
 
 
 
 
 Forumroles
 Forumroles
@@ -99,6 +120,11 @@ Messages
 
 
 Monitor
 Monitor
 -------
 -------
+* Moved controller to core package.
+* Moved context processor to main context processor.
+* Moved fixture utils to fixtures.py module in utils package.
+* Moved middleware to middleware package.
+* Renamed model Item to MonitorItem and moved it to models package.
 
 
 
 
 Newsfeed
 Newsfeed
@@ -147,10 +173,23 @@ Sessions
 
 
 Settings
 Settings
 --------
 --------
+* Moved controller to core package.
+* Moved context processor to main context processor.
+* Moved fixture utils to fixtures.py module in utils package.
+* Moved middleware to middleware package.
+* Moved Setting model to models package.
+* Renamed "type" attribute on Setting model to "normalizes_to".
+* Renamed "input" attribute on Setting model to "field".
+* Renamed model Group to SettingsGroup and moved it to models package.
 
 
 
 
 Setup
 Setup
 -----
 -----
+* Moved management commands to management package.
+* Renamed "initdata" command to "syncfixtures".
+* Moved fixture utils to fixtures.py module in utils package.
+* Moved Fixture model to models package.
+* Renamed "app_name" attribute on Fixture model to "name".
 
 
 
 
 Stats
 Stats
@@ -159,6 +198,9 @@ Stats
 
 
 Stopwatch
 Stopwatch
 ---------
 ---------
+* Moved controller to core package.
+* Moved middleware to middleware package.
+* Added "stopwatch" to template context.
 
 
 
 
 Team
 Team
@@ -179,6 +221,7 @@ Threads
 
 
 Timezones
 Timezones
 ---------
 ---------
+* Turned into module in utils package.
 
 
 
 
 ToS
 ToS
@@ -195,6 +238,7 @@ Users
 
 
 Utils
 Utils
 -----
 -----
+* Split __init__.py module into datesformat, pagination, translation and strings modules.
 
 
 
 
 Watcher
 Watcher