From b5311dd1c3fe12f16c8cae10277a1354e57195f9 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Fri, 14 Oct 2016 23:01:15 -0400
Subject: [PATCH 1/6] fix DaemonRequest import in apps

---
 packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py    | 3 ++-
 packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py | 6 ++++--
 packaging/osx/lbry-osx-app/setup_app.py          | 3 +--
 packaging/osx/lbry-osx-app/setup_uri_handler.py  | 3 ++-
 packaging/windows/lbry-win32-app/LBRYWin32App.py | 3 ++-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py
index 072eb9f00..c690023d9 100644
--- a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py
+++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py
@@ -27,7 +27,8 @@ if not os.path.isfile(lbrycrdd_path_conf):
     f.write(lbrycrdd_path)
     f.close()
 
-from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer, DaemonRequest
+from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer
+from lbrynet.lbrynet_daemon.DaemonRequest import DaemonRequest
 from lbrynet.conf import API_PORT, API_INTERFACE, ICON_PATH, APP_NAME
 from lbrynet.conf import UI_ADDRESS
 
diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py
index d4a88e7ce..82df8bc38 100644
--- a/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py
+++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYNotify.py
@@ -1,10 +1,10 @@
 import Foundation
 import objc
-import AppKit
 
 NSUserNotification = objc.lookUpClass('NSUserNotification')
 NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
 
+
 def LBRYNotify(message):
     notification = NSUserNotification.alloc().init()
     notification.setTitle_("LBRY")
@@ -15,7 +15,9 @@ def LBRYNotify(message):
     notification.setDeliveryDate_(Foundation.NSDate.dateWithTimeInterval_sinceDate_(0, Foundation.NSDate.date()))
     NSUserNotificationCenter.defaultUserNotificationCenter().scheduleNotification_(notification)
 
-def notify(title, subtitle, info_text, delay=0, sound=False, userInfo={}):
+
+def notify(title, subtitle, info_text, delay=0, sound=False, userInfo=None):
+    userInfo = userInfo or {}
     notification = NSUserNotification.alloc().init()
     notification.setTitle_(title)
     notification.setSubtitle_(subtitle)
diff --git a/packaging/osx/lbry-osx-app/setup_app.py b/packaging/osx/lbry-osx-app/setup_app.py
index 28e0ca981..1f4cba717 100644
--- a/packaging/osx/lbry-osx-app/setup_app.py
+++ b/packaging/osx/lbry-osx-app/setup_app.py
@@ -2,8 +2,7 @@
 
 import os
 from setuptools import setup
-from lbrynet.conf import PROTOCOL_PREFIX, APP_NAME, ICON_PATH
-import sys
+from lbrynet.conf import APP_NAME, ICON_PATH
 
 APP = [os.path.join('lbrygui', 'main.py')]
 DATA_FILES = []
diff --git a/packaging/osx/lbry-osx-app/setup_uri_handler.py b/packaging/osx/lbry-osx-app/setup_uri_handler.py
index 26097d8a4..21b2050a9 100644
--- a/packaging/osx/lbry-osx-app/setup_uri_handler.py
+++ b/packaging/osx/lbry-osx-app/setup_uri_handler.py
@@ -1,5 +1,6 @@
 from setuptools import setup
 import os
+from lbrynet.conf import PROTOCOL_PREFIX
 
 APP = [os.path.join('lbry_uri_handler', 'LBRYURIHandler.py')]
 DATA_FILES = []
@@ -11,7 +12,7 @@ OPTIONS = {'argv_emulation': True,
                'CFBundleURLTypes': [
                     {
                     'CFBundleURLTypes': 'LBRYURIHandler',
-                    'CFBundleURLSchemes': ['lbry']
+                    'CFBundleURLSchemes': [PROTOCOL_PREFIX]
                     }
                ]
            }
