diff options
-rw-r--r-- | Pipfile | 15 | ||||
-rw-r--r-- | Pipfile.lock | 360 | ||||
-rw-r--r-- | README.rst | 19 | ||||
-rw-r--r-- | docs/index.rst | 21 | ||||
-rw-r--r-- | mastodon/Mastodon.py | 2 | ||||
-rw-r--r-- | tests/conftest.py | 6 | ||||
-rw-r--r-- | tox.ini | 11 |
7 files changed, 420 insertions, 14 deletions
@@ -0,0 +1,15 @@ | |||
1 | [[source]] | ||
2 | url = "https://pypi.org/simple" | ||
3 | verify_ssl = true | ||
4 | name = "pypi" | ||
5 | |||
6 | [packages] | ||
7 | |||
8 | [dev-packages] | ||
9 | mastodon-py = {editable = true, extras = ["tests"], path = "."} | ||
10 | pytest = "<4" | ||
11 | pytest-runner = "*" | ||
12 | pytest-cov = "*" | ||
13 | vcrpy = "*" | ||
14 | pytest-vcr = "<1" | ||
15 | pytest-mock = "*" | ||
diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..d1939fc --- /dev/null +++ b/Pipfile.lock | |||
@@ -0,0 +1,360 @@ | |||
1 | { | ||
2 | "_meta": { | ||
3 | "hash": { | ||
4 | "sha256": "51800ae7c5d1ee43b1835a60ce7fbe9a2bc9f3f5ecf06780ce62e9ed70290a8f" | ||
5 | }, | ||
6 | "pipfile-spec": 6, | ||
7 | "requires": {}, | ||
8 | "sources": [ | ||
9 | { | ||
10 | "name": "pypi", | ||
11 | "url": "https://pypi.org/simple", | ||
12 | "verify_ssl": true | ||
13 | } | ||
14 | ] | ||
15 | }, | ||
16 | "default": {}, | ||
17 | "develop": { | ||
18 | "asn1crypto": { | ||
19 | "hashes": [ | ||
20 | "sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87", | ||
21 | "sha256:9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49" | ||
22 | ], | ||
23 | "version": "==0.24.0" | ||
24 | }, | ||
25 | "atomicwrites": { | ||
26 | "hashes": [ | ||
27 | "sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0", | ||
28 | "sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee" | ||
29 | ], | ||
30 | "version": "==1.2.1" | ||
31 | }, | ||
32 | "attrs": { | ||
33 | "hashes": [ | ||
34 | "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", | ||
35 | "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" | ||
36 | ], | ||
37 | "version": "==18.2.0" | ||
38 | }, | ||
39 | "certifi": { | ||
40 | "hashes": [ | ||
41 | "sha256:339dc09518b07e2fa7eda5450740925974815557727d6bd35d319c1524a04a4c", | ||
42 | "sha256:6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a" | ||
43 | ], | ||
44 | "version": "==2018.10.15" | ||
45 | }, | ||
46 | "cffi": { | ||
47 | "hashes": [ | ||
48 | "sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743", | ||
49 | "sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef", | ||
50 | "sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50", | ||
51 | "sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f", | ||
52 | "sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30", | ||
53 | "sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93", | ||
54 | "sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257", | ||
55 | "sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b", | ||
56 | "sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3", | ||
57 | "sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e", | ||
58 | "sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc", | ||
59 | "sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04", | ||
60 | "sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6", | ||
61 | "sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359", | ||
62 | "sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596", | ||
63 | "sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b", | ||
64 | "sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd", | ||
65 | "sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95", | ||
66 | "sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5", | ||
67 | "sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e", | ||
68 | "sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6", | ||
69 | "sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca", | ||
70 | "sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31", | ||
71 | "sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1", | ||
72 | "sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2", | ||
73 | "sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085", | ||
74 | "sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801", | ||
75 | "sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4", | ||
76 | "sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184", | ||
77 | "sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917", | ||
78 | "sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f", | ||
79 | "sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb" | ||
80 | ], | ||
81 | "version": "==1.11.5" | ||
82 | }, | ||
83 | "chardet": { | ||
84 | "hashes": [ | ||
85 | "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", | ||
86 | "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" | ||
87 | ], | ||
88 | "version": "==3.0.4" | ||
89 | }, | ||
90 | "coverage": { | ||
91 | "hashes": [ | ||
92 | "sha256:09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f", | ||
93 | "sha256:0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe", | ||
94 | "sha256:0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d", | ||
95 | "sha256:10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0", | ||
96 | "sha256:1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607", | ||
97 | "sha256:1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d", | ||
98 | "sha256:2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b", | ||
99 | "sha256:447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3", | ||
100 | "sha256:46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e", | ||
101 | "sha256:4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815", | ||
102 | "sha256:510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36", | ||
103 | "sha256:5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1", | ||
104 | "sha256:5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14", | ||
105 | "sha256:5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c", | ||
106 | "sha256:6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794", | ||
107 | "sha256:6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b", | ||
108 | "sha256:77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840", | ||
109 | "sha256:828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd", | ||
110 | "sha256:85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82", | ||
111 | "sha256:8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952", | ||
112 | "sha256:a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389", | ||
113 | "sha256:aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f", | ||
114 | "sha256:ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4", | ||
115 | "sha256:b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da", | ||
116 | "sha256:bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647", | ||
117 | "sha256:c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d", | ||
118 | "sha256:d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42", | ||
119 | "sha256:d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478", | ||
120 | "sha256:da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b", | ||
121 | "sha256:ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb", | ||
122 | "sha256:ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9" | ||
123 | ], | ||
124 | "version": "==4.5.2" | ||
125 | }, | ||
126 | "cryptography": { | ||
127 | "hashes": [ | ||
128 | "sha256:02915ee546b42ce513e8167140e9937fc4c81a06a82216e086ccce51f347948a", | ||
129 | "sha256:03cc8bc5a69ae3d44acf1a03facdb7c10a94c67907862c563e10efe72b737977", | ||
130 | "sha256:07f76bde6815c55195f3b3812d35769cc7c765144c0bb71ae45e02535d078591", | ||
131 | "sha256:13eac1c477b9af7e9a9024369468d08aead6ad78ed599d163ad046684474364b", | ||
132 | "sha256:179bfb585c5efc87ae0e665770e4896727b92dbc1f810c761b1ebf8363e2fec8", | ||
133 | "sha256:414af0ba308e74c1f8bc5b11befc86cb66b10be8959547786f64258830d2096f", | ||
134 | "sha256:41a1ca14f255df8c44dd22c6006441d631d1589104045ec7263cc47e9772f41a", | ||
135 | "sha256:54947eb98bc4eef99ddf49f45d2694ea5a3929ab3edc9806ad01967368594d82", | ||
136 | "sha256:5bac7a2abda07d0c3c8429210349bb54149ad8940dc7bcffedcd56519b410a3c", | ||
137 | "sha256:7f41af8c586bed9f59cfe8832d818b3b75c860d7025da9cd2db76875a72ff785", | ||
138 | "sha256:8004fae1b3cb2dbd90a011ad972e49a7e78a871b89c70cc7213cf4ebd2532bcb", | ||
139 | "sha256:8e0eccadc3b465e12c50a5b8fb4d39cf401b44d7bb9936c70fddb5e5aaf740d5", | ||
140 | "sha256:95b4741722269cfdc134fec23b7ae6503ee2aea83d0924cfee6d6ec54cd42d8e", | ||
141 | "sha256:a06f5aa6d7a94531dfe82eb2972e669258c452fe9cf88f76116610de4c789785", | ||
142 | "sha256:b0833d27c7eb536bc27323a1e8e22cb39ebac78c4ef3be0167ba40f447344808", | ||
143 | "sha256:b72dec675bc59a01edc96616cd48ec465b714481caa0938c8bbca5d18f17d5df", | ||
144 | "sha256:c800ddc23b5206ce025f23225fdde89cdc0e64016ad914d5be32d1f602ce9495", | ||
145 | "sha256:c980c8c313a5e014ae12e2245e89e7b30427e5a98cbb88afe478ecae85f3abaa", | ||
146 | "sha256:e85b410885addaeb31a867eabcefc9ef4a7e904ad45eac9e60a763a54b244626" | ||
147 | ], | ||
148 | "version": "==2.4.1" | ||
149 | }, | ||
150 | "decorator": { | ||
151 | "hashes": [ | ||
152 | "sha256:2c51dff8ef3c447388fe5e4453d24a2bf128d3a4c32af3fabef1f01c6851ab82", | ||
153 | "sha256:c39efa13fbdeb4506c476c9b3babf6a718da943dab7811c206005a4a956c080c" | ||
154 | ], | ||
155 | "version": "==4.3.0" | ||
156 | }, | ||
157 | "http-ece": { | ||
158 | "hashes": [ | ||
159 | "sha256:2f31a0640c31a0c2934ab1e37005dd9a559ae854a16304f9b839e062074106cc" | ||
160 | ], | ||
161 | "version": "==1.0.5" | ||
162 | }, | ||
163 | "idna": { | ||
164 | "hashes": [ | ||
165 | "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", | ||
166 | "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" | ||
167 | ], | ||
168 | "version": "==2.7" | ||
169 | }, | ||
170 | "mastodon-py": { | ||
171 | "editable": true, | ||
172 | "extras": [ | ||
173 | "tests" | ||
174 | ], | ||
175 | "path": "." | ||
176 | }, | ||
177 | "more-itertools": { | ||
178 | "hashes": [ | ||
179 | "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", | ||
180 | "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e", | ||
181 | "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d" | ||
182 | ], | ||
183 | "version": "==4.3.0" | ||
184 | }, | ||
185 | "multidict": { | ||
186 | "hashes": [ | ||
187 | "sha256:05eeab69bf2b0664644c62bd92fabb045163e5b8d4376a31dfb52ce0210ced7b", | ||
188 | "sha256:0c85880efa7cadb18e3b5eef0aa075dc9c0a3064cbbaef2e20be264b9cf47a64", | ||
189 | "sha256:136f5a4a6a4adeacc4dc820b8b22f0a378fb74f326e259c54d1817639d1d40a0", | ||
190 | "sha256:14906ad3347c7d03e9101749b16611cf2028547716d0840838d3c5e2b3b0f2d3", | ||
191 | "sha256:1ade4a3b71b1bf9e90c5f3d034a87fe4949c087ef1f6cd727fdd766fe8bbd121", | ||
192 | "sha256:22939a00a511a59f9ecc0158b8db728afef57975ce3782b3a265a319d05b9b12", | ||
193 | "sha256:2b86b02d872bc5ba5b3a4530f6a7ba0b541458ab4f7c1429a12ac326231203f7", | ||
194 | "sha256:3c11e92c3dfc321014e22fb442bc9eb70e01af30d6ce442026b0c35723448c66", | ||
195 | "sha256:4ba3bd26f282b201fdbce351f1c5d17ceb224cbedb73d6e96e6ce391b354aacc", | ||
196 | "sha256:4c6e78d042e93751f60672989efbd6a6bc54213ed7ff695fff82784bbb9ea035", | ||
197 | "sha256:4d80d1901b89cc935a6cf5b9fd89df66565272722fe2e5473168927a9937e0ca", | ||
198 | "sha256:4fcf71d33178a00cc34a57b29f5dab1734b9ce0f1c97fb34666deefac6f92037", | ||
199 | "sha256:52f7670b41d4b4d97866ebc38121de8bcb9813128b7c4942b07794d08193c0ab", | ||
200 | "sha256:5368e2b7649a26b7253c6c9e53241248aab9da49099442f5be238fde436f18c9", | ||
201 | "sha256:5bb65fbb48999044938f0c0508e929b14a9b8bf4939d8263e9ea6691f7b54663", | ||
202 | "sha256:60672bb5577472800fcca1ac9dae232d1461db9f20f055184be8ce54b0052572", | ||
203 | "sha256:669e9be6d148fc0283f53e17dd140cde4dc7c87edac8319147edd5aa2a830771", | ||
204 | "sha256:6a0b7a804e8d1716aa2c72e73210b48be83d25ba9ec5cf52cf91122285707bb1", | ||
205 | "sha256:79034ea3da3cf2a815e3e52afdc1f6c1894468c98bdce5d2546fa2342585497f", | ||
206 | "sha256:79247feeef6abcc11137ad17922e865052f23447152059402fc320f99ff544bb", | ||
207 | "sha256:81671c2049e6bf42c7fd11a060f8bc58f58b7b3d6f3f951fc0b15e376a6a5a98", | ||
208 | "sha256:82ac4a5cb56cc9280d4ae52c2d2ebcd6e0668dd0f9ef17f0a9d7c82bd61e24fa", | ||
209 | "sha256:9436267dbbaa49dad18fbbb54f85386b0f5818d055e7b8e01d219661b6745279", | ||
210 | "sha256:94e4140bb1343115a1afd6d84ebf8fca5fb7bfb50e1c2cbd6f2fb5d3117ef102", | ||
211 | "sha256:a2cab366eae8a0ffe0813fd8e335cf0d6b9bb6c5227315f53bb457519b811537", | ||
212 | "sha256:a596019c3eafb1b0ae07db9f55a08578b43c79adb1fe1ab1fd818430ae59ee6f", | ||
213 | "sha256:e8848ae3cd6a784c29fae5055028bee9bffcc704d8bcad09bd46b42b44a833e2", | ||
214 | "sha256:e8a048bfd7d5a280f27527d11449a509ddedf08b58a09a24314828631c099306", | ||
215 | "sha256:f6dd28a0ac60e2426a6918f36f1b4e2620fc785a0de7654cd206ba842eee57fd" | ||
216 | ], | ||
217 | "version": "==4.4.2" | ||
218 | }, | ||
219 | "pluggy": { | ||
220 | "hashes": [ | ||
221 | "sha256:447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095", | ||
222 | "sha256:bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f" | ||
223 | ], | ||
224 | "version": "==0.8.0" | ||
225 | }, | ||
226 | "py": { | ||
227 | "hashes": [ | ||
228 | "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694", | ||
229 | "sha256:e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6" | ||
230 | ], | ||
231 | "version": "==1.7.0" | ||
232 | }, | ||
233 | "pycparser": { | ||
234 | "hashes": [ | ||
235 | "sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3" | ||
236 | ], | ||
237 | "version": "==2.19" | ||
238 | }, | ||
239 | "pytest": { | ||
240 | "hashes": [ | ||
241 | "sha256:3f193df1cfe1d1609d4c583838bea3d532b18d6160fd3f55c9447fdca30848ec", | ||
242 | "sha256:e246cf173c01169b9617fc07264b7b1316e78d7a650055235d6d897bc80d9660" | ||
243 | ], | ||
244 | "index": "pypi", | ||
245 | "version": "==3.10.1" | ||
246 | }, | ||
247 | "pytest-cov": { | ||
248 | "hashes": [ | ||
249 | "sha256:513c425e931a0344944f84ea47f3956be0e416d95acbd897a44970c8d926d5d7", | ||
250 | "sha256:e360f048b7dae3f2f2a9a4d067b2dd6b6a015d384d1577c994a43f3f7cbad762" | ||
251 | ], | ||
252 | "index": "pypi", | ||
253 | "version": "==2.6.0" | ||
254 | }, | ||
255 | "pytest-mock": { | ||
256 | "hashes": [ | ||
257 | "sha256:53801e621223d34724926a5c98bd90e8e417ce35264365d39d6c896388dcc928", | ||
258 | "sha256:d89a8209d722b8307b5e351496830d5cc5e192336003a485443ae9adeb7dd4c0" | ||
259 | ], | ||
260 | "index": "pypi", | ||
261 | "version": "==1.10.0" | ||
262 | }, | ||
263 | "pytest-runner": { | ||
264 | "hashes": [ | ||
265 | "sha256:d23f117be39919f00dd91bffeb4f15e031ec797501b717a245e377aee0f577be", | ||
266 | "sha256:d987fec1e31287592ffe1cb823a8c613c533db4c6aaca0ee1191dbc91e2fcc61" | ||
267 | ], | ||
268 | "index": "pypi", | ||
269 | "version": "==4.2" | ||
270 | }, | ||
271 | "pytest-vcr": { | ||
272 | "hashes": [ | ||
273 | "sha256:13f2e24ab4b8674e012ca23df50e34f0b322a8b8cf8aa80f2b432ae95a92e298", | ||
274 | "sha256:b3d1f0a470e172a5f8ef60b3f1daf3ff1ff60a43280a9cdfb24a8c53e3e9c12c" | ||
275 | ], | ||
276 | "index": "pypi", | ||
277 | "version": "==0.3.0" | ||
278 | }, | ||
279 | "python-dateutil": { | ||
280 | "hashes": [ | ||
281 | "sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93", | ||
282 | "sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02" | ||
283 | ], | ||
284 | "version": "==2.7.5" | ||
285 | }, | ||
286 | "pytz": { | ||
287 | "hashes": [ | ||
288 | "sha256:31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca", | ||
289 | "sha256:8e0f8568c118d3077b46be7d654cc8167fa916092e28320cde048e54bfc9f1e6" | ||
290 | ], | ||
291 | "version": "==2018.7" | ||
292 | }, | ||
293 | "pyyaml": { | ||
294 | "hashes": [ | ||
295 | "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b", | ||
296 | "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf", | ||
297 | "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a", | ||
298 | "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3", | ||
299 | "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1", | ||
300 | "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1", | ||
301 | "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613", | ||
302 | "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04", | ||
303 | "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f", | ||
304 | "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537", | ||
305 | "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531" | ||
306 | ], | ||
307 | "version": "==3.13" | ||
308 | }, | ||
309 | "requests": { | ||
310 | "hashes": [ | ||
311 | "sha256:65b3a120e4329e33c9889db89c80976c5272f56ea92d3e74da8a463992e3ff54", | ||
312 | "sha256:ea881206e59f41dbd0bd445437d792e43906703fff75ca8ff43ccdb11f33f263" | ||
313 | ], | ||
314 | "version": "==2.20.1" | ||
315 | }, | ||
316 | "six": { | ||
317 | "hashes": [ | ||
318 | "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", | ||
319 | "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" | ||
320 | ], | ||
321 | "version": "==1.11.0" | ||
322 | }, | ||
323 | "urllib3": { | ||
324 | "hashes": [ | ||
325 | "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", | ||
326 | "sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" | ||
327 | ], | ||
328 | "version": "==1.24.1" | ||
329 | }, | ||
330 | "vcrpy": { | ||
331 | "hashes": [ | ||
332 | "sha256:127e79cf7b569d071d1bd761b83f7b62b2ce2a2eb63ceca7aa67cba8f2602ea3", | ||
333 | "sha256:57be64aa8e9883a4117d0b15de28af62275c001abcdb00b6dc2d4406073d9a4f" | ||
334 | ], | ||
335 | "index": "pypi", | ||
336 | "version": "==2.0.1" | ||
337 | }, | ||
338 | "wrapt": { | ||
339 | "hashes": [ | ||
340 | "sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" | ||
341 | ], | ||
342 | "version": "==1.10.11" | ||
343 | }, | ||
344 | "yarl": { | ||
345 | "hashes": [ | ||
346 | "sha256:2556b779125621b311844a072e0ed367e8409a18fa12cbd68eb1258d187820f9", | ||
347 | "sha256:4aec0769f1799a9d4496827292c02a7b1f75c0bab56ab2b60dd94ebb57cbd5ee", | ||
348 | "sha256:55369d95afaacf2fa6b49c84d18b51f1704a6560c432a0f9a1aeb23f7b971308", | ||
349 | "sha256:6c098b85442c8fe3303e708bbb775afd0f6b29f77612e8892627bcab4b939357", | ||
350 | "sha256:9182cd6f93412d32e009020a44d6d170d2093646464a88aeec2aef50592f8c78", | ||
351 | "sha256:c8cbc21bbfa1dd7d5386d48cc814fe3d35b80f60299cdde9279046f399c3b0d8", | ||
352 | "sha256:db6f70a4b09cde813a4807843abaaa60f3b15fb4a2a06f9ae9c311472662daa1", | ||
353 | "sha256:f17495e6fe3d377e3faac68121caef6f974fcb9e046bc075bcff40d8e5cc69a4", | ||
354 | "sha256:f85900b9cca0c67767bb61b2b9bd53208aaa7373dae633dbe25d179b4bf38aa7" | ||
355 | ], | ||
356 | "markers": "python_version >= '3.4'", | ||
357 | "version": "==1.2.6" | ||
358 | } | ||
359 | } | ||
360 | } | ||
@@ -1,10 +1,11 @@ | |||
1 | Mastodon.py | 1 | Mastodon.py |
2 | =========== | 2 | =========== |
3 | Register your app! This only needs to be done once. Uncomment the code and substitute in your information. | ||
4 | |||
3 | .. code-block:: python | 5 | .. code-block:: python |
4 | 6 | ||
5 | from mastodon import Mastodon | 7 | from mastodon import Mastodon |
6 | 8 | ||
7 | # Register app - only once! | ||
8 | ''' | 9 | ''' |
9 | Mastodon.create_app( | 10 | Mastodon.create_app( |
10 | 'pytooterapp', | 11 | 'pytooterapp', |
@@ -13,8 +14,12 @@ Mastodon.py | |||
13 | ) | 14 | ) |
14 | ''' | 15 | ''' |
15 | 16 | ||
16 | # Log in - either every time, or use persisted | 17 | Then login. This can be done every time, or use persisted. |
17 | ''' | 18 | |
19 | .. code-block:: python | ||
20 | |||
21 | from mastodon import Mastodon | ||
22 | |||
18 | mastodon = Mastodon( | 23 | mastodon = Mastodon( |
19 | client_id = 'pytooter_clientcred.secret', | 24 | client_id = 'pytooter_clientcred.secret', |
20 | api_base_url = 'https://mastodon.social' | 25 | api_base_url = 'https://mastodon.social' |
@@ -24,9 +29,13 @@ Mastodon.py | |||
24 | 'incrediblygoodpassword', | 29 | 'incrediblygoodpassword', |
25 | to_file = 'pytooter_usercred.secret' | 30 | to_file = 'pytooter_usercred.secret' |
26 | ) | 31 | ) |
27 | ''' | ||
28 | 32 | ||
29 | # Create actual API instance | 33 | To post, create an actual API instance. |
34 | |||
35 | .. code-block:: python | ||
36 | |||
37 | from mastodon import Mastodon | ||
38 | |||
30 | mastodon = Mastodon( | 39 | mastodon = Mastodon( |
31 | access_token = 'pytooter_usercred.secret', | 40 | access_token = 'pytooter_usercred.secret', |
32 | api_base_url = 'https://mastodon.social' | 41 | api_base_url = 'https://mastodon.social' |
diff --git a/docs/index.rst b/docs/index.rst index 0cff37e..808e563 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -2,12 +2,13 @@ Mastodon.py | |||
2 | =========== | 2 | =========== |
3 | .. py:module:: mastodon | 3 | .. py:module:: mastodon |
4 | .. py:class: Mastodon | 4 | .. py:class: Mastodon |
5 | |||
6 | Register your app! This only needs to be done once. Uncomment the code and substitute in your information. | ||
5 | 7 | ||
6 | .. code-block:: python | 8 | .. code-block:: python |
7 | 9 | ||
8 | from mastodon import Mastodon | 10 | from mastodon import Mastodon |
9 | 11 | ||
10 | # Register app - only once! | ||
11 | ''' | 12 | ''' |
12 | Mastodon.create_app( | 13 | Mastodon.create_app( |
13 | 'pytooterapp', | 14 | 'pytooterapp', |
@@ -16,8 +17,12 @@ Mastodon.py | |||
16 | ) | 17 | ) |
17 | ''' | 18 | ''' |
18 | 19 | ||
19 | # Log in - either every time, or use persisted | 20 | Then login. This can be done every time, or use persisted. |
20 | ''' | 21 | |
22 | .. code-block:: python | ||
23 | |||
24 | from mastodon import Mastodon | ||
25 | |||
21 | mastodon = Mastodon( | 26 | mastodon = Mastodon( |
22 | client_id = 'pytooter_clientcred.secret', | 27 | client_id = 'pytooter_clientcred.secret', |
23 | api_base_url = 'https://mastodon.social' | 28 | api_base_url = 'https://mastodon.social' |
@@ -27,14 +32,18 @@ Mastodon.py | |||
27 | 'incrediblygoodpassword', | 32 | 'incrediblygoodpassword', |
28 | to_file = 'pytooter_usercred.secret' | 33 | to_file = 'pytooter_usercred.secret' |
29 | ) | 34 | ) |
30 | ''' | ||
31 | 35 | ||
32 | # Create actual API instance | 36 | To post, create an actual API instance. |
37 | |||
38 | .. code-block:: python | ||
39 | |||
40 | from mastodon import Mastodon | ||
41 | |||
33 | mastodon = Mastodon( | 42 | mastodon = Mastodon( |
34 | access_token = 'pytooter_usercred.secret', | 43 | access_token = 'pytooter_usercred.secret', |
35 | api_base_url = 'https://mastodon.social' | 44 | api_base_url = 'https://mastodon.social' |
36 | ) | 45 | ) |
37 | mastodon.toot('Tooting from python using #mastodonpy !') | 46 | mastodon.toot('Tooting from python using #mastodonpy !') |
38 | 47 | ||
39 | `Mastodon`_ is an ActivityPub and OStatus based twitter-like federated social | 48 | `Mastodon`_ is an ActivityPub and OStatus based twitter-like federated social |
40 | network node. It has an API that allows you to interact with its | 49 | network node. It has an API that allows you to interact with its |
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index c8dc6e4..a5c05b7 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1727,6 +1727,8 @@ class Mastodon: | |||
1727 | if mime_type is None and os.path.isfile(media_file): | 1727 | if mime_type is None and os.path.isfile(media_file): |
1728 | mime_type = guess_type(media_file) | 1728 | mime_type = guess_type(media_file) |
1729 | media_file = open(media_file, 'rb') | 1729 | media_file = open(media_file, 'rb') |
1730 | elif mime_type and os.path.isfile(media_file): | ||
1731 | media_file = open(media_file, 'rb') | ||
1730 | 1732 | ||
1731 | if mime_type is None: | 1733 | if mime_type is None: |
1732 | raise MastodonIllegalArgumentError('Could not determine mime type' | 1734 | raise MastodonIllegalArgumentError('Could not determine mime type' |
diff --git a/tests/conftest.py b/tests/conftest.py index 7346d31..3291bbe 100644 --- a/tests/conftest.py +++ b/tests/conftest.py | |||
@@ -27,19 +27,19 @@ def api2(): | |||
27 | def api_anonymous(): | 27 | def api_anonymous(): |
28 | return _api(access_token=None) | 28 | return _api(access_token=None) |
29 | 29 | ||
30 | @pytest.fixture() | 30 | @pytest.fixture |
31 | def status(api): | 31 | def status(api): |
32 | _status = api.status_post('Toot!') | 32 | _status = api.status_post('Toot!') |
33 | yield _status | 33 | yield _status |
34 | api.status_delete(_status['id']) | 34 | api.status_delete(_status['id']) |
35 | 35 | ||
36 | @pytest.fixture() | 36 | @pytest.fixture |
37 | def status2(api): | 37 | def status2(api): |
38 | _status = api.status_post('Toot, too!') | 38 | _status = api.status_post('Toot, too!') |
39 | yield _status | 39 | yield _status |
40 | api.status_delete(_status['id']) | 40 | api.status_delete(_status['id']) |
41 | 41 | ||
42 | @pytest.fixture() | 42 | @pytest.fixture(scope="module") |
43 | def vcr_config(): | 43 | def vcr_config(): |
44 | return dict( | 44 | return dict( |
45 | match_on = ['method', 'path', 'query', 'body'], | 45 | match_on = ['method', 'path', 'query', 'body'], |
@@ -0,0 +1,11 @@ | |||
1 | [tox] | ||
2 | envlist = py27,py36,py37 | ||
3 | skipsdist = true | ||
4 | |||
5 | |||
6 | [testenv] | ||
7 | deps = pipenv==2018.11.14 | ||
8 | passenv = HOME | ||
9 | commands = | ||
10 | pipenv sync -d | ||
11 | pipenv run pytest \ No newline at end of file | ||