Permalink
Browse files

updated PubNub Python Real-time Cloud-Hosted Service API with optiona…

…l Origin Init Parameter.
  • Loading branch information...
1 parent ff6bc1e commit 05f88361b9e9e77df8a06b52b711bcf945dcbf79 @stephenlb stephenlb committed Jan 28, 2011
Showing with 9 additions and 5 deletions.
  1. +4 −2 google-app-engine/python/Pubnub.py
  2. +5 −3 python/Pubnub.py
@@ -22,7 +22,8 @@ def __init__(
publish_key,
subscribe_key,
secret_key = False,
- ssl_on = False
+ ssl_on = False,
+ origin = 'pubsub.pubnub.com'
) :
"""
#**
@@ -34,13 +35,14 @@ def __init__(
#* @param string subscribe_key required key to receive messages.
#* @param string secret_key required key to sign messages.
#* @param boolean ssl required for 2048 bit encrypted messages.
+ #* @param string origin PUBNUB Server Origin.
#**
## Initiat Class
pubnub = Pubnub( 'PUBLISH-KEY', 'SUBSCRIBE-KEY', 'SECRET-KEY', False )
"""
- self.origin = 'pubsub.pubnub.com'
+ self.origin = origin
self.limit = 1800
self.publish_key = publish_key
self.subscribe_key = subscribe_key
View
@@ -20,7 +20,8 @@ def __init__(
publish_key,
subscribe_key,
secret_key = False,
- ssl_on = False
+ ssl_on = False,
+ origin = 'pubsub.pubnub.com'
) :
"""
#**
@@ -32,13 +33,14 @@ def __init__(
#* @param string subscribe_key required key to receive messages.
#* @param string secret_key required key to sign messages.
#* @param boolean ssl required for 2048 bit encrypted messages.
+ #* @param string origin PUBNUB Server Origin.
#**
## Initiat Class
pubnub = Pubnub( 'PUBLISH-KEY', 'SUBSCRIBE-KEY', 'SECRET-KEY', False )
"""
- self.origin = 'pubsub.pubnub.com'
+ self.origin = origin
self.limit = 1800
self.publish_key = publish_key
self.subscribe_key = subscribe_key
@@ -216,6 +218,7 @@ def history( self, args ) :
str(limit)
]);
+ def time(self) :
"""
#**
#* Time
@@ -230,7 +233,6 @@ def history( self, args ) :
print(timestamp)
"""
- def time(self) :
return self._request([
'time',
'0'

0 comments on commit 05f8836

Please sign in to comment.