diff --git a/packaging/windows/lbry-win32-app/LBRYWin32App.py b/packaging/windows/lbry-win32-app/LBRYWin32App.py
index d197f8cfc..1a35e29b4 100644
--- a/packaging/windows/lbry-win32-app/LBRYWin32App.py
+++ b/packaging/windows/lbry-win32-app/LBRYWin32App.py
@@ -18,7 +18,8 @@ try:
 except ImportError:
     import win32gui
 
-from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer, DaemonRequest
+from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer
+from lbrynet.lbrynet_daemon.DaemonRequest import DaemonRequest
 from lbrynet.conf import API_PORT, API_INTERFACE, ICON_PATH, APP_NAME
 from lbrynet.conf import UI_ADDRESS, API_CONNECTION_STRING, LOG_FILE_NAME
 from packaging.uri_handler.LBRYURIHandler import LBRYURIHandler

From ea1f260ed97273c10d4358668af23312803b9a69 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Fri, 14 Oct 2016 23:06:03 -0400
Subject: [PATCH 2/6] =?UTF-8?q?Bump=20version:=200.6.4=20=E2=86=92=200.6.5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .bumpversion.cfg              | 2 +-
 lbrynet/__init__.py           | 2 +-
 packaging/ubuntu/lbry.desktop | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 485a52eea..ac20d27df 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.6.4
+current_version = 0.6.5
 commit = True
 tag = True
 
diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py
index 87f99d259..9fa85e14e 100644
--- a/lbrynet/__init__.py
+++ b/lbrynet/__init__.py
@@ -1,6 +1,6 @@
 import logging
 
-__version__ = "0.6.4"
+__version__ = "0.6.5"
 version = tuple(__version__.split('.'))
 
 logging.getLogger(__name__).addHandler(logging.NullHandler())
\ No newline at end of file
diff --git a/packaging/ubuntu/lbry.desktop b/packaging/ubuntu/lbry.desktop
index 52abc16cf..1e3ff5591 100644
--- a/packaging/ubuntu/lbry.desktop
+++ b/packaging/ubuntu/lbry.desktop
@@ -1,5 +1,5 @@
 [Desktop Entry]
-Version=0.6.4
+Version=0.6.5
 Name=LBRY
 Comment=The world's first user-owned content marketplace
 Icon=lbry

From 830f5ff6e3862bf6833d6379820bf68a1c4fcac1 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Sat, 15 Oct 2016 23:35:17 -0400
Subject: [PATCH 3/6] =?UTF-8?q?Bump=20version:=200.6.5=20=E2=86=92=200.6.6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .bumpversion.cfg              | 2 +-
 lbrynet/__init__.py           | 2 +-
 packaging/ubuntu/lbry.desktop | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index ac20d27df..8d50ae1bb 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.6.5
+current_version = 0.6.6
 commit = True
 tag = True
 
diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py
index 9fa85e14e..ff3163df2 100644
--- a/lbrynet/__init__.py
+++ b/lbrynet/__init__.py
@@ -1,6 +1,6 @@
 import logging
 
-__version__ = "0.6.5"
+__version__ = "0.6.6"
 version = tuple(__version__.split('.'))
 
 logging.getLogger(__name__).addHandler(logging.NullHandler())
\ No newline at end of file
diff --git a/packaging/ubuntu/lbry.desktop b/packaging/ubuntu/lbry.desktop
index 1e3ff5591..35b50b088 100644
--- a/packaging/ubuntu/lbry.desktop
+++ b/packaging/ubuntu/lbry.desktop
@@ -1,5 +1,5 @@
 [Desktop Entry]
-Version=0.6.5
+Version=0.6.6
 Name=LBRY
 Comment=The world's first user-owned content marketplace
 Icon=lbry

From 5b15da2c5531a031d7158da0d0604afb8c1b5fd4 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Sun, 16 Oct 2016 00:29:32 -0400
Subject: [PATCH 4/6] add jsonschema to windows build

---
 packaging/windows/init.ps1 | 2 ++
 setup.py                   | 1 +
 2 files changed, 3 insertions(+)

