Skip to content

Commit f16208b

Browse files
author
Josh Mervine
committed
Tweaking upload.
1 parent fa03ec6 commit f16208b

File tree

4 files changed

+159
-10
lines changed

4 files changed

+159
-10
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,12 @@ build/coverage:
8585
build/nose:
8686
pip install nose -t $(target) -b $(source)
8787

88+
readme:
89+
pandoc -s -t rst --toc README.md -o tmp.text
90+
cat tmp.text| grep -v "Build\|Status" > README.text
91+
rm tmp.text
92+
93+
upload: readme
94+
python setup.py sdist register upload
95+
8896
.PHONY: init clean test coverage test/help test/32 test/33

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
# MaxCDN is Hiring!
1+
MaxCDN is Hiring!
2+
=================
23

34
Do you like building cool stuff? Do APIs keep you up at night? We're looking for our next superstar hacker and you could be it. Interested? Check out our job posting on [stackoverflow](http://careers.stackoverflow.com/jobs/37078/senior-web-engineer-for-fun-growing-la-startup-maxcdn&a=JdFbT4OY).
45

5-
# MaxCDN REST Web Services Python Client
6+
MaxCDN REST Web Services Python Client
7+
======================================
68

79
[![Build Status](https://travis-ci.org/maxcdn/python-maxcdn.png?branch=master)](https://travis-ci.org/maxcdn/python-maxcdn)
810

9-
## Installation
11+
Installation
12+
------------
1013

1114
```
1215
pip install maxcdn
1316
```
1417

15-
## Usage
18+
Usage
19+
-----
20+
1621
```python
1722
from maxcdn import MaxCDN
1823

@@ -35,10 +40,14 @@ api.delete("/zones/pull.json/77573/cache", data={'file': '/my-file.png'})
3540

3641
```
3742

38-
## Methods
43+
Methods
44+
-------
45+
3946
It has support for `GET`, `POST`, `PUT` and `DELETE` OAuth signed requests.
4047

41-
### We now have a shortcut for Purge Calls!
48+
We now have a shortcut for Purge Calls!
49+
--------------------------------------
50+
4251
```python
4352
zone_id = 12345
4453

@@ -67,7 +76,9 @@ For more information about what optional parameters this methods accept you
6776
should check out [@kennethreitz](http://github.com/kennethreitz) library
6877
[Requests](https://github.com/kennethreitz/requests).
6978

70-
## Initialization
79+
Initialization
80+
--------------
81+
7182
For applications that don't require user authentication,
7283
you can use the default initialization as the example above.
7384

@@ -82,7 +93,8 @@ api = MaxCDN("myalias", "consumer_key", "consumer_secret",
8293
You can also send the optional parameter header_auth, which takes a boolean
8394
to send the OAuth header in the body or URLEncoded.
8495

85-
# Development
96+
Development
97+
-----------
8698

8799
```
88100
git clone https://github.com/maxcdn/python-maxcdn.git
@@ -98,7 +110,8 @@ make int/all # integration w/ python2 python3.2 python3.3 python3.4
98110
make nose # verbose test output w/ nosetests
99111
```
100112

101-
# Examples
113+
Examples
114+
--------
102115

103116
Running examples:
104117

README.text

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
MaxCDN is Hiring!
2+
=================
3+
4+
Do you like building cool stuff? Do APIs keep you up at night? We're
5+
looking for our next superstar hacker and you could be it. Interested?
6+
Check out our job posting on
7+
`stackoverflow <http://careers.stackoverflow.com/jobs/37078/senior-web-engineer-for-fun-growing-la-startup-maxcdn&a=JdFbT4OY>`_.
8+
9+
MaxCDN REST Web Services Python Client
10+
======================================
11+
12+
13+
Installation
14+
------------
15+
16+
::
17+
18+
pip install maxcdn
19+
20+
Usage
21+
-----
22+
23+
::
24+
25+
from maxcdn import MaxCDN
26+
27+
api = MaxCDN("myalias", "consumer_key", "consumer_secret")
28+
29+
# Get Account Info
30+
api.get("/account.json")
31+
32+
# Create Pull Zone
33+
api.post("/zones/pull.json", {'name': 'mypullzone', 'url': 'http://yourorigin.com', 'compress': '1'})
34+
35+
# Update Pull Zone
36+
api.put("/zones/pull.json/12345", {'url': 'http://neworigin.com'})
37+
38+
# Purge All Cache
39+
api.delete("/zones/pull.json/12345/cache")
40+
41+
# Purge File
42+
api.delete("/zones/pull.json/77573/cache", data={'file': '/my-file.png'})
43+
44+
Methods
45+
-------
46+
47+
It has support for ``GET``, ``POST``, ``PUT`` and ``DELETE`` OAuth
48+
signed requests.
49+
50+
We now have a shortcut for Purge Calls!
51+
---------------------------------------
52+
53+
::
54+
55+
zone_id = 12345
56+
57+
# Purge Zone
58+
api.purge(zone_id)
59+
60+
# Purge File
61+
api.purge(zone_id, '/some_file')
62+
63+
# Purge Files
64+
api.purge(zone_id, ['/some_file', '/another_file'])
65+
66+
Every request can take an optional debug parameter. \`\`\`python
67+
api.get("/account.json", debug=True) # Will output # Making GET request
68+
to http://rws.netdna.com/myalias/account.json #{... API Returned Stuff
69+
...}
70+
71+
Every request can also take an optional debug\_json parameter if you
72+
don't like the exception based errors. api.get('/account.json',
73+
debug\_json=True) \`\`\`
74+
75+
For more information about what optional parameters this methods accept
76+
you should check out `@kennethreitz <http://github.com/kennethreitz>`_
77+
library `Requests <https://github.com/kennethreitz/requests>`_.
78+
79+
Initialization
80+
--------------
81+
82+
For applications that don't require user authentication, you can use the
83+
default initialization as the example above.
84+
85+
For applications that require user authentication, you can initialize
86+
the API as follows.
87+
88+
::
89+
90+
api = MaxCDN("myalias", "consumer_key", "consumer_secret",
91+
token="user_token", token_secret="user_token_secret")
92+
93+
You can also send the optional parameter header\_auth, which takes a
94+
boolean to send the OAuth header in the body or URLEncoded.
95+
96+
Development
97+
-----------
98+
99+
::
100+
101+
git clone https://github.com/maxcdn/python-maxcdn.git
102+
cd python-maxcdn
103+
104+
make # setup and test
105+
make setup # installation w/ deps
106+
make test # test w/ primary python
107+
make int # integration tests w/ primary python
108+
make test/all # test w/ python2 python3.2 python3.3 python3.4
109+
make int # integration tests
110+
make int/all # integration w/ python2 python3.2 python3.3 python3.4
111+
make nose # verbose test output w/ nosetests
112+
113+
Examples
114+
--------
115+
116+
Running examples:
117+
118+
::
119+
120+
git clone https://github.com/maxcdn/python-maxcdn.git
121+
cd python-maxcdn
122+
make setup
123+
124+
export PYTHONPATH=./build:./maxcdn:$PYTHONPATH
125+
126+
./examples/simple.py
127+
./examples/report.py # [hourly|daily|monthly]
128+
./examples/purge.py # [zoneid]
129+

upload.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)