Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rackspace/python-cloudfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
notmyname committed Feb 25, 2011
2 parents 11f3cd1 + 0c5f6e4 commit f9dc679
Show file tree
Hide file tree
Showing 66 changed files with 779 additions and 872 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2011-02-24 Conrad Weidenkeller <[email protected]>
* 1.7.9:
- Added Container Level and Object Level Edge purge functionality
2011-02-16 Chmouel Boudjnah <[email protected]>
* 1.7.8:
- setup.py: call package python-cloudfiles for pypi.

2011-01-27 Chmouel Boudjnah <[email protected]>
* 1.7.7:
- fixed error where get_objects with a delimiter would error (John).
Expand Down
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include COPYING
include ChangeLog
include cloudfiles/*.py
include COPYING
graft docs
include epydoc.conf
include setup.py
graft tests
exclude python_cloudfiles.egg-info
48 changes: 48 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
This document describe how to make a release of python-cloudfiles.

Prereq
======

- To upload python-cloudfiles to pypi you would need the rackspace
credentials account, please contact [email protected] if you don't
have them.

- Packages for releases needed on system :

* python-nose
* python-epydoc

Steps
======


1) Run tests with nosetests and be sure it ends with OK or something is broken!

2) edit ChangeLog file and add an outline of the changes since the last release.

3) edit cloudfiles/consts.py and increase the version, following these rules :

- Bugfixes -- increase the minor version.
- Major features -- increase the major version.

4) Regenerate the docs with the command: epydoc --config=epydoc.conf

5) make sure you have only the relevant changes staged: git st

6) commit the changes: git commit -a

6) tag it with the new version: git tag VERSION

7) push it to github : git push --tags origin master

8) upload it to pypi : python setup.py sdist register upload

9) if new features has been added (ie: new major release) upload the
documentation by going in the docs directory and zip everything to
a file like docs.zip and go to :

http://pypi.python.org/pypi?%3Aaction=pkg_edit&name=python-cloudfiles

(using rackspace credentials)

and click on "choose file"" to that docs.zip and "upload documentation".
2 changes: 1 addition & 1 deletion cloudfiles/consts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" See COPYING for license information. """

__version__ = "1.7.7"
__version__ = "1.7.9"
user_agent = "python-cloudfiles/%s" % __version__
us_authurl = 'https://auth.api.rackspacecloud.com/v1.0'
uk_authurl = 'https://lon.auth.api.rackspacecloud.com/v1.0'
Expand Down
32 changes: 32 additions & 0 deletions cloudfiles/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,38 @@ def make_private(self):
if (response.status < 200) or (response.status >= 300):
raise ResponseError(response.status, response.reason)

@requires_name(InvalidContainerName)
def purge_from_cdn(self, email=None):
"""
Purge Edge cache for all object inside of this container.
You will be notified by email if one is provided when the
job completes.
>>> container.purge_from_cdn("[email protected]")
or
>>> container.purge_from_cdn("[email protected],[email protected]")
or
>>> container.purge_from_cdn()
@param email: A Valid email address
@type email: str
"""
if not self.conn.cdn_enabled:
raise CDNNotEnabled()

if email:
hdrs = {"X-Purge-Email": email}
response = self.conn.cdn_request('DELETE', [self.name], hdrs=hdrs)
else:
response = self.conn.cdn_request('DELETE', [self.name])

if (response.status < 200) or (response.status >= 300):
raise ResponseError(response.status, response.reason)

@requires_name(InvalidContainerName)
def acl_user_agent(self, cdn_acl_user_agent=consts.cdn_acl_user_agent):
"""
Expand Down
31 changes: 31 additions & 0 deletions cloudfiles/storage_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,37 @@ def public_uri(self):
return "%s/%s" % (self.container.public_uri().rstrip('/'),
quote(self.name))

def purge_from_cdn(self, email=None):
"""
Purge Edge cache for this object.
You will be notified by email if one is provided when the
job completes.
>>> obj.purge_from_cdn("[email protected]")
or
>>> obj.purge_from_cdn("[email protected],[email protected]")
or
>>> obj.purge_from_cdn()
@param email: A Valid email address
@type email: str
"""
if not self.container.conn.cdn_enabled:
raise CDNNotEnabled()

if email:
hdrs = {"X-Purge-Email": email}
response = self.container.conn.cdn_request('DELETE', [self.container.name, self.name], hdrs=hdrs)
else:
response = self.container.conn.cdn_request('DELETE', [self.container.name, self.name])

if (response.status < 200) or (response.status >= 300):
raise ResponseError(response.status, response.reason)


class ObjectResults(object):
"""
Expand Down
2 changes: 2 additions & 0 deletions docs/api-objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cloudfiles.container.Container.get_object cloudfiles.container.Container-class.h
cloudfiles.container.Container.__str__ cloudfiles.container.Container-class.html#__str__
cloudfiles.container.Container.acl_user_agent cloudfiles.container.Container-class.html#acl_user_agent
cloudfiles.container.Container.acl_referrer cloudfiles.container.Container-class.html#acl_referrer
cloudfiles.container.Container.purge_from_cdn cloudfiles.container.Container-class.html#purge_from_cdn
cloudfiles.container.Container.__init__ cloudfiles.container.Container-class.html#__init__
cloudfiles.container.Container.size_used cloudfiles.container.Container-class.html#size_used
cloudfiles.container.Container.object_count cloudfiles.container.Container-class.html#object_count
Expand Down Expand Up @@ -90,6 +91,7 @@ cloudfiles.errors.ResponseError.__init__ cloudfiles.errors.ResponseError-class.h
cloudfiles.storage_object.Object cloudfiles.storage_object.Object-class.html
cloudfiles.storage_object.Object.stream cloudfiles.storage_object.Object-class.html#stream
cloudfiles.storage_object.Object.__str__ cloudfiles.storage_object.Object-class.html#__str__
cloudfiles.storage_object.Object.purge_from_cdn cloudfiles.storage_object.Object-class.html#purge_from_cdn
cloudfiles.storage_object.Object.__init__ cloudfiles.storage_object.Object-class.html#__init__
cloudfiles.storage_object.Object.size cloudfiles.storage_object.Object-class.html#size
cloudfiles.storage_object.Object.container cloudfiles.storage_object.Object-class.html#container
Expand Down
2 changes: 1 addition & 1 deletion docs/class-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ <h1 class="epydoc">Class Hierarchy</h1>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:43 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
4 changes: 2 additions & 2 deletions docs/cloudfiles-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h1 class="epydoc">Package cloudfiles</h1><p class="nomargin-top"><span class="c

<hr />
<div class="fields"> <p><strong>Version:</strong>
1.7.7
1.7.9
</p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
Expand Down Expand Up @@ -261,7 +261,7 @@ <h3 class="epydoc"><span class="sig"><span class="sig-name">get_connection</span
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:43 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
2 changes: 1 addition & 1 deletion docs/cloudfiles-pysrc.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h1 class="epydoc">Source Code for <a href="cloudfiles-module.html">Package clou
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:45 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
2 changes: 1 addition & 1 deletion docs/cloudfiles.connection-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h1 class="epydoc">Module connection</h1><p class="nomargin-top"><span class="co
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:43 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
2 changes: 1 addition & 1 deletion docs/cloudfiles.connection-pysrc.html
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ <h1 class="epydoc">Source Code for <a href="cloudfiles.connection-module.html">M
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:45 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
18 changes: 2 additions & 16 deletions docs/cloudfiles.connection.Connection-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,7 @@
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Connection</h1><p class="nomargin-top"><span class="codelink"><a href="cloudfiles.connection-pysrc.html#Connection">source&nbsp;code</a></span></p>
<center>
<center> <map id="uml_class_diagram_for_cloudfil" name="uml_class_diagram_for_cloudfil">
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#__init__" title="Accepts keyword arguments for Mosso username and api key." alt="" coords="17,39,421,57"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#get_info" title="Return tuple for number of containers and total bytes in the account" alt="" coords="17,57,421,76"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#create_container" title="Given a container name, returns a Container item, creating a new Container &#160;if one does not already exist." alt="" coords="17,76,421,95"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#delete_container" title="Given a container name, delete it." alt="" coords="17,95,421,113"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#get_all_containers" title="Returns a Container item result set." alt="" coords="17,113,421,132"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#get_container" title="Return a single Container item for the given Container." alt="" coords="17,132,421,151"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#list_public_containers" title="Returns a list of containers that have been published to the CDN." alt="" coords="17,151,421,169"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#list_containers_info" title="Returns a list of Containers, including object count and size." alt="" coords="17,169,421,188"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#list_containers" title="Returns a list of Containers." alt="" coords="17,188,421,207"/>
<area shape="rect" id="node0" href="cloudfiles.connection.Connection-class.html#__getitem__" title="Container objects can be grabbed from a connection using index syntax." alt="" coords="17,207,421,225"/>
<area shape="rect" id="node1" href="cloudfiles.connection.Connection-class.html" title="Manages the connection to the storage system and serves as a factory for Container instances." alt="" coords="5,6,432,231"/>
</map>
<img src="uml_class_diagram_for_cloudfil.gif" alt='' usemap="#uml_class_diagram_for_cloudfil" ismap="ismap" class="graph-without-title" />
</center>

</center>
<hr />
<p>Manages the connection to the storage system and serves as a factory
Expand Down Expand Up @@ -682,7 +668,7 @@ <h3 class="epydoc"><span class="sig"><span class="sig-name">__getitem__</span>(<
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:44 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
19 changes: 2 additions & 17 deletions docs/cloudfiles.connection.ConnectionPool-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,7 @@
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ConnectionPool</h1><p class="nomargin-top"><span class="codelink"><a href="cloudfiles.connection-pysrc.html#ConnectionPool">source&nbsp;code</a></span></p>
<center>
<center> <map id="uml_class_diagram_for_cloudfil_2" name="uml_class_diagram_for_cloudfil_2">
<area shape="rect" id="node2" href="javascript:void(0);" title="Indicate that a formerly enqueued task is complete." alt="" coords="120,39,252,57"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Blocks until all items in the Queue have been gotten and processed." alt="" coords="120,57,252,76"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return the approximate size of the queue (not reliable!)." alt="" coords="120,76,252,95"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return True if the queue is empty, False otherwise (not reliable!)." alt="" coords="120,95,252,113"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Return True if the queue is full, False otherwise (not reliable!)." alt="" coords="120,113,252,132"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Put an item into the queue without blocking." alt="" coords="120,132,252,151"/>
<area shape="rect" id="node2" href="javascript:void(0);" title="Remove and return an item from the queue without blocking." alt="" coords="120,151,252,169"/>
<area shape="rect" id="node1" href="javascript:void(0);" title="Create a queue object with a given maximum size." alt="" coords="108,6,263,175"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#__init__" title="cloudfiles.connection.ConnectionPool.__init__" alt="" coords="17,228,355,247"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#get" title="Return a cloudfiles connection object." alt="" coords="17,247,355,265"/>
<area shape="rect" id="node1" href="cloudfiles.connection.ConnectionPool-class.html#put" title="Place a cloudfiles connection object back into the pool." alt="" coords="17,265,355,284"/>
<area shape="rect" id="node2" href="cloudfiles.connection.ConnectionPool-class.html" title="A thread&#45;safe connection pool object." alt="" coords="5,195,365,290"/>
</map>
<img src="uml_class_diagram_for_cloudfil_2.gif" alt='' usemap="#uml_class_diagram_for_cloudfil_2" ismap="ismap" class="graph-without-title" />
</center>

</center>
<hr />
<p>A thread-safe connection pool object.</p>
Expand Down Expand Up @@ -280,7 +265,7 @@ <h3 class="epydoc"><span class="sig"><span class="sig-name">put</span>(<span cla
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:44 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
2 changes: 1 addition & 1 deletion docs/cloudfiles.container-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h1 class="epydoc">Module container</h1><p class="nomargin-top"><span class="cod
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Thu Jan 27 11:23:43 2011
Generated by Epydoc 3.0.1 on Thu Feb 24 15:22:01 2011
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
Expand Down
Loading

0 comments on commit f9dc679

Please sign in to comment.