diff --git a/packaging/windows/init.ps1 b/packaging/windows/init.ps1
index 887b78d0a..37be0343c 100644
--- a/packaging/windows/init.ps1
+++ b/packaging/windows/init.ps1
@@ -90,6 +90,8 @@ C:\Python27\Scripts\pip.exe install base58==0.2.2
 
 C:\Python27\Scripts\pip.exe install googlefinance==0.7
 
+C:\Python27\Scripts\pip.exe install jsonschema==2.5.1
+
 C:\Python27\Scripts\pip.exe install git+https://github.com/lbryio/lbryum.git
 
 cd C:\projects\lbry
diff --git a/setup.py b/setup.py
index c93a67812..b35efc968 100644
--- a/setup.py
+++ b/setup.py
@@ -268,6 +268,7 @@ elif platform == WINDOWS:
                      'requests_futures',
                      'seccure',
                      'simplejson',
+                     'jsonschema',
                      'six',
                      'aes',
                      'txjsonrpc',

From 62c253947563a7652a396ea3ddf84d2bee089135 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Sun, 16 Oct 2016 02:49:19 -0400
Subject: [PATCH 5/6] include jsonschema.schemas files

---
 setup.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index b35efc968..353200305 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
 
 import sys
 import os
+import site
 from lbrynet import __version__
 
 LINUX = 1
@@ -134,6 +135,10 @@ elif platform == WINDOWS:
     # Allow virtualenv to find distutils of base python installation
     distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
 
+    schemas = os.path.join(site.getsitepackages()[1], "jsonschema", "schemas")
+    onlyfiles = [f for f in os.listdir(schemas) if os.path.isfile(os.path.join(schemas, f))]
+    zipincludes = [(os.path.join(schemas, f), os.path.join("jsonschema", "schemas", f)) for f in onlyfiles]
+
     def find_data_file(filename):
         if getattr(sys, 'frozen', False):
             # The application is frozen
@@ -292,7 +297,8 @@ elif platform == WINDOWS:
                           (os.path.join(wordlist_path, 'portuguese.txt'), os.path.join('wordlist', 'portuguese.txt')),
                           (os.path.join(wordlist_path, 'spanish.txt'), os.path.join('wordlist', 'spanish.txt'))
                           ],
-        'namespace_packages': ['zope', 'google']}
+        'namespace_packages': ['zope', 'google'],
+        "zip_includes": zipincludes}
 
     tray_app = Executable(
         script=os.path.join(app_dir, 'LBRYWin32App.py'),

From 733bb3bccf1ee6bd452e46f938eb676f6466f409 Mon Sep 17 00:00:00 2001
From: Jack <jack@lbry.io>
Date: Sun, 16 Oct 2016 02:55:14 -0400
Subject: [PATCH 6/6] =?UTF-8?q?Bump=20version:=200.6.6=20=E2=86=92=200.6.7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .bumpversion.cfg              | 2 +-
 lbrynet/__init__.py           | 2 +-
 packaging/ubuntu/lbry.desktop | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 8d50ae1bb..aaf3ca8b9 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.6.6
+current_version = 0.6.7
 commit = True
 tag = True
 
diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py
index ff3163df2..803b4819d 100644
--- a/lbrynet/__init__.py
+++ b/lbrynet/__init__.py
@@ -1,6 +1,6 @@
 import logging
 
-__version__ = "0.6.6"
+__version__ = "0.6.7"
 version = tuple(__version__.split('.'))
 
 logging.getLogger(__name__).addHandler(logging.NullHandler())
\ No newline at end of file
diff --git a/packaging/ubuntu/lbry.desktop b/packaging/ubuntu/lbry.desktop
index 35b50b088..64642dd4b 100644
--- a/packaging/ubuntu/lbry.desktop
+++ b/packaging/ubuntu/lbry.desktop
@@ -1,5 +1,5 @@
 [Desktop Entry]
-Version=0.6.6
+Version=0.6.7
 Name=LBRY
 Comment=The world's first user-owned content marketplace
 Icon=lbry