Browse Source

Fix VERSION

Dashie der otter 3 months ago
parent
commit
1ca9417bb1
3 changed files with 8 additions and 5 deletions
  1. 2
    2
      activitypub/backend.py
  2. 5
    3
      app.py
  3. 1
    0
      version.py

+ 2
- 2
activitypub/backend.py View File

@@ -4,7 +4,7 @@ import requests
4 4
 from models import db, Activity, create_remote_actor, Actor
5 5
 from urllib.parse import urlparse
6 6
 from .vars import Box
7
-from app import __VERSION__
7
+from version import VERSION
8 8
 
9 9
 
10 10
 class Reel2BitsBackend(ap.Backend):
@@ -13,7 +13,7 @@ class Reel2BitsBackend(ap.Backend):
13 13
 
14 14
     def user_agent(self) -> str:
15 15
         url = current_app.config["BASE_URL"]
16
-        return f"{requests.utils.default_user_agent()} " f"(reel2bits/{__VERSION__}; +{url})"
16
+        return f"{requests.utils.default_user_agent()} " f"(reel2bits/{VERSION}; +{url})"
17 17
 
18 18
     def base_url(self):
19 19
         return current_app.config["BASE_URL"]

+ 5
- 3
app.py View File

@@ -29,7 +29,9 @@ from activitypub.backend import Reel2BitsBackend
29 29
 
30 30
 from celery import Celery
31 31
 
32
-__VERSION__ = "0.0.1"
32
+from version import VERSION
33
+
34
+__VERSION__ = VERSION
33 35
 
34 36
 try:
35 37
     from raven.contrib.flask import Sentry
@@ -162,9 +164,9 @@ def create_app(config_filename="config.py", app_name=None, register_blueprints=T
162 164
             flash(gettext("Config not found"), "error")
163 165
 
164 166
         cfg = {
165
-            "REEL2BITS_VERSION_VER": __VERSION__,
167
+            "REEL2BITS_VERSION_VER": VERSION,
166 168
             "REEL2BITS_VERSION_GIT": git_version,
167
-            "REEL2BITS_VERSION": "{0} ({1})".format(__VERSION__, git_version),
169
+            "REEL2BITS_VERSION": "{0} ({1})".format(VERSION, git_version),
168 170
             "app_name": _config.app_name,
169 171
             "app_description": _config.app_description,
170 172
         }

+ 1
- 0
version.py View File

@@ -0,0 +1 @@
1
+VERSION = "0.0.1"

Loading…
Cancel
Save