Commit 3cc87909 authored by hupantingxue's avatar hupantingxue

Update setup scripts;

parent 3380379e
......@@ -2,7 +2,7 @@ import json
import logging
BASE_URL = "https://api.jpush.cn/"
BASE_URL = "https://api.jpush.cn:15088/"
PUSH_URL = BASE_URL + 'v3/push/'
logger = logging.getLogger('jpush')
......
......@@ -22,7 +22,12 @@ def audience(*children):
"""Select audience that match all of the given selectors.
>>> audience(tag('sports'), tag_and('business'))
{'audience': {'tag': 'sports'}, {'tag_and': 'business'}}
{'audience': {'tag':'sports', 'tag_and':'business'}}
"""
return {"audience": [child for child in children]}
if len(types) == 1 and types[0] == 'all':
return {'audience':'all'}
for t in types:
if t not in ('tag', 'tag_and', 'alias', 'registration_id'):
raise ValueError("Invalid platform '%s'" % t)
return [t for t in types]
......@@ -9,7 +9,7 @@ class Push(object):
"""A push notification. Set audience, message, etc, and send."""
def __init__(self, jpush):
self._jpush = jpush
self._jpush = jpush
self.audience = None
self.notification = None
self.platform = None
......
# -*- coding: utf-8 -*-
from setuptools import setup
try:
from setuptools import setup
except (ImportError):
from distutils.core import setup
from jpush import __version__
setup(
name='jpush',
version=__version__,
......@@ -17,7 +18,7 @@ setup(
author='hupantingxue',
author_email='hupantingxue@126.com',
packages=['jpush'],
packages=['jpush', 'jpush.push'],
platforms='any',
classifiers=[
'Environment :: Console',
......@@ -26,4 +27,8 @@ setup(
'Operating System :: OS Independent',
'Programming Language :: Python',
],
install_requires=[
'requests>=1.2',
],
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment