Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
F483 committed Aug 15, 2015
1 parent 0640d64 commit 47baec0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 58 deletions.
Empty file added __init__.py
Empty file.
1 change: 1 addition & 0 deletions build_windows_dist.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python setup.py py2exe
2 changes: 1 addition & 1 deletion dataserv_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.1"
__version__ = "1.3.0"
14 changes: 8 additions & 6 deletions dataserv_client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ def version(self):
print(__version__)
return __version__

def _querry(self, api_call, retries=0):
def _url_query(self, api_call, retries=0):
try:
if self.debug:
print("Query url: " + self.url + api_call)
response = urllib.request.urlopen(self.url + api_call)
if response.code == 200:
return True
Expand All @@ -84,12 +86,12 @@ def _querry(self, api_call, retries=0):
if retries >= self.connection_retry_limit:
raise exceptions.ConnectionError(self.url)
time.sleep(self.connection_retry_delay)
return self._querry(api_call, retries + 1)
return self._url_query(api_call, retries + 1)

def register(self):
"""Attempt to register the config address."""
self._ensure_address_given()
registered = self._querry("/api/register/{0}".format(self.address))
registered = self._url_query("/api/register/{0}".format(self.address))
if registered:
print("Address {0} now registered on {1}.".format(self.address,
self.url))
Expand All @@ -99,7 +101,7 @@ def ping(self):
"""Attempt keep-alive with the server."""
self._ensure_address_given()
print("Pinging {0} with address {1}.".format(self.url, self.address))
return self._querry("/api/ping/{0}".format(self.address))
return self._url_query("/api/ping/{0}".format(self.address))

def poll(self, register_address=False, delay=common.DEFAULT_DELAY,
limit=None):
Expand All @@ -121,11 +123,11 @@ def build(self, cleanup=False, rebuild=False):
"""TODO doc string"""
self._ensure_address_given()
def on_generate_shard(height, seed, file_hash):
self._querry('/api/height/{0}/{1}'.format(self.address, height))
self._url_query('/api/height/{0}/{1}'.format(self.address, height))
bldr = builder.Builder(self.address, common.SHARD_SIZE, self.max_size,
on_generate_shard=on_generate_shard)
generated = bldr.build(self.store_path, debug=self.debug,
cleanup=cleanup, rebuild=rebuild)
height = len(generated)
self._querry('/api/height/{0}/{1}'.format(self.address, height))
self._url_query('/api/height/{0}/{1}'.format(self.address, height))
return generated
67 changes: 16 additions & 51 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#!/usr/bin/env python
# coding: utf-8


import os
# import sys
# from esky.bdist_esky import Executable
from setuptools import setup, find_packages


VERSION = "1.2.1" # FIXME get from module
if os.name == 'nt': # windows
import py2exe # manual dependencie :/


VERSION = "1.3.0" # FIXME get from module
SCRIPT = os.path.join('dataserv_client', 'bin', 'dataserv-client')
DOWNLOAD_URL = "%(baseurl)s/%(name)s/%(name)s-%(version)s.tar.gz" % {
'baseurl': "https://pypi.python.org/packages/source/a",
Expand All @@ -13,53 +19,6 @@
}


# FIXME get autoupdate with esky working
## windows
# if sys.platform in ['win32', 'cygwin', 'win64']:
# icon = os.path.join(sys.prefix, "DLLs", "py.ico")
# script = Executable(SCRIPT, icon=icon, gui_only=False)
# options = {
# "bdist_esky": {
# "includes": [], # include modules
# "excludes": ["pydoc"], # exclude modules
# "freezer_module": "py2exe",
# #"freezer_module": "cx_Freeze",
# }
# }
#
#
## mac (untested)
# if sys.platform == 'darwin':
# script = Executable(SCRIPT)
# options = {
# "bdist_esky": {
# "includes": [], # include modules
# "excludes": ["pydoc"], # exclude modules
# "freezer_module": "py2app",
# "freezer_options": {
# "plist": {
# #"LSUIElement" : True,
# #'CFBundleIdentifier': 'de.cloudmatrix.esky',
# #'CFBundleIconFile' : 'images/box.icns',
# }
# },
# }
# }
#
#
## linux
# if sys.platform in ['linux', 'linux2']:
# script = Executable(SCRIPT)
# options = {
# "bdist_esky": {
# "includes": [], # include modules
# "excludes": ["pydoc"], # exclude modules
# "freezer_module": "bbfreeze", # FIXME unmaintained only python 2
# # "freezer_module": "cx_Freeze", # FIXME pip install fails
# }
# }


setup(
app=[SCRIPT],
name='dataserv-client',
Expand All @@ -72,12 +31,12 @@
license="MIT",
version=VERSION,
scripts=[SCRIPT], # FIXME esky scripts=[script],
# FIXME esky options=options,
console=[SCRIPT],
data_files=[],
test_suite="tests",
install_requires=[
'RandomIO == 0.2.1',
'partialhash == 1.1.0',
'future == 0.15.0', # for python 2.7 support
],
tests_require=[
Expand All @@ -103,4 +62,10 @@
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries :: Python Modules",
],

# py2exe
options = {'py2exe': {
"optimize": 2,
"bundle_files": 2, # This tells py2exe to bundle everything
}}
)

0 comments on commit 47baec0

Please sign in to comment.