aboutsummaryrefslogtreecommitdiffstats
path: root/python-twisted/examples/uuid-example.py
blob: 94840e0d8070338717b9e33adbfcf22d31e8cd70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## www.pubnub.com - PubNub Real-time push service in the cloud. 
# coding=utf8

## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/

## -----------------------------------
## PubNub 3.1 Real-time Push Cloud API
## -----------------------------------

import sys
from twisted.internet import reactor
sys.path.append('../')
from Pubnub import Pubnub

## -----------------------------------------------------------------------
## Initiate Pubnub State
## -----------------------------------------------------------------------
pubnub = Pubnub( "", "", "", False )

## -----------------------------------------------------------------------
## UUID Example
## -----------------------------------------------------------------------

uuid = pubnub.uuid()
print "UUID: "
print uuid
span>resolved_formulae.each do |f| # Cannot test uninstalled formulae unless f.installed? ofail "Testing requires the latest version of #{f.full_name}" next end # Cannot test formulae without a test method unless f.test_defined? ofail "#{f.full_name} defines no test" next end puts "Testing #{f.full_name}" env = ENV.to_hash begin args = %W[ #{RUBY_PATH} -W0 -I #{HOMEBREW_LOAD_PATH} -- #{HOMEBREW_LIBRARY_PATH}/test.rb #{f.path} ].concat(ARGV.options_only) if f.head? args << "--HEAD" elsif f.devel? args << "--devel" end Sandbox.print_sandbox_message if Sandbox.test? Utils.safe_fork do if Sandbox.test? sandbox = Sandbox.new f.logs.mkpath sandbox.record_log(f.logs/"test.sandbox.log") sandbox.allow_write_temp_and_cache sandbox.allow_write_log(f) sandbox.allow_write_xcode sandbox.allow_write_path(HOMEBREW_PREFIX/"var/cache") sandbox.allow_write_path(HOMEBREW_PREFIX/"var/log") sandbox.allow_write_path(HOMEBREW_PREFIX/"var/run") sandbox.exec(*args) else exec(*args) end end rescue Assertions::FailedAssertion => e ofail "#{f.full_name}: failed" puts e.message rescue Exception => e ofail "#{f.full_name}: failed" puts e, e.backtrace ensure ENV.replace(env) end end end end