Skip to content

Commit

Permalink
Change appstore_version to a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bcwu authored May 1, 2023
1 parent 35633b2 commit f75817c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rsconnect/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from .log import logger
from .models import AppMode, AppModes

APPSTORE_VERSION = 1

def config_dirname(platform=sys.platform, env=os.environ):
"""Get the user's configuration directory path for this platform."""
Expand Down Expand Up @@ -404,12 +403,13 @@ class AppStore(DataStore):
hash is derived from the entry point file name.
"""

def __init__(self, app_file):
def __init__(self, app_file, appstore_version=1):
base_name = str(basename(app_file).rsplit(".", 1)[0]) + ".json"
super(AppStore, self).__init__(
join(dirname(app_file), "rsconnect-python", base_name),
join(config_dirname(), "applications", sha1(abspath(app_file)) + ".json"),
)
self.appstore_version = appstore_version

def get(self, server_url):
"""
Expand Down Expand Up @@ -447,7 +447,7 @@ def set(self, server_url, filename, app_url, app_id, app_guid, title, app_mode):
app_guid=app_guid,
title=title,
app_mode=app_mode.name() if isinstance(app_mode, AppMode) else app_mode,
appstore_version=APPSTORE_VERSION,
appstore_version=self.appstore_version,
),
)

Expand Down

0 comments on commit f75817c

Please sign in to comment.