From f86a82f2e37ed3b662418bd97f5fc733001e527d Mon Sep 17 00:00:00 2001 From: Ivan Titov Date: Wed, 29 Apr 2020 12:53:13 +0500 Subject: [PATCH] 0.6.5 beta - Bug fixes - Refactorings --- package.setup | 3 +- python2.7libs/package_manager/github.py | 84 ++++++---------- .../package_manager/houdini_license.py | 2 + .../package_manager/install_local.py | 8 +- python2.7libs/package_manager/install_web.py | 8 +- python2.7libs/package_manager/link_label.py | 2 + .../package_manager/local_package.py | 97 +------------------ python2.7libs/package_manager/main_window.py | 16 +-- python2.7libs/package_manager/package.py | 94 ++++++++++++++++++ .../package_manager/package_content.py | 2 + python2.7libs/package_manager/package_list.py | 2 + .../package_manager/package_status.py | 2 + python2.7libs/package_manager/path_text.py | 2 + python2.7libs/package_manager/settings.py | 2 + python2.7libs/package_manager/shelves.py | 2 + python2.7libs/package_manager/update.py | 11 ++- .../package_manager/update_dialog.py | 16 ++- python2.7libs/package_manager/update_list.py | 2 + .../package_manager/update_options.py | 2 + python2.7libs/package_manager/version.py | 2 + .../package_manager/version_dialog.py | 2 + python2.7libs/package_manager/web_package.py | 6 +- .../package_manager/web_package_content.py | 2 + .../package_manager/web_package_list.py | 2 +- python2.7libs/pythonrc.py | 7 +- 25 files changed, 201 insertions(+), 177 deletions(-) diff --git a/package.setup b/package.setup index bfba598..d7e8875 100644 --- a/package.setup +++ b/package.setup @@ -1,7 +1,8 @@ { "name": "Package Manager", "author": "Ivan Titov", - "version": "0.6.4-beta", + "version": "0.6.5-beta", + "version_type": "version", "source": "Houdini-Packages/Houdini-Package-Manager", "source_type": "github" } diff --git a/python2.7libs/package_manager/github.py b/python2.7libs/package_manager/github.py index fe8a585..26fa4fc 100644 --- a/python2.7libs/package_manager/github.py +++ b/python2.7libs/package_manager/github.py @@ -11,7 +11,8 @@ import hou import requests -from .local_package import isPackage, NotPackageError, LocalPackage +from .local_package import NotPackageError, LocalPackage +from package_manager.package import isPackage from .houdini_license import fullHoudiniLicenseName, HOUDINI_COMMERCIAL_LICENSE from .version_dialog import VersionDialog from .version import Version @@ -19,7 +20,7 @@ from .package import Package -class RepoNotFound(Exception): +class RepoNotFound(IOError): pass @@ -47,7 +48,7 @@ def fromJson(cls, data): return cls(data['data'], data.get('etag'), data.get('last_modified')) -class GitHubAPICache: +class API: cache_data = {} @staticmethod @@ -63,12 +64,12 @@ def get(url, headers=None, timeout=5): headers_data.update(headers) try: - GitHubAPICache.loadFromFile() + API.loadFromFile() except IOError: pass - if url in GitHubAPICache.cache_data: - cached_item = GitHubAPICache.cache_data[url] + if url in API.cache_data: + cached_item = API.cache_data[url] if cached_item.etag: headers_data['If-None-Match'] = cached_item.etag elif cached_item.last_modified: @@ -76,83 +77,54 @@ def get(url, headers=None, timeout=5): r = requests.get(url, stream=True, headers=headers_data, timeout=timeout) + if os.getenv('username') == 'MarkWilson': # Debug only + print(r.headers.get('X-RateLimit-Remaining')) + if r.status_code == 200: data = json.loads(r.text) etag = r.headers.get('ETag') last_modified = r.headers.get('Last-Modified') - GitHubAPICache.cache_data[url] = CacheItem(data, etag, last_modified) - GitHubAPICache.saveToFile() + API.cache_data[url] = CacheItem(data, etag, last_modified) + API.saveToFile() return data elif r.status_code == 304: - return GitHubAPICache.cache_data[url].data + return API.cache_data[url].data elif r.status_code == 403: raise ReachedAPILimit elif r.status_code == 404: raise RepoNotFound # Todo: explainable message - # @staticmethod - # def post(query): - # """Test only, don't use in production""" - # headers = {'Authorization': 'Bearer 008d86db69e83cef0e1df1d2d3691b6efcc28be6'} - # r = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) - # print(r.text) - @staticmethod def toJson(): - return {url: item.toJson() for url, item in GitHubAPICache.cache_data.items()} + return {url: item.toJson() for url, item in API.cache_data.items()} @staticmethod def fromJson(data): for url, item_data in data.items(): - GitHubAPICache.cache_data[url] = CacheItem.fromJson(item_data) + API.cache_data[url] = CacheItem.fromJson(item_data) @staticmethod def saveToFile(): file_path = hou.expandString('$HOUDINI_USER_PREF_DIR/package_manager.github_api_cache') with open(file_path, 'w') as file: - json.dump(GitHubAPICache.toJson(), file) + json.dump(API.toJson(), file) @staticmethod def loadFromFile(): file_path = hou.expandString('$HOUDINI_USER_PREF_DIR/package_manager.github_api_cache') with open(file_path) as file: - GitHubAPICache.fromJson(json.load(file)) + API.fromJson(json.load(file)) @staticmethod def clear(): - GitHubAPICache.cache_data = {} - GitHubAPICache.saveToFile() + API.cache_data = {} + API.saveToFile() @staticmethod def cacheSize(): raise NotImplementedError -# class Release: -# def __init__(self, release_data): -# self.__data = release_data -# -# @property -# def version(self): -# return self.__data.get('tag_name') -# -# @property -# def name(self): -# return self.__data.get('name') -# -# @property -# def changes(self): -# return self.__data.get('body') -# -# @property -# def is_stable(self): -# return not self.__data.get('prerelease') -# -# @property -# def zip_archive_url(self): -# return self.__data.get('zipball_url') - - def ownerAndRepoName(source): return source.strip('/').split('/')[-2:] @@ -164,7 +136,7 @@ def repoURL(owner, repo_name): def isPackageRepo(source): repo_owner, repo_name = ownerAndRepoName(source) api_repo_url = 'https://api.github.com/repos/{0}/{1}/contents'.format(repo_owner, repo_name) - repo_content = GitHubAPICache.get(api_repo_url) + repo_content = API.get(api_repo_url) items = tuple(file_data['name'] for file_data in repo_content) return isPackage(items) @@ -188,7 +160,7 @@ def extractRepoZip(file_path, repo_data, dst_location='$HOUDINI_USER_PREF_DIR', def ownerName(login): - return GitHubAPICache.get('https://api.github.com/users/' + login).get('name', login) + return API.get('https://api.github.com/users/' + login).get('name', login) def repoDescription(package_or_link): @@ -196,7 +168,7 @@ def repoDescription(package_or_link): repo_owner, repo_name = ownerAndRepoName(package_or_link.source) else: # package_or_link is link repo_owner, repo_name = ownerAndRepoName(package_or_link) - return GitHubAPICache.get('https://api.github.com/repos/{0}/{1}'.format(repo_owner, repo_name)).get('description') + return API.get('https://api.github.com/repos/{0}/{1}'.format(repo_owner, repo_name)).get('description') def updatePackageDataFile(repo_data, package, package_location, @@ -229,8 +201,8 @@ def updatePackageDataFile(repo_data, package, package_location, fullHoudiniLicenseName(HOUDINI_COMMERCIAL_LICENSE) if not data.get('status') or update: data['status'] = package.status or 'Stable' - if not data.get('setup_scheme') or update: - data['setup_scheme'] = package.setup_scheme + if not data.get('setup_schema') or update: + data['setup_schema'] = package.setup_schema with open(data_file_path, 'w') as file: json.dump(data, file, indent=4, encoding='utf-8') @@ -256,12 +228,12 @@ def installFromRepo(package_or_link, dst_location='$HOUDINI_USER_PREF_DIR', upda package = None repo_api_url = 'https://api.github.com/repos/{0}/{1}'.format(repo_owner, repo_name) - repo_data = GitHubAPICache.get(repo_api_url) + repo_data = API.get(repo_api_url) version = None releases_api_url = repo_api_url + '/releases' versions = [] - for release_data in GitHubAPICache.get(releases_api_url): + for release_data in API.get(releases_api_url): if only_stable and release_data['prerelease']: continue versions.append(Version(release_data['tag_name'])) @@ -301,13 +273,13 @@ def repoHasUpdate(link, version, version_type, only_stable=True): repo_api_url = 'https://api.github.com/repos/{0}/{1}'.format(repo_owner, repo_name) if version_type == 'time_github': - repo_data = GitHubAPICache.get(repo_api_url) + repo_data = API.get(repo_api_url) latest_version = parseTimestamp(repo_data['pushed_at']) version = parseTimestamp(version) # Todo: support only_stable else: releases_api_url = repo_api_url + '/releases' - releases_data = GitHubAPICache.get(releases_api_url) + releases_data = API.get(releases_api_url) if not releases_data: return False diff --git a/python2.7libs/package_manager/houdini_license.py b/python2.7libs/package_manager/houdini_license.py index 816bbf5..ce5be0f 100644 --- a/python2.7libs/package_manager/houdini_license.py +++ b/python2.7libs/package_manager/houdini_license.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import hou HOUDINI_COMMERCIAL_LICENSE = hou.licenseCategoryType.Commercial diff --git a/python2.7libs/package_manager/install_local.py b/python2.7libs/package_manager/install_local.py index e9ba1dc..c4f5ca2 100644 --- a/python2.7libs/package_manager/install_local.py +++ b/python2.7libs/package_manager/install_local.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import os try: @@ -71,9 +73,9 @@ def __init__(self, parent=None): self.folder_path_field = FolderField() form_layout.addRow('Folder Path', self.folder_path_field) - self.setup_scheme_combo = QComboBox() - self.setup_scheme_combo.setDisabled(True) - form_layout.addRow('Setup Scheme', self.setup_scheme_combo) + self.setup_schema_combo = QComboBox() + self.setup_schema_combo.setDisabled(True) + form_layout.addRow('Setup Schema', self.setup_schema_combo) buttons_layout = QHBoxLayout() main_layout.addLayout(buttons_layout) diff --git a/python2.7libs/package_manager/install_web.py b/python2.7libs/package_manager/install_web.py index 77966d0..71bae46 100644 --- a/python2.7libs/package_manager/install_web.py +++ b/python2.7libs/package_manager/install_web.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * @@ -36,9 +38,9 @@ def __init__(self, parent=None): self.web_link_field.setPlaceholderText('https://github.com/Houdini-Packages/Houdini-Package-Manager') form_layout.addRow('Web Link', self.web_link_field) - self.setup_scheme_combo = QComboBox() - self.setup_scheme_combo.setDisabled(True) - form_layout.addRow('Setup Scheme', self.setup_scheme_combo) + self.setup_schema_combo = QComboBox() + self.setup_schema_combo.setDisabled(True) + form_layout.addRow('Setup Schema', self.setup_schema_combo) buttons_layout = QHBoxLayout() main_layout.addLayout(buttons_layout) diff --git a/python2.7libs/package_manager/link_label.py b/python2.7libs/package_manager/link_label.py index db032b6..05b4fa0 100644 --- a/python2.7libs/package_manager/link_label.py +++ b/python2.7libs/package_manager/link_label.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import webbrowser try: diff --git a/python2.7libs/package_manager/local_package.py b/python2.7libs/package_manager/local_package.py index 203849a..5bff741 100644 --- a/python2.7libs/package_manager/local_package.py +++ b/python2.7libs/package_manager/local_package.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import json import os @@ -5,7 +7,7 @@ from .houdini_license import fullHoudiniLicenseName from .package_status import fullPackageStatusName -from .package import Package +from .package import Package, isPackage class NotPackageError(IOError): @@ -20,97 +22,6 @@ class AlreadyInstalledError(IOError): pass -def isPackage(items, level=2): - XML_NAMES = ('AnimationEditorDopesheetContextMenu', - 'AnimationEditorDopesheetMenu', - 'AnimationEditorGraphContextMenu', - 'AnimationEditorGraphMenu', - 'AnimationEditorMenu', - 'AnimationEditorTableContextMenu', - 'AnimationEditorTableMenu', - 'ChannelListMenu', - 'CHGmenu', - 'DesktopsMenu', - 'ExampleMenu', - 'GEOclassicXlate', - 'KeyframesMenu', - 'MainMenuARecord', - 'MainMenuCommon', - 'MainMenuEscape', - 'MainMenuGPlay', - 'MainMenuHKey', - 'MainMenuHOTLView', - 'MainMenuMaster', - 'MainMenuMPlay', - 'MainMenuPDG', - 'MotionEffectsMenu', - 'NetworkViewMenu', - 'NetworkViewMenuPDG', - 'NetworkViewMenuTOP', - 'OPmenu', - 'PaneTabTypeMenu', - 'PaneTabTypeMenuPDG', - 'ParmGearMenu', - 'PARMmenu', - 'PlaybarMenu', - 'ShelfMenu', - 'ShelfSetMenu', - 'ShelfSetPlusMenu', - 'ShelfToolMenu', - 'TakeListMenu', - 'UsdStagePrimMenu', - 'VOPFXmenu') - scores = 0 - if 'bin' in items: - scores += 1 - if 'config' in items: - scores += 1 - if 'presets' in items: - scores += 1 - if 'desktop' in items: - scores += 1 - if 'radialmenu' in items: - scores += 2 - if 'dso' in items: - scores += 1 - if 'inlinecpp' in items: - scores += 1 - if 'otls' in items: - scores += 2 - if 'help' in items: - scores += 1 - if 'python_panels' in items: - scores += 2 - if 'scripts' in items: - scores += 1 - if 'toolbar' in items: - scores += 1 - if 'ocl' in items: - scores += 1 - if 'vex' in items: - scores += 2 - if 'vop' in items: - scores += 2 - if 'python2.7libs' in items: - scores += 1 - if 'python3.7libs' in items: - scores += 1 - if 'viewer_states' in items: - scores += 2 - for item in items: - if item.endswith('.xml') and item.split('.')[0] in XML_NAMES: - scores += 2 - if 'OPcustomize' in items: - scores += 2 - if 'Expressions.txt' in items: - scores += 1 - if 'VEXpressions.txt' in items: - scores += 2 - if 'PythonScripts.txt' in items: - scores += 1 - return scores >= level - - def isPackageFolder(path): if not os.path.isdir(path): return None @@ -172,7 +83,7 @@ def __init__(self, package_file): self.hversion = data.get(u'hversion') self.hlicense = fullHoudiniLicenseName(data.get(u'hlicense')) self.status = fullPackageStatusName(data.get(u'status')) - self.setup_scheme = data.get(u'setup_scheme') + self.setup_schema = data.get(u'setup_schema') def files(self, extensions, root='', ignore_folders=True, recursive=False): if not os.path.isdir(self.content_path): diff --git a/python2.7libs/package_manager/main_window.py b/python2.7libs/package_manager/main_window.py index dd14b51..2a0265c 100644 --- a/python2.7libs/package_manager/main_window.py +++ b/python2.7libs/package_manager/main_window.py @@ -95,10 +95,10 @@ def __init__(self, parent=None): main_layout.addLayout(self.stack_layout) # Local - local = QWidget() - self.stack_layout.addWidget(local) + local_widget = QWidget() + self.stack_layout.addWidget(local_widget) - local_layout = QVBoxLayout(local) + local_layout = QVBoxLayout(local_widget) local_layout.setContentsMargins(0, 0, 0, 0) local_layout.setSpacing(0) @@ -142,10 +142,10 @@ def __init__(self, parent=None): self.package_content_tabs.addTab(panel_list_view, 'Python Panels') # Web - web = QWidget() - self.stack_layout.addWidget(web) + web_widget = QWidget() + self.stack_layout.addWidget(web_widget) - web_layout = QVBoxLayout(web) + web_layout = QVBoxLayout(web_widget) web_layout.setContentsMargins(0, 0, 0, 0) web_layout.setSpacing(0) @@ -211,5 +211,5 @@ def _setCurrentWebPackage(self, index): self.current_web_package = web_package self.updateWebContentSource() - def switchMode(self, button_id): - self.stack_layout.setCurrentIndex(button_id) + def switchMode(self, mode_id): + self.stack_layout.setCurrentIndex(mode_id) diff --git a/python2.7libs/package_manager/package.py b/python2.7libs/package_manager/package.py index 7d0c855..39a7d72 100644 --- a/python2.7libs/package_manager/package.py +++ b/python2.7libs/package_manager/package.py @@ -1,2 +1,96 @@ +from __future__ import print_function + + class Package(object): pass + + +def isPackage(items, level=2): + XML_NAMES = ('AnimationEditorDopesheetContextMenu', + 'AnimationEditorDopesheetMenu', + 'AnimationEditorGraphContextMenu', + 'AnimationEditorGraphMenu', + 'AnimationEditorMenu', + 'AnimationEditorTableContextMenu', + 'AnimationEditorTableMenu', + 'ChannelListMenu', + 'CHGmenu', + 'DesktopsMenu', + 'ExampleMenu', + 'GEOclassicXlate', + 'KeyframesMenu', + 'MainMenuARecord', + 'MainMenuCommon', + 'MainMenuEscape', + 'MainMenuGPlay', + 'MainMenuHKey', + 'MainMenuHOTLView', + 'MainMenuMaster', + 'MainMenuMPlay', + 'MainMenuPDG', + 'MotionEffectsMenu', + 'NetworkViewMenu', + 'NetworkViewMenuPDG', + 'NetworkViewMenuTOP', + 'OPmenu', + 'PaneTabTypeMenu', + 'PaneTabTypeMenuPDG', + 'ParmGearMenu', + 'PARMmenu', + 'PlaybarMenu', + 'ShelfMenu', + 'ShelfSetMenu', + 'ShelfSetPlusMenu', + 'ShelfToolMenu', + 'TakeListMenu', + 'UsdStagePrimMenu', + 'VOPFXmenu') + scores = 0 + if 'bin' in items: + scores += 1 + if 'config' in items: + scores += 1 + if 'presets' in items: + scores += 1 + if 'desktop' in items: + scores += 1 + if 'radialmenu' in items: + scores += 2 + if 'dso' in items: + scores += 1 + if 'inlinecpp' in items: + scores += 1 + if 'otls' in items: + scores += 2 + if 'help' in items: + scores += 1 + if 'python_panels' in items: + scores += 2 + if 'scripts' in items: + scores += 1 + if 'toolbar' in items: + scores += 1 + if 'ocl' in items: + scores += 1 + if 'vex' in items: + scores += 2 + if 'vop' in items: + scores += 2 + if 'python2.7libs' in items: + scores += 1 + if 'python3.7libs' in items: + scores += 1 + if 'viewer_states' in items: + scores += 2 + for item in items: + if item.endswith('.xml') and item.split('.')[0] in XML_NAMES: + scores += 2 + if 'OPcustomize' in items: + scores += 2 + if 'Expressions.txt' in items: + scores += 1 + if 'VEXpressions.txt' in items: + scores += 2 + if 'PythonScripts.txt' in items: + scores += 1 + return scores >= level diff --git a/python2.7libs/package_manager/package_content.py b/python2.7libs/package_manager/package_content.py index 15dc5f8..dae2c8f 100644 --- a/python2.7libs/package_manager/package_content.py +++ b/python2.7libs/package_manager/package_content.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * diff --git a/python2.7libs/package_manager/package_list.py b/python2.7libs/package_manager/package_list.py index 4310267..05a28ed 100644 --- a/python2.7libs/package_manager/package_list.py +++ b/python2.7libs/package_manager/package_list.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * diff --git a/python2.7libs/package_manager/package_status.py b/python2.7libs/package_manager/package_status.py index 98f1275..f4ff0b7 100644 --- a/python2.7libs/package_manager/package_status.py +++ b/python2.7libs/package_manager/package_status.py @@ -1,3 +1,5 @@ +from __future__ import print_function + DEVELOPMENT = 0 PROTOTYPE = 1 ALPHA = 2 diff --git a/python2.7libs/package_manager/path_text.py b/python2.7libs/package_manager/path_text.py index 8e3cc6e..0ac3e93 100644 --- a/python2.7libs/package_manager/path_text.py +++ b/python2.7libs/package_manager/path_text.py @@ -1,5 +1,7 @@ # encoding: utf-8 +from __future__ import print_function + import math import os diff --git a/python2.7libs/package_manager/settings.py b/python2.7libs/package_manager/settings.py index 5571de4..084997a 100644 --- a/python2.7libs/package_manager/settings.py +++ b/python2.7libs/package_manager/settings.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * diff --git a/python2.7libs/package_manager/shelves.py b/python2.7libs/package_manager/shelves.py index 612d99d..083f49c 100644 --- a/python2.7libs/package_manager/shelves.py +++ b/python2.7libs/package_manager/shelves.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from lxml import etree diff --git a/python2.7libs/package_manager/update.py b/python2.7libs/package_manager/update.py index 0c7b265..824c2d2 100644 --- a/python2.7libs/package_manager/update.py +++ b/python2.7libs/package_manager/update.py @@ -1,14 +1,17 @@ +from __future__ import print_function + import json +from time import time from .local_package import findInstalledPackages, LocalPackage from . import github from .update_dialog import UpdateDialog -from .web_package import WebPackage from .update_options import UpdateOptions +from .web_package import WebPackage -def hasUpdate(package): - only_stable = UpdateOptions().onlyStableForPackage(package) +def hasUpdate(package, only_stable=None): + only_stable = only_stable or UpdateOptions().onlyStableForPackage(package) if package.source_type == 'github': return github.repoHasUpdate(package.source, package.version, package.version_type, only_stable) @@ -41,3 +44,5 @@ def checkForUpdates(ignore_options=False): for package in packages: if package in checked: updatePackage(package) + + UpdateOptions().setLastCheckTime(time()) diff --git a/python2.7libs/package_manager/update_dialog.py b/python2.7libs/package_manager/update_dialog.py index 7b48556..e72e155 100644 --- a/python2.7libs/package_manager/update_dialog.py +++ b/python2.7libs/package_manager/update_dialog.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * @@ -72,7 +74,6 @@ def __init__(self, parent=None): buttons_layout.addWidget(update_button) skip_button = QPushButton('Skip Updating') - skip_button.setToolTip('Skipidi-pa-pa') skip_button.clicked.connect(self.reject) buttons_layout.addWidget(skip_button) @@ -84,10 +85,17 @@ def _setCurrentPackage(self, index): self.current_version_label.setText(package.version) if package.source_type == 'github': releases_api_url = 'https://api.github.com/repos/{0}/{1}/releases'.format(*github.ownerAndRepoName(package.source)) - last_version_data = github.GitHubAPICache.get(releases_api_url)[0] - new_version = last_version_data['tag_name'] + releases_data = github.API.get(releases_api_url) + if releases_data: + last_version_data = releases_data[0] + new_version = last_version_data['tag_name'] + changes = last_version_data['body'] + else: + repo_api_url = 'https://api.github.com/repos/{0}/{1}'.format(*github.ownerAndRepoName(package.source)) + repo_data = github.API.get(repo_api_url) + new_version = repo_data['pushed_at'] + changes = '' self.new_version_label.setText(new_version) - changes = last_version_data['body'] self.update_changes_label.setText(changes) def setPackageList(self, packages): diff --git a/python2.7libs/package_manager/update_list.py b/python2.7libs/package_manager/update_list.py index e82f217..a28e5fa 100644 --- a/python2.7libs/package_manager/update_list.py +++ b/python2.7libs/package_manager/update_list.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import json from operator import itemgetter diff --git a/python2.7libs/package_manager/update_options.py b/python2.7libs/package_manager/update_options.py index 2e71b5c..8b6c313 100644 --- a/python2.7libs/package_manager/update_options.py +++ b/python2.7libs/package_manager/update_options.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import json try: diff --git a/python2.7libs/package_manager/version.py b/python2.7libs/package_manager/version.py index dccd552..b99fa93 100644 --- a/python2.7libs/package_manager/version.py +++ b/python2.7libs/package_manager/version.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import re diff --git a/python2.7libs/package_manager/version_dialog.py b/python2.7libs/package_manager/version_dialog.py index 21fa8b7..3568662 100644 --- a/python2.7libs/package_manager/version_dialog.py +++ b/python2.7libs/package_manager/version_dialog.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * diff --git a/python2.7libs/package_manager/web_package.py b/python2.7libs/package_manager/web_package.py index a35ab55..b625ef9 100644 --- a/python2.7libs/package_manager/web_package.py +++ b/python2.7libs/package_manager/web_package.py @@ -1,9 +1,11 @@ +from __future__ import print_function + from .package import Package class WebPackage(Package): def __init__(self, name=None, description=None, author=None, source=None, source_type=None, - hversion=None, hlicense=None, status=None, setup_scheme=None): + hversion=None, hlicense=None, status=None, setup_schema=None): self.name = name self.description = description self.author = author @@ -16,4 +18,4 @@ def __init__(self, name=None, description=None, author=None, source=None, source self.status = status - self.setup_scheme = setup_scheme + self.setup_schema = setup_schema diff --git a/python2.7libs/package_manager/web_package_content.py b/python2.7libs/package_manager/web_package_content.py index f6bfbd5..a76bf74 100644 --- a/python2.7libs/package_manager/web_package_content.py +++ b/python2.7libs/package_manager/web_package_content.py @@ -1,3 +1,5 @@ +from __future__ import print_function + try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * diff --git a/python2.7libs/package_manager/web_package_list.py b/python2.7libs/package_manager/web_package_list.py index 2184535..cfb54bc 100644 --- a/python2.7libs/package_manager/web_package_list.py +++ b/python2.7libs/package_manager/web_package_list.py @@ -52,7 +52,7 @@ def updateData(self, packages=None): package_data.get('hversion'), package_data.get('hlicense'), package_data.get('status'), - package_data.get('setup_scheme') + package_data.get('setup_schema') )) self.__data = tuple(items) self.endResetModel() diff --git a/python2.7libs/pythonrc.py b/python2.7libs/pythonrc.py index 25de012..026cd7e 100644 --- a/python2.7libs/pythonrc.py +++ b/python2.7libs/pythonrc.py @@ -1,3 +1,5 @@ +from __future__ import print_function + if hou.isUIAvailable(): from time import time @@ -5,7 +7,6 @@ options = UpdateOptions() current_time = time() - # It should be over 2 hours since the last check. - if options.checkOnStartup() and current_time - options.lastCheckTime() > 7200: + # It should be over 4 hours since the last check. + if options.checkOnStartup() and current_time - options.lastCheckTime() > 14400: checkForUpdates() - options.setLastCheckTime(current_time)