Skip to content

Commit

Permalink
0.4 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Titov committed Apr 15, 2020
1 parent 3522bed commit 5f6bac5
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 52 deletions.
2 changes: 1 addition & 1 deletion package.setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Package Manager",
"author": "Ivan Titov",
"version": "0.3-beta",
"version": "0.4-beta",
"source": "Houdini-Packages/Houdini-Package-Manager",
"source_type": "github"
}
4 changes: 2 additions & 2 deletions python2.7libs/package_manager/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def installFromGitHubRepo(web_package_or_link, dst_location='$HOUDINI_USER_PREF_
api_releases_url = api_repo_url + '/releases'
versions = []
for release_data in GitHubAPICache.get(api_releases_url):
if not release_data['prerelease']:
versions.append(Version(release_data['tag_name']))
# if not release_data['prerelease']:
versions.append(Version(release_data['tag_name']))
if versions:
version_type = 'version'
else:
Expand Down
38 changes: 38 additions & 0 deletions python2.7libs/package_manager/new_version_dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
try:
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
except ImportError:
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from PySide2.QtCore import *


class NewVersionDialog(QDialog):
def __init__(self, parent=None):
super(NewVersionDialog, self).__init__(parent)

self.setWindowTitle('New version')

layout = QFormLayout(self)
layout.setContentsMargins(4, 4, 4, 4)
layout.setSpacing(4)

self.current_version_label = QLabel()
layout.addRow('Current version', self.current_version_label)

self.next_version_label = QLabel()
layout.addRow('Next version', self.next_version_label)

self.update_info_label = QLabel()
layout.addRow('Info', self.update_info_label)

# Data
self.__package = None

def updateFromCurrentPackage(self):
pass

@classmethod
def getUserChoice(cls):
pass
4 changes: 2 additions & 2 deletions python2.7libs/package_manager/path_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def truncateMid(value, length):
return '…'

mid = (length - 1) / 2
pre = value[:math.floor(mid)]
post = value[len(value) - math.ceil(mid):]
pre = value[:int(mid)]
post = value[int(len(value) - math.ceil(mid)):]

return '{}…{}'.format(pre, post)

Expand Down
16 changes: 16 additions & 0 deletions python2.7libs/package_manager/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from .local_package import findInstalledPackages
from .github import installFromGitHubRepo
from .new_version_dialog import NewVersionDialog


def checkForUpdates():
dialog = NewVersionDialog()
packages = []
for package in findInstalledPackages():
if package.source and package.version:
if package.source_type == 'github':
if package.hasUpdates():
packages.append(package)
if packages:
dialog.setPackageList(packages)
dialog.exec_()
Loading

0 comments on commit 5f6bac5

Please sign in to comment.