Compare commits
427 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ebfa77e509 | ||
|
b10e2cbc31 | ||
|
6abea7bb3e | ||
|
578c82094c | ||
|
6702c78868 | ||
|
c3e7cc9bed | ||
|
4b3818a667 | ||
|
5402122038 | ||
|
0bba8d932c | ||
|
d8734aa6ac | ||
|
daf7ccd2ce | ||
|
b471c9fa14 | ||
|
e0411b68fb | ||
|
9315d0144d | ||
|
f07d547dc7 | ||
|
93d7fb98e6 | ||
|
d2673bba08 | ||
|
be4811aeb7 | ||
|
77af92f780 | ||
|
394fa09b07 | ||
|
b251f1b150 | ||
|
c7f3849c1a | ||
|
d70bf71cb6 | ||
|
8db7d48ad6 | ||
|
39595fc35f | ||
|
b6fd12efa2 | ||
|
0ec5939713 | ||
|
19fba38556 | ||
|
16628ba071 | ||
|
b1684aaf39 | ||
|
6f35f00461 | ||
|
a2c5a17ca8 | ||
|
fcb70ba7b9 | ||
|
9687de2a67 | ||
|
d0dd3ad2b7 | ||
|
5bbdcdd5a5 | ||
|
2c623dd33a | ||
|
f0afccc347 | ||
|
d7d7e970d7 | ||
|
05ad6cf2af | ||
|
f71b997a45 | ||
|
9e2508ae6a | ||
|
4b4951d755 | ||
|
00e420fc51 | ||
|
ebe5f59a9d | ||
|
551b251c05 | ||
|
eab5d5968e | ||
|
a5f1258275 | ||
|
b5c20d02ea | ||
|
3b9d9bdcd1 | ||
|
be9c3bb0ae | ||
|
193c839163 | ||
|
664bb038d4 | ||
|
e2d0be0e2a | ||
|
8ab55b7393 | ||
|
124b0f027d | ||
|
662b720b5c | ||
|
039adfa04a | ||
|
f84272fc5c | ||
|
8f60bc1d0b | ||
|
bbb086a521 | ||
|
2043112a9d | ||
|
0d28d47f08 | ||
|
a25fe26adc | ||
|
40503d5ac5 | ||
|
c2dd151ed5 | ||
|
7ce56da1d8 | ||
|
473e4229f2 | ||
|
3df9d0e4e3 | ||
|
e8cd593e62 | ||
|
2aa7b37540 | ||
|
b1a8aadd70 | ||
|
eccd68a4bd | ||
|
3fc9e9e028 | ||
|
c125f25fb5 | ||
|
f96f5117c5 | ||
|
58de881f93 | ||
|
f2b1d7e8c2 | ||
|
495c840254 | ||
|
51d13b87cf | ||
|
ecaab6dca1 | ||
|
972d1334fb | ||
|
a0069d842e | ||
|
8a1536986f | ||
|
5eeb1053aa | ||
|
293575b7c4 | ||
|
191ea8343b | ||
|
6e246d1487 | ||
|
a32eaca58f | ||
|
446a3a09bb | ||
|
4576463fcc | ||
|
361ac5f49b | ||
|
497b9de72b | ||
|
259fb23c7b | ||
|
654da92e88 | ||
|
83bdff8e33 | ||
|
47fa96c31a | ||
|
2840050acb | ||
|
a7985b9edc | ||
|
e2d6ee66cc | ||
|
c91a6073fb | ||
|
86140390ad | ||
|
b5b8b83c0a | ||
|
489ccb18a7 | ||
|
57987cc9d5 | ||
|
86e78697fb | ||
|
1b1b9d4b70 | ||
|
5e8cfd7dbe | ||
|
19d4b07515 | ||
|
ab82f9647c | ||
|
f32e9d36e3 | ||
|
6010b97d90 | ||
|
acfcfa8808 | ||
|
ccf5be1a6f | ||
|
a50839656c | ||
|
f5f5208b12 | ||
|
ea1e228407 | ||
|
d8258dbc96 | ||
|
6a4cd34413 | ||
|
feeb410009 | ||
|
6213399144 | ||
|
d3a25fa14e | ||
|
e9a49a5527 | ||
|
be377779b6 | ||
|
fe9ed47217 | ||
|
00c5503712 | ||
|
cd4d7c0e34 | ||
|
c8f300fd09 | ||
|
205c9ede01 | ||
|
f4f501a230 | ||
|
043b83a722 | ||
|
2e2d65a9ec | ||
|
086be4ed19 | ||
|
9fc6db6215 | ||
|
897b915f11 | ||
|
6642876c64 | ||
|
b89710a415 | ||
|
aaa74c46a7 | ||
|
1787b50422 | ||
|
5525591601 | ||
|
bfccb718de | ||
|
95a87484c5 | ||
|
6e187cf84b | ||
|
d6ba3a66a3 | ||
|
f0bd1cb481 | ||
|
70c03e9801 | ||
|
9d0ad9ed98 | ||
|
48256e1fe8 | ||
|
de4b851c72 | ||
|
048a620502 | ||
|
2bc1cd61c1 | ||
|
d06fcbff1b | ||
|
c954b71f67 | ||
|
314de9a30b | ||
|
f13b98e6d5 | ||
|
902ca179eb | ||
|
9c42b920ad | ||
|
bb8ce63f68 | ||
|
ac63a4fb3a | ||
|
c824ed7813 | ||
|
e5b519149d | ||
|
435fd5f49e | ||
|
f082e9f22a | ||
|
33bcfa744a | ||
|
7525e800b8 | ||
|
9b3f86958a | ||
|
d4ad5a0643 | ||
|
9e28e00123 | ||
|
27b66b4f31 | ||
|
19e6b7da57 | ||
|
be2d537a05 | ||
|
7d06e7b5c1 | ||
|
a3baf043bd | ||
|
03a035a89d | ||
|
87906b9b2f | ||
|
ee0696b676 | ||
|
f72d7325fa | ||
|
ee70d52fe4 | ||
|
f97cbdd919 | ||
|
098d71f348 | ||
|
0b74f9ba5d | ||
|
7457ffb848 | ||
|
3ba87fea65 | ||
|
32f14a7e16 | ||
|
14600fd19b | ||
|
5edef33cae | ||
|
9ff40de544 | ||
|
0684777fa3 | ||
|
f735fe3116 | ||
|
669ff8c30e | ||
|
67f743eddd | ||
|
78cb5f39f5 | ||
|
e9b04d33f7 | ||
|
733061f90d | ||
|
184df9f99d | ||
|
a4af8a4e0c | ||
|
50265e91fc | ||
|
6cebc952c3 | ||
|
bd7cd4334c | ||
|
97c10e6fda | ||
|
8e6c850f30 | ||
|
e74ccb79d0 | ||
|
daf156abf5 | ||
|
16c90f9b24 | ||
|
3e99005ae4 | ||
|
8370f3a3b9 | ||
|
f20be4cfc4 | ||
|
00a1228ca3 | ||
|
de113d2491 | ||
|
ffb1599458 | ||
|
5f8067df42 | ||
|
30a6623ccd | ||
|
83cac75f41 | ||
|
d1a4144143 | ||
|
3e98cf1ceb | ||
|
43679ebd1e | ||
|
0d65c00bb6 | ||
|
255b9a574b | ||
|
68f6e0217c | ||
|
3d64252310 | ||
|
185d60c1b6 | ||
|
1b3b2e6c71 | ||
|
f98bd4363f | ||
|
2c910351b7 | ||
|
9a2718ae3a | ||
|
183e0d9ee5 | ||
|
2f2fcf87bc | ||
|
99280f57a0 | ||
|
7c85a73442 | ||
|
e4f340281c | ||
|
6c0ed6e7c5 | ||
|
dcc2e6a3d8 | ||
|
a1b4f8d521 | ||
|
328168c86f | ||
|
73a1248d04 | ||
|
a39792bd4b | ||
|
bd45175405 | ||
|
438f52c3e9 | ||
|
b3387c9dc7 | ||
|
ad39ef8625 | ||
|
df8baf9941 | ||
|
e35642ed05 | ||
|
f8aa17c8ba | ||
|
b8e4cd1693 | ||
|
76d98d9138 | ||
|
d59db75b4c | ||
|
734360ff59 | ||
|
2fb14be424 | ||
|
483496d97a | ||
|
f914194a87 | ||
|
12b2fc008e | ||
|
1b1a5bc10d | ||
|
49ed35e099 | ||
|
56c0347dd1 | ||
|
7006084c12 | ||
|
a9cbcdd95a | ||
|
9fb381c4f3 | ||
|
264b93a633 | ||
|
a7471ca737 | ||
|
6e5278e30a | ||
|
8e798af4fc | ||
|
176bcc8a25 | ||
|
44e885a09c | ||
|
dd3c62d49d | ||
|
68904d3f6f | ||
|
f30181a54e | ||
|
0c461ee66a | ||
|
b96e2fb6a9 | ||
|
2f383f8dc0 | ||
|
ef68d1b482 | ||
|
8522964105 | ||
|
f3c7afebd7 | ||
|
d7c8b73731 | ||
|
e899e38553 | ||
|
d9e71224e2 | ||
|
65c8a9ef8c | ||
|
888c9e1261 | ||
|
e18e56eba3 | ||
|
2cd7e3fccd | ||
|
2161c48e8e | ||
|
321e7196d0 | ||
|
08302ba0c8 | ||
|
2160dad717 | ||
|
a553ea0070 | ||
|
d4021862f0 | ||
|
1d467287ef | ||
|
0160d5019b | ||
|
a5593c42e0 | ||
|
7df49cd818 | ||
|
af6d1799d9 | ||
|
5bf46f66af | ||
|
312c5d542c | ||
|
4af4f9debf | ||
|
b10b3ad346 | ||
|
133baac11c | ||
|
34e97d53fb | ||
|
bd798f2966 | ||
|
ce8adb0417 | ||
|
28bcbfd311 | ||
|
82c37ccb32 | ||
|
43355e2498 | ||
|
45a2cb5ddd | ||
|
d823aa9220 | ||
|
8135cbb99c | ||
|
bef3f2a33d | ||
|
f8acf49d05 | ||
|
88ccda2bcd | ||
|
d143f972b8 | ||
|
fc491c5dd6 | ||
|
6223715725 | ||
|
2a1c28ee4d | ||
|
d6b735768c | ||
|
e8fcce27c2 | ||
|
45638fa6b1 | ||
|
162458c88e | ||
|
edeb98f406 | ||
|
9939ff6a1f | ||
|
6934d94222 | ||
|
7b22f84f97 | ||
|
055bd0246d | ||
|
330f7da1d3 | ||
|
ae05101d70 | ||
|
2295fb24b7 | ||
|
f365271df3 | ||
|
9b3b367b45 | ||
|
5373d0f184 | ||
|
89c56c2366 | ||
|
e3118ed4da | ||
|
f3b96e4d7f | ||
|
a0832c4459 | ||
|
dbbabbe564 | ||
|
f8a7d38b70 | ||
|
810dbe1582 | ||
|
a5e7cd7cf8 | ||
|
efdac8f9ca | ||
|
3479b2befb | ||
|
290921fe12 | ||
|
03719dea45 | ||
|
c5665da81d | ||
|
0fa3067e5f | ||
|
cedbfba829 | ||
|
9f5dbbe4e9 | ||
|
b0622a10ad | ||
|
ffe6438576 | ||
|
772a96c36f | ||
|
d3157d61a3 | ||
|
4618bed5f6 | ||
|
863e1f4512 | ||
|
98701351c6 | ||
|
c30e0d2ed6 | ||
|
4d8e5795a3 | ||
|
96455422ef | ||
|
e6eac17ef5 | ||
|
151d0ec93a | ||
|
12a1ac10cb | ||
|
e611f24e7f | ||
|
a4776a6b67 | ||
|
a83349d0cc | ||
|
14e03a3766 | ||
|
8b4bbb2196 | ||
|
c6e0d795ff | ||
|
362447a5d2 | ||
|
4d5a2f0d97 | ||
|
bf967b0332 | ||
|
80a969a556 | ||
|
2bfa6d2e5b | ||
|
9ea7ab0c5a | ||
|
72e39d3248 | ||
|
6164ce065d | ||
|
85352fc45d | ||
|
a33f715b26 | ||
|
c52919b9ec | ||
|
092dd096bf | ||
|
e0cb30bf3b | ||
|
bc68ae0ff3 | ||
|
3806284f78 | ||
|
f03f7dcad9 | ||
|
31dcd9b062 | ||
|
45bec627d1 | ||
|
5c8c4c5843 | ||
|
c475cbfe82 | ||
|
596186d81c | ||
|
54883f5134 | ||
|
b262f29756 | ||
|
30e05a5973 | ||
|
64b310953a | ||
|
9c5f26e758 | ||
|
b0e7a816ec | ||
|
d7477885b8 | ||
|
145a194c8b | ||
|
ac379c9c03 | ||
|
2fb04501f7 | ||
|
07861a045d | ||
|
5484680721 | ||
|
d2507c2ff3 | ||
|
2188fa30cd | ||
|
3df9152ec9 | ||
|
518881c70e | ||
|
169fa2fb5e | ||
|
db35390786 | ||
|
ea5fc2f47f | ||
|
c13ce9701a | ||
|
0c9acdcc8e | ||
|
9608b2fcfc | ||
|
70fe61737b | ||
|
240e216c51 | ||
|
a0100a8b48 | ||
|
17e49ee9db | ||
|
7664476e51 | ||
|
a9e72e03f4 | ||
|
54ed75f77d | ||
|
12e517b0e3 | ||
|
2fda1ef070 | ||
|
fc262f2444 | ||
|
5d2e377487 | ||
|
c28b292184 | ||
|
98ef2dad4a | ||
|
86462ed1e5 | ||
|
9d713f0fa5 | ||
|
79d396a1fb | ||
|
f7db9aace7 | ||
|
054e88f7b2 | ||
|
674fc891b4 | ||
|
9ac6470efc | ||
|
5061af0b6e | ||
|
980798fd36 | ||
|
b362cc9d0a |
21
.gitignore
vendored
@ -1,5 +1,20 @@
|
|||||||
|
.DS_Store
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
wtfpython-pypi/build/
|
|
||||||
wtfpython-pypi/dist/
|
# Python-specific byte-compiled files should be ignored
|
||||||
wtfpython-pypi/wtfpython.egg-info
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
irrelevant/.ipynb_checkpoints/
|
||||||
|
|
||||||
|
irrelevant/.python-version
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# Virtual envitonments
|
||||||
|
venv/
|
||||||
|
.venv/
|
||||||
|
1
.npmignore
vendored
@ -1 +0,0 @@
|
|||||||
irrelevant/
|
|
3
.travis.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
language: python
|
||||||
|
install: pip install flake8
|
||||||
|
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
41
CONTRIBUTING.md
vendored
@ -1,10 +1,8 @@
|
|||||||
All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible.
|
All kinds of patches are welcome. Feel free to even suggest some catchy and funny titles for the existing Examples. The goal is to make this collection as interesting to read as possible. Here are a few ways through which you can contribute,
|
||||||
|
|
||||||
If the changes you suggest are siginificant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it.
|
- If you are interested in translating the project to another language (some people have done that in the past), please feel free to open up an issue, and let me know if you need any kind of help.
|
||||||
|
- If the changes you suggest are significant, filing an issue before submitting the actual patch will be appreciated. If you'd like to work on the issue (highly encouraged), you can mention that you're interested in working on it while creating the issue and get assigned to it.
|
||||||
If you're adding a new example, please do create an issue to discuss it before submitting a patch.
|
- If you're adding a new example, it is highly recommended to create an issue to discuss it before submitting a patch. You can use the following template for adding a new example:
|
||||||
|
|
||||||
You can use the following template for adding a new example:
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
### ▶ Some fancy Title *
|
### ▶ Some fancy Title *
|
||||||
@ -27,10 +25,39 @@ Probably unexpected output
|
|||||||
```py
|
```py
|
||||||
Setting up examples for clarification (if necessary)
|
Setting up examples for clarification (if necessary)
|
||||||
```
|
```
|
||||||
**Outupt:**
|
**Output:**
|
||||||
```py
|
```py
|
||||||
>>> trigger # some example that makes it easy to unveil the magic
|
>>> trigger # some example that makes it easy to unveil the magic
|
||||||
# some justified output
|
# some justified output
|
||||||
```
|
```
|
||||||
```
|
```
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
|
Few things that you can consider while writing an example,
|
||||||
|
|
||||||
|
- If you are choosing to submit a new example without creating an issue and discussing, please check the project to make sure there aren't similar examples already.
|
||||||
|
- Try to be consistent with the namings and the values you use with the variables. For instance, most variable names in the project are along the lines of `some_string`, `some_list`, `some_dict`, etc. You'd see a lot of `x`s for single letter variable names, and `"wtf"` as values for strings. There's no strictly enforced scheme in the project as such, but you can take a glance at other examples to get a gist.
|
||||||
|
- Try to be as creative as possible to add that element of "surprise" in the setting up part of an example. Sometimes this may mean writing a snippet a sane programmer would never write.
|
||||||
|
- Also, feel free to add your name to the [contributors list](/CONTRIBUTORS.md).
|
||||||
|
|
||||||
|
**Some FAQs**
|
||||||
|
|
||||||
|
What is is this after every snippet title (###) in the README: <!-- Example ID: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Should it be added manually or can it be ignored when creating new snippets?
|
||||||
|
|
||||||
|
That's a random UUID, it is used to keep identify the examples across multiple translations of the project. As a contributor, you don't have to worry about behind the scenes of how it is used, you just have to add a new random UUID to new examples in that format.
|
||||||
|
|
||||||
|
Where should new snippets be added? Top/bottom of the section, doesn't ?
|
||||||
|
|
||||||
|
There are multiple things that are considered to decide the order (the dependency on the other examples, difficulty level, category, etc). I'd suggest simply adding the new example at the bottom of a section you find more fitting (or just add it to the Miscellaneous section). Its order will be taken care of in future revisions.
|
||||||
|
|
||||||
|
What's the difference between the sections (the first two feel very similar)?
|
||||||
|
|
||||||
|
The section "Strain your brain" contains more contrived examples that you may not really encounter in real life, whereas the section "Slippery Slopes" contains examples that have the potential to be encountered more frequently while programming.
|
||||||
|
|
||||||
|
Before the table of contents it says that markdown-toc -i README.md --maxdepth 3 was used to create it. The pip package markdown-toc does not contain either -i or --maxdepth flags. Which package is meant, or what version of that package?
|
||||||
|
Should the new table of contents entry for the snippet be created with the above command or created manually (in case the above command does more than only add the entry)?
|
||||||
|
|
||||||
|
We use the [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm package to generate ToC. It has some issues with special characters though (I'm not sure if it's fixed yet). More often than not, I just end up inserting the toc link manually at the right place. The tool is handy when I have to big reordering, otherwise just updating toc manually is more convenient imo.
|
||||||
|
|
||||||
|
If you have any questions feel free to ask on [this issue](https://github.com/satwikkansal/wtfpython/issues/269) (thanks to [@LiquidFun](https://github.com/LiquidFun) for starting it).
|
||||||
|
47
CONTRIBUTORS.md
vendored
@ -1,13 +1,42 @@
|
|||||||
I'm really greatful to all the contributors. Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython.
|
Following are the wonderful people (in no specific order) who have contributed their examples to wtfpython.
|
||||||
|
|
||||||
| Contributor | Github | Issues |
|
| Contributor | Github | Issues |
|
||||||
|-------------|--------|--------|
|
|-------------|--------|--------|
|
||||||
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https:/github.com/satwikkansal/wtfpython/issues/36) |
|
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
|
||||||
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https:/github.com/satwikkansal/wtfpython/issues/23) |
|
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
|
||||||
| asottile | [asottile](https://github.com/asottile) | [#40](https:/github.com/satwikkansal/wtfpython/issues/40) |
|
| asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
|
||||||
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https:/github.com/satwikkansal/wtfpython/issues/1) |
|
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
|
||||||
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https:/github.com/satwikkansal/wtfpython/issues/11), [#26](https:/github.com/satwikkansal/wtfpython/issues/26) |
|
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
|
||||||
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https:/github.com/satwikkansal/wtfpython/issues/9) |
|
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
|
||||||
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https:/github.com/satwikkansal/wtfpython/issues/32) |
|
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https://github.com/satwikkansal/wtfpython/issues/32) |
|
||||||
|
| sohaibfarooqi | [sohaibfarooqi](https://github.com/sohaibfarooqi) | [#63](https://github.com/satwikkansal/wtfpython/issues/63) |
|
||||||
|
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
|
||||||
|
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
|
||||||
|
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
|
||||||
|
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
|
||||||
|
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
|
||||||
|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
|
||||||
|
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
|
||||||
|
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
|
||||||
|
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
|
||||||
|
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
|
||||||
|
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
|
||||||
|
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
|
||||||
|
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
|
||||||
|
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
|
||||||
|
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
|
||||||
|
|
||||||
Thank you all for taking out time, and helping to make this project awesome! :smile:
|
---
|
||||||
|
|
||||||
|
**Translations**
|
||||||
|
|
||||||
|
| Translator | Github | Language |
|
||||||
|
|-------------|--------|--------|
|
||||||
|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
|
||||||
|
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
|
||||||
|
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
|
||||||
|
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
|
||||||
|
|
||||||
|
Thank you all for your time and making wtfpython more awesome! :smile:
|
||||||
|
|
||||||
|
PS: This list is updated after every major release, if I forgot to add your contribution here, please feel free to raise a Pull request.
|
||||||
|
74
code-of-conduct.md
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to making participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||||
|
education, socio-economic status, nationality, personal appearance, race,
|
||||||
|
religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
38
images/logo.svg
vendored
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="300px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g><path style="opacity:0.534" fill="#000000" d="M 93.5,49.5 C 106.479,48.4209 118.479,51.2543 129.5,58C 151.339,72.4912 157.172,91.9912 147,116.5C 137.557,132.756 123.391,141.423 104.5,142.5C 104.669,147.181 105.002,151.848 105.5,156.5C 109.607,156.925 113.274,158.425 116.5,161C 121.053,166.43 126.053,171.43 131.5,176C 138.937,179.109 146.604,181.442 154.5,183C 145.628,183.366 137.294,181.366 129.5,177C 124.5,172 119.5,167 114.5,162C 111.852,159.95 108.852,158.784 105.5,158.5C 105.714,175.884 104.881,193.217 103,210.5C 88.7522,229.986 75.7522,250.319 64,271.5C 63.1072,272.711 62.2739,272.711 61.5,271.5C 73.4183,249.987 86.585,229.32 101,209.5C 102.454,195.86 103.62,182.193 104.5,168.5C 103.868,164.183 103.368,159.85 103,155.5C 92.0497,160.785 81.8831,167.285 72.5,175C 67.7905,182.253 62.9572,189.42 58,196.5C 57.5,196 57,195.5 56.5,195C 61.2528,187.493 66.2528,180.16 71.5,173C 80.7973,165.048 91.1306,158.715 102.5,154C 103.803,150.532 103.803,147.032 102.5,143.5C 69.2933,139.465 53.7933,120.798 56,87.5C 60.0825,66.2519 72.5825,53.5853 93.5,49.5 Z M 87.5,53.5 C 82.3351,57.5863 76.6685,60.9196 70.5,63.5C 74.752,57.8701 80.4187,54.5368 87.5,53.5 Z M 92.5,54.5 C 135.035,52.8481 151.202,72.5148 141,113.5C 134.7,128.967 123.2,136.634 106.5,136.5C 64.7957,133.711 50.629,112.711 64,73.5C 65.4578,71.04 67.2911,68.8734 69.5,67C 77.2602,62.7905 84.9269,58.6238 92.5,54.5 Z M 92.5,64.5 C 106.636,61.5508 114.969,67.0508 117.5,81C 115.943,91.5504 109.776,96.7171 99,96.5C 97.8468,99.7111 97.1802,103.044 97,106.5C 94.6194,105.565 92.1194,105.232 89.5,105.5C 85.8309,91.9324 90.8309,85.4324 104.5,86C 108.876,72.8768 104.543,68.7101 91.5,73.5C 87.2971,69.7273 87.6304,66.7273 92.5,64.5 Z M 111.5,65.5 C 112.077,64.2267 112.743,64.2267 113.5,65.5C 113.03,66.463 112.363,66.463 111.5,65.5 Z M 114.5,68.5 C 115.497,67.2875 116.497,67.4542 117.5,69C 116.423,69.4696 115.423,69.3029 114.5,68.5 Z M 117.5,70.5 C 119.852,71.5426 120.019,72.8759 118,74.5C 116.666,73.1221 116.499,71.7887 117.5,70.5 Z M 119.5,75.5 C 120.773,76.0768 120.773,76.7435 119.5,77.5C 118.537,77.0302 118.537,76.3635 119.5,75.5 Z M 144.5,75.5 C 146.856,78.7145 148.356,82.3812 149,86.5C 150.768,98.9946 148.434,110.661 142,121.5C 139.91,124.428 137.41,126.761 134.5,128.5C 145.662,112.482 148.995,94.8151 144.5,75.5 Z M 118.5,79.5 C 120.337,79.6395 120.67,80.3061 119.5,81.5C 118.702,81.0431 118.369,80.3764 118.5,79.5 Z M 100.5,101.5 C 100.783,100.711 101.283,100.044 102,99.5C 102.528,100.816 102.028,101.483 100.5,101.5 Z M 101.5,104.5 C 100.923,105.773 100.257,105.773 99.5,104.5C 99.9698,103.537 100.637,103.537 101.5,104.5 Z M 96.5,112.5 C 101.732,113.702 102.898,116.702 100,121.5C 97.4406,124.349 94.2739,125.183 90.5,124C 87.2091,121.668 86.7091,118.835 89,115.5C 90,114.167 91,114.167 92,115.5C 93.4087,114.219 94.9087,113.219 96.5,112.5 Z M 73.5,130.5 C 87.7227,137.443 102.723,139.943 118.5,138C 105.586,141.789 92.9193,141.123 80.5,136C 77.7339,134.629 75.4006,132.796 73.5,130.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.547" fill="#000000" d="M 99.5,59.5 C 118.613,60.4501 125.446,70.1167 120,88.5C 116.128,93.0516 111.295,95.885 105.5,97C 104.851,100.195 104.018,103.361 103,106.5C 101.806,107.43 100.473,108.097 99,108.5C 95.2825,107.904 91.6158,107.238 88,106.5C 85.4312,99.218 86.2645,92.3846 90.5,86C 94.7594,84.958 99.0928,84.1246 103.5,83.5C 105.947,77.3939 103.947,73.7272 97.5,72.5C 94.9272,73.2525 92.7605,74.5859 91,76.5C 88.6764,73.8629 86.843,70.8629 85.5,67.5C 86.3128,66.1861 87.3128,65.0195 88.5,64C 92.2618,62.5834 95.9285,61.0834 99.5,59.5 Z M 92.5,64.5 C 87.6304,66.7273 87.2971,69.7273 91.5,73.5C 104.543,68.7101 108.876,72.8768 104.5,86C 90.8309,85.4324 85.8309,91.9324 89.5,105.5C 92.1194,105.232 94.6194,105.565 97,106.5C 97.1802,103.044 97.8468,99.7111 99,96.5C 109.776,96.7171 115.943,91.5504 117.5,81C 114.969,67.0508 106.636,61.5508 92.5,64.5 Z M 111.5,65.5 C 112.363,66.463 113.03,66.463 113.5,65.5C 112.743,64.2267 112.077,64.2267 111.5,65.5 Z M 114.5,68.5 C 115.423,69.3029 116.423,69.4696 117.5,69C 116.497,67.4542 115.497,67.2875 114.5,68.5 Z M 117.5,70.5 C 116.499,71.7887 116.666,73.1221 118,74.5C 120.019,72.8759 119.852,71.5426 117.5,70.5 Z M 119.5,75.5 C 118.537,76.3635 118.537,77.0302 119.5,77.5C 120.773,76.7435 120.773,76.0768 119.5,75.5 Z M 118.5,79.5 C 118.369,80.3764 118.702,81.0431 119.5,81.5C 120.67,80.3061 120.337,79.6395 118.5,79.5 Z M 100.5,101.5 C 102.028,101.483 102.528,100.816 102,99.5C 101.283,100.044 100.783,100.711 100.5,101.5 Z M 101.5,104.5 C 100.637,103.537 99.9698,103.537 99.5,104.5C 100.257,105.773 100.923,105.773 101.5,104.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.565" fill="#000000" d="M 201.5,84.5 C 230.503,85.6463 259.503,85.6463 288.5,84.5C 294.507,84.9098 300.507,85.4098 306.5,86C 306.887,100.522 307.554,115.189 308.5,130C 308.109,140.236 307.109,150.403 305.5,160.5C 321.506,157.534 335.006,161.867 346,173.5C 354.246,186.356 352.08,197.19 339.5,206C 331.632,208.547 324.799,212.714 319,218.5C 318,221.167 317,223.833 316,226.5C 313.343,227.573 311.177,229.24 309.5,231.5C 311.422,232.711 313.255,234.044 315,235.5C 315.667,237.167 315.667,238.833 315,240.5C 310.425,245.746 305.258,250.246 299.5,254C 294.97,254.947 290.636,254.447 286.5,252.5C 284.605,250.133 284.105,247.466 285,244.5C 289.21,235.31 296.376,231.143 306.5,232C 308.392,228.442 311.225,225.942 315,224.5C 315.389,219.102 317.889,214.935 322.5,212C 331.254,208.545 339.088,203.712 346,197.5C 351.72,185.315 348.886,175.482 337.5,168C 327.484,162.386 316.818,160.553 305.5,162.5C 306.834,169.656 304.5,175.156 298.5,179C 285.181,180.07 271.847,180.904 258.5,181.5C 242.793,180.438 227.127,178.938 211.5,177C 200.505,176.5 189.505,176.333 178.5,176.5C 177.393,148.181 177.227,119.848 178,91.5C 178.374,90.5838 178.874,89.7504 179.5,89C 186.877,87.0251 194.211,85.5251 201.5,84.5 Z M 199.5,86.5 C 212.855,86.4009 226.188,86.9009 239.5,88C 223.48,89.8508 207.48,89.8508 191.5,88C 194.365,87.8171 197.031,87.3171 199.5,86.5 Z M 276.5,86.5 C 285.884,86.1841 295.218,86.6841 304.5,88C 302.541,89.0963 300.375,89.5963 298,89.5C 288.51,88.8265 279.01,88.3265 269.5,88C 272.036,87.8138 274.369,87.3138 276.5,86.5 Z M 184.5,89.5 C 193.572,90.7076 202.738,91.3742 212,91.5C 241.518,88.8408 271.018,88.8408 300.5,91.5C 301.659,118.76 301.492,146.426 300,174.5C 299.5,175 299,175.5 298.5,176C 273.182,180.597 247.849,180.597 222.5,176C 208.516,175.001 194.516,174.501 180.5,174.5C 178.703,149.358 178.037,124.191 178.5,99C 178.762,96.4528 179.262,93.9528 180,91.5C 181.622,90.9011 183.122,90.2344 184.5,89.5 Z M 303.5,91.5 C 304.465,92.7211 304.298,94.0544 303,95.5C 302.421,94.0715 302.588,92.7382 303.5,91.5 Z M 240.5,100.5 C 251.838,100.333 263.172,100.5 274.5,101C 277.226,101.182 279.893,101.682 282.5,102.5C 282.754,120.447 283.421,138.447 284.5,156.5C 284.441,158.891 284.107,161.225 283.5,163.5C 273.451,163.351 263.284,163.684 253,164.5C 233.502,163.71 214.002,163.043 194.5,162.5C 193.29,143.18 192.29,123.847 191.5,104.5C 208.032,103.86 224.365,102.527 240.5,100.5 Z M 241.5,107.5 C 244.861,108.203 245.194,109.537 242.5,111.5C 241.571,110.311 241.238,108.978 241.5,107.5 Z M 304.5,111.5 C 305.097,111.735 305.43,112.235 305.5,113C 304.683,114.49 303.85,115.99 303,117.5C 302.591,115.305 303.091,113.305 304.5,111.5 Z M 305.5,116.5 C 306.598,117.601 306.765,118.934 306,120.5C 305,122.167 304,123.833 303,125.5C 303.206,122.394 304.039,119.394 305.5,116.5 Z M 305.5,129.5 C 306.27,132.383 305.437,135.05 303,137.5C 302.333,136.167 302.333,134.833 303,133.5C 304.095,132.307 304.928,130.973 305.5,129.5 Z M 252.5,142.5 C 253.5,142.5 254.5,142.5 255.5,142.5C 255.778,144.346 255.111,145.68 253.5,146.5C 252.571,145.311 252.238,143.978 252.5,142.5 Z M 304.5,147.5 C 305.629,149.666 305.129,151.666 303,153.5C 303.15,151.494 303.65,149.494 304.5,147.5 Z M 296.5,234.5 C 301.511,234.334 306.511,234.501 311.5,235C 313.211,236.133 313.711,237.633 313,239.5C 307.764,248.865 299.93,253.032 289.5,252C 286.797,250.18 285.964,247.68 287,244.5C 289.056,240.008 292.223,236.675 296.5,234.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.581" fill="#000000" d="M 258.5,98.5 C 267.212,98.7261 275.879,99.3928 284.5,100.5C 284.977,122.497 285.311,144.497 285.5,166.5C 254.603,165.98 223.77,164.98 193,163.5C 191.215,143.28 190.382,123.114 190.5,103C 213.274,100.85 235.941,99.3501 258.5,98.5 Z M 240.5,100.5 C 224.365,102.527 208.032,103.86 191.5,104.5C 192.29,123.847 193.29,143.18 194.5,162.5C 214.002,163.043 233.502,163.71 253,164.5C 263.284,163.684 273.451,163.351 283.5,163.5C 284.107,161.225 284.441,158.891 284.5,156.5C 283.421,138.447 282.754,120.447 282.5,102.5C 279.893,101.682 277.226,101.182 274.5,101C 263.172,100.5 251.838,100.333 240.5,100.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
|
||||||
|
<g><path style="opacity:1" fill="#3771a2" d="M 245.5,103.5 C 249.619,103.488 253.452,104.488 257,106.5C 258.563,111.718 258.896,117.051 258,122.5C 257.5,124.333 256.333,125.5 254.5,126C 249.447,126.217 244.447,126.717 239.5,127.5C 238.808,128.025 238.308,128.692 238,129.5C 237.502,132.482 237.335,135.482 237.5,138.5C 234.635,138.945 232.135,138.278 230,136.5C 226.638,129.903 226.804,123.403 230.5,117C 236.419,115.804 242.419,115.138 248.5,115C 245.183,114.502 241.85,114.335 238.5,114.5C 238.336,111.813 238.503,109.146 239,106.5C 241.166,105.269 243.333,104.269 245.5,103.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.355" fill="#000000" d="M 197.5,105.5 C 198.289,105.783 198.956,106.283 199.5,107C 195.364,110.545 194.697,110.045 197.5,105.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.461" fill="#000000" d="M 200.5,109.5 C 202.028,109.517 202.528,110.184 202,111.5C 200.333,112.833 198.667,114.167 197,115.5C 196.5,115 196,114.5 195.5,114C 197.24,112.483 198.906,110.983 200.5,109.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.559" fill="#000000" d="M 91.5,110.5 C 95.717,110.447 100.05,110.947 104.5,112C 108.277,119.115 106.277,123.782 98.5,126C 87.2522,127.947 83.7522,123.781 88,113.5C 89.1451,112.364 90.3117,111.364 91.5,110.5 Z M 96.5,112.5 C 94.9087,113.219 93.4087,114.219 92,115.5C 91,114.167 90,114.167 89,115.5C 86.7091,118.835 87.2091,121.668 90.5,124C 94.2739,125.183 97.4406,124.349 100,121.5C 102.898,116.702 101.732,113.702 96.5,112.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.994" fill="#fdd041" d="M 259.5,115.5 C 262.157,115.162 264.49,115.829 266.5,117.5C 272.893,134.625 266.893,141.792 248.5,139C 251.817,139.498 255.15,139.665 258.5,139.5C 259.411,146.925 256.078,150.592 248.5,150.5C 240.385,150.39 237.052,146.39 238.5,138.5C 238.667,135.833 238.833,133.167 239,130.5C 239.833,129.667 240.667,128.833 241.5,128C 246.5,127.667 251.5,127.333 256.5,127C 257.333,126.167 258.167,125.333 259,124.5C 259.498,121.518 259.665,118.518 259.5,115.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.53" fill="#000000" d="M 195.5,194.5 C 226.578,195.56 257.578,197.727 288.5,201C 290.329,201.273 291.829,202.107 293,203.5C 293.695,206.385 294.528,209.218 295.5,212C 291.492,219.977 285.825,226.644 278.5,232C 264.495,231.833 250.495,231.167 236.5,230C 219.234,227.676 201.9,226.01 184.5,225C 181.058,224.573 179.558,222.74 180,219.5C 184.203,210.486 189.37,202.153 195.5,194.5 Z M 196.5,196.5 C 227.585,197.464 258.585,199.63 289.5,203C 291.767,204.081 291.934,205.581 290,207.5C 286.167,211.333 282.333,215.167 278.5,219C 279,219.167 279.5,219.333 280,219.5C 283.934,215.566 287.934,211.566 292,207.5C 292.5,209 293,210.5 293.5,212C 289.644,218.865 284.644,224.865 278.5,230C 247.051,229.389 215.718,227.055 184.5,223C 183.09,222.632 182.09,221.799 181.5,220.5C 186.01,212.136 191.01,204.136 196.5,196.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.528" fill="#000000" d="M 202.5,200.5 C 207.244,200.038 208.244,201.538 205.5,205C 203.866,205.494 202.199,205.66 200.5,205.5C 200.365,203.446 201.032,201.779 202.5,200.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.501" fill="#000000" d="M 211.5,202.5 C 214.896,202.633 215.229,203.633 212.5,205.5C 213.5,206.167 214.5,206.833 215.5,207.5C 213.136,208.82 211.469,208.154 210.5,205.5C 210.685,204.416 211.018,203.416 211.5,202.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.38" fill="#000000" d="M 240.5,204.5 C 242.308,204.491 243.975,204.991 245.5,206C 245,206.5 244.5,207 244,207.5C 242.271,207.026 241.105,206.026 240.5,204.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.511" fill="#000000" d="M 253.5,205.5 C 255.264,204.288 256.93,204.621 258.5,206.5C 256.603,207.652 254.936,207.319 253.5,205.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.47" fill="#000000" d="M 271.5,205.5 C 274.462,205.117 275.462,206.117 274.5,208.5C 272.787,208.121 271.787,207.121 271.5,205.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.519" fill="#000000" d="M 249.5,207.5 C 250.675,207.281 251.675,207.614 252.5,208.5C 250.948,209.798 249.948,209.465 249.5,207.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.612" fill="#000000" d="M 279.5,207.5 C 281.167,207.5 282.833,207.5 284.5,207.5C 284.5,208.5 284.5,209.5 284.5,210.5C 282.396,210.799 280.396,210.466 278.5,209.5C 278.863,208.817 279.196,208.15 279.5,207.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.561" fill="#000000" d="M 199.5,209.5 C 202.68,209.176 203.847,210.51 203,213.5C 201.301,214.406 199.467,214.739 197.5,214.5C 197.392,212.486 198.058,210.82 199.5,209.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.414" fill="#000000" d="M 266.5,209.5 C 267.675,209.281 268.675,209.614 269.5,210.5C 267.948,211.798 266.948,211.465 266.5,209.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.57" fill="#000000" d="M 207.5,210.5 C 208.833,210.5 210.167,210.5 211.5,210.5C 211.143,214.395 209.143,215.395 205.5,213.5C 206.193,212.482 206.859,211.482 207.5,210.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.482" fill="#000000" d="M 236.5,211.5 C 241.645,212.482 241.812,214.149 237,216.5C 235.941,216.37 235.108,215.87 234.5,215C 235.823,214.184 236.489,213.017 236.5,211.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.513" fill="#000000" d="M 108.5,212.5 C 120.3,230.076 130.633,248.743 139.5,268.5C 139.167,268.833 138.833,269.167 138.5,269.5C 128.246,250.659 118.246,231.659 108.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.39" fill="#000000" d="M 219.5,212.5 C 221.549,212.706 221.883,213.539 220.5,215C 219.056,215.781 217.723,215.614 216.5,214.5C 217.602,213.824 218.602,213.158 219.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.435" fill="#000000" d="M 224.5,212.5 C 226.337,212.639 226.67,213.306 225.5,214.5C 224.702,214.043 224.369,213.376 224.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.602" fill="#000000" d="M 193.5,216.5 C 194.833,216.5 196.167,216.5 197.5,216.5C 197.5,217.833 197.5,219.167 197.5,220.5C 195.396,220.799 193.396,220.466 191.5,219.5C 192.193,218.482 192.859,217.482 193.5,216.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.453" fill="#000000" d="M 271.5,216.5 C 276.368,217.09 276.034,218.09 270.5,219.5C 269.833,219.167 269.167,218.833 268.5,218.5C 269.602,217.824 270.602,217.158 271.5,216.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.505" fill="#000000" d="M 213.5,218.5 C 216.022,218.128 218.022,218.961 219.5,221C 219.167,221.333 218.833,221.667 218.5,222C 214.129,222.828 209.795,222.661 205.5,221.5C 207.766,220.686 210.1,220.186 212.5,220C 213.056,219.617 213.389,219.117 213.5,218.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.373" fill="#000000" d="M 223.5,220.5 C 224.978,220.238 226.311,220.571 227.5,221.5C 226.833,221.833 226.167,222.167 225.5,222.5C 224.287,222.253 223.62,221.586 223.5,220.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.606" fill="#000000" d="M 255.5,220.5 C 257.288,220.215 258.955,220.548 260.5,221.5C 258.796,223.849 256.463,224.849 253.5,224.5C 253.527,222.801 254.194,221.467 255.5,220.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.498" fill="#000000" d="M 244.5,221.5 C 245.675,221.281 246.675,221.614 247.5,222.5C 244.272,225.259 243.272,224.926 244.5,221.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.373" fill="#000000" d="M 233.5,222.5 C 234.675,222.281 235.675,222.614 236.5,223.5C 234.948,224.798 233.948,224.465 233.5,222.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.512" fill="#000000" d="M 269.5,222.5 C 271.337,222.639 271.67,223.306 270.5,224.5C 265.586,225.869 265.253,225.203 269.5,222.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.652" fill="#000000" d="M 296.5,236.5 C 297.978,236.238 299.311,236.571 300.5,237.5C 299.68,239.111 298.346,239.778 296.5,239.5C 296.5,238.5 296.5,237.5 296.5,236.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.476" fill="#000000" d="M 309.5,236.5 C 310.289,236.783 310.956,237.283 311.5,238C 306.628,240.039 303.294,243.539 301.5,248.5C 300.686,246.048 301.186,243.715 303,241.5C 305.326,239.934 307.492,238.268 309.5,236.5 Z"/></g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 17 KiB |
38
images/logo_dark_theme.svg
vendored
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="300px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g><path style="opacity:0.534" fill="#fefffe" d="M 93.5,49.5 C 106.479,48.4209 118.479,51.2543 129.5,58C 151.339,72.4912 157.172,91.9912 147,116.5C 137.557,132.756 123.391,141.423 104.5,142.5C 104.669,147.181 105.002,151.848 105.5,156.5C 109.607,156.925 113.274,158.425 116.5,161C 121.053,166.43 126.053,171.43 131.5,176C 138.937,179.109 146.604,181.442 154.5,183C 145.628,183.366 137.294,181.366 129.5,177C 124.5,172 119.5,167 114.5,162C 111.852,159.95 108.852,158.784 105.5,158.5C 105.714,175.884 104.881,193.217 103,210.5C 88.7522,229.986 75.7522,250.319 64,271.5C 63.1072,272.711 62.2739,272.711 61.5,271.5C 73.4183,249.987 86.585,229.32 101,209.5C 102.454,195.86 103.62,182.193 104.5,168.5C 103.868,164.183 103.368,159.85 103,155.5C 92.0497,160.785 81.8831,167.285 72.5,175C 67.7905,182.253 62.9572,189.42 58,196.5C 57.5,196 57,195.5 56.5,195C 61.2528,187.493 66.2528,180.16 71.5,173C 80.7973,165.048 91.1306,158.715 102.5,154C 103.803,150.532 103.803,147.032 102.5,143.5C 69.2933,139.465 53.7933,120.798 56,87.5C 60.0825,66.2519 72.5825,53.5853 93.5,49.5 Z M 87.5,53.5 C 82.3351,57.5863 76.6685,60.9196 70.5,63.5C 74.752,57.8701 80.4187,54.5368 87.5,53.5 Z M 92.5,54.5 C 135.035,52.8481 151.202,72.5148 141,113.5C 134.7,128.967 123.2,136.634 106.5,136.5C 64.7957,133.711 50.629,112.711 64,73.5C 65.4578,71.04 67.2911,68.8734 69.5,67C 77.2602,62.7905 84.9269,58.6238 92.5,54.5 Z M 92.5,64.5 C 106.636,61.5508 114.969,67.0508 117.5,81C 115.943,91.5504 109.776,96.7171 99,96.5C 97.8468,99.7111 97.1802,103.044 97,106.5C 94.6194,105.565 92.1194,105.232 89.5,105.5C 85.8309,91.9324 90.8309,85.4324 104.5,86C 108.876,72.8768 104.543,68.7101 91.5,73.5C 87.2971,69.7273 87.6304,66.7273 92.5,64.5 Z M 111.5,65.5 C 112.077,64.2267 112.743,64.2267 113.5,65.5C 113.03,66.463 112.363,66.463 111.5,65.5 Z M 114.5,68.5 C 115.497,67.2875 116.497,67.4542 117.5,69C 116.423,69.4696 115.423,69.3029 114.5,68.5 Z M 117.5,70.5 C 119.852,71.5426 120.019,72.8759 118,74.5C 116.666,73.1221 116.499,71.7887 117.5,70.5 Z M 119.5,75.5 C 120.773,76.0768 120.773,76.7435 119.5,77.5C 118.537,77.0302 118.537,76.3635 119.5,75.5 Z M 144.5,75.5 C 146.856,78.7145 148.356,82.3812 149,86.5C 150.768,98.9946 148.434,110.661 142,121.5C 139.91,124.428 137.41,126.761 134.5,128.5C 145.662,112.482 148.995,94.8151 144.5,75.5 Z M 118.5,79.5 C 120.337,79.6395 120.67,80.3061 119.5,81.5C 118.702,81.0431 118.369,80.3764 118.5,79.5 Z M 100.5,101.5 C 100.783,100.711 101.283,100.044 102,99.5C 102.528,100.816 102.028,101.483 100.5,101.5 Z M 101.5,104.5 C 100.923,105.773 100.257,105.773 99.5,104.5C 99.9698,103.537 100.637,103.537 101.5,104.5 Z M 96.5,112.5 C 101.732,113.702 102.898,116.702 100,121.5C 97.4406,124.349 94.2739,125.183 90.5,124C 87.2091,121.668 86.7091,118.835 89,115.5C 90,114.167 91,114.167 92,115.5C 93.4087,114.219 94.9087,113.219 96.5,112.5 Z M 73.5,130.5 C 87.7227,137.443 102.723,139.943 118.5,138C 105.586,141.789 92.9193,141.123 80.5,136C 77.7339,134.629 75.4006,132.796 73.5,130.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.547" fill="#fefffe" d="M 99.5,59.5 C 118.613,60.4501 125.446,70.1167 120,88.5C 116.128,93.0516 111.295,95.885 105.5,97C 104.851,100.195 104.018,103.361 103,106.5C 101.806,107.43 100.473,108.097 99,108.5C 95.2825,107.904 91.6158,107.238 88,106.5C 85.4312,99.218 86.2645,92.3846 90.5,86C 94.7594,84.958 99.0928,84.1246 103.5,83.5C 105.947,77.3939 103.947,73.7272 97.5,72.5C 94.9272,73.2525 92.7605,74.5859 91,76.5C 88.6764,73.8629 86.843,70.8629 85.5,67.5C 86.3128,66.1861 87.3128,65.0195 88.5,64C 92.2618,62.5834 95.9285,61.0834 99.5,59.5 Z M 92.5,64.5 C 87.6304,66.7273 87.2971,69.7273 91.5,73.5C 104.543,68.7101 108.876,72.8768 104.5,86C 90.8309,85.4324 85.8309,91.9324 89.5,105.5C 92.1194,105.232 94.6194,105.565 97,106.5C 97.1802,103.044 97.8468,99.7111 99,96.5C 109.776,96.7171 115.943,91.5504 117.5,81C 114.969,67.0508 106.636,61.5508 92.5,64.5 Z M 111.5,65.5 C 112.363,66.463 113.03,66.463 113.5,65.5C 112.743,64.2267 112.077,64.2267 111.5,65.5 Z M 114.5,68.5 C 115.423,69.3029 116.423,69.4696 117.5,69C 116.497,67.4542 115.497,67.2875 114.5,68.5 Z M 117.5,70.5 C 116.499,71.7887 116.666,73.1221 118,74.5C 120.019,72.8759 119.852,71.5426 117.5,70.5 Z M 119.5,75.5 C 118.537,76.3635 118.537,77.0302 119.5,77.5C 120.773,76.7435 120.773,76.0768 119.5,75.5 Z M 118.5,79.5 C 118.369,80.3764 118.702,81.0431 119.5,81.5C 120.67,80.3061 120.337,79.6395 118.5,79.5 Z M 100.5,101.5 C 102.028,101.483 102.528,100.816 102,99.5C 101.283,100.044 100.783,100.711 100.5,101.5 Z M 101.5,104.5 C 100.637,103.537 99.9698,103.537 99.5,104.5C 100.257,105.773 100.923,105.773 101.5,104.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.565" fill="#fefffe" d="M 201.5,84.5 C 230.503,85.6463 259.503,85.6463 288.5,84.5C 294.507,84.9098 300.507,85.4098 306.5,86C 306.887,100.522 307.554,115.189 308.5,130C 308.109,140.236 307.109,150.403 305.5,160.5C 321.506,157.534 335.006,161.867 346,173.5C 354.246,186.356 352.08,197.19 339.5,206C 331.632,208.547 324.799,212.714 319,218.5C 318,221.167 317,223.833 316,226.5C 313.343,227.573 311.177,229.24 309.5,231.5C 311.422,232.711 313.255,234.044 315,235.5C 315.667,237.167 315.667,238.833 315,240.5C 310.425,245.746 305.258,250.246 299.5,254C 294.97,254.947 290.636,254.447 286.5,252.5C 284.605,250.133 284.105,247.466 285,244.5C 289.21,235.31 296.376,231.143 306.5,232C 308.392,228.442 311.225,225.942 315,224.5C 315.389,219.102 317.889,214.935 322.5,212C 331.254,208.545 339.088,203.712 346,197.5C 351.72,185.315 348.886,175.482 337.5,168C 327.484,162.386 316.818,160.553 305.5,162.5C 306.834,169.656 304.5,175.156 298.5,179C 285.181,180.07 271.847,180.904 258.5,181.5C 242.793,180.438 227.127,178.938 211.5,177C 200.505,176.5 189.505,176.333 178.5,176.5C 177.393,148.181 177.227,119.848 178,91.5C 178.374,90.5838 178.874,89.7504 179.5,89C 186.877,87.0251 194.211,85.5251 201.5,84.5 Z M 199.5,86.5 C 212.855,86.4009 226.188,86.9009 239.5,88C 223.48,89.8508 207.48,89.8508 191.5,88C 194.365,87.8171 197.031,87.3171 199.5,86.5 Z M 276.5,86.5 C 285.884,86.1841 295.218,86.6841 304.5,88C 302.541,89.0963 300.375,89.5963 298,89.5C 288.51,88.8265 279.01,88.3265 269.5,88C 272.036,87.8138 274.369,87.3138 276.5,86.5 Z M 184.5,89.5 C 193.572,90.7076 202.738,91.3742 212,91.5C 241.518,88.8408 271.018,88.8408 300.5,91.5C 301.659,118.76 301.492,146.426 300,174.5C 299.5,175 299,175.5 298.5,176C 273.182,180.597 247.849,180.597 222.5,176C 208.516,175.001 194.516,174.501 180.5,174.5C 178.703,149.358 178.037,124.191 178.5,99C 178.762,96.4528 179.262,93.9528 180,91.5C 181.622,90.9011 183.122,90.2344 184.5,89.5 Z M 303.5,91.5 C 304.465,92.7211 304.298,94.0544 303,95.5C 302.421,94.0715 302.588,92.7382 303.5,91.5 Z M 240.5,100.5 C 251.838,100.333 263.172,100.5 274.5,101C 277.226,101.182 279.893,101.682 282.5,102.5C 282.754,120.447 283.421,138.447 284.5,156.5C 284.441,158.891 284.107,161.225 283.5,163.5C 273.451,163.351 263.284,163.684 253,164.5C 233.502,163.71 214.002,163.043 194.5,162.5C 193.29,143.18 192.29,123.847 191.5,104.5C 208.032,103.86 224.365,102.527 240.5,100.5 Z M 241.5,107.5 C 244.861,108.203 245.194,109.537 242.5,111.5C 241.571,110.311 241.238,108.978 241.5,107.5 Z M 304.5,111.5 C 305.097,111.735 305.43,112.235 305.5,113C 304.683,114.49 303.85,115.99 303,117.5C 302.591,115.305 303.091,113.305 304.5,111.5 Z M 305.5,116.5 C 306.598,117.601 306.765,118.934 306,120.5C 305,122.167 304,123.833 303,125.5C 303.206,122.394 304.039,119.394 305.5,116.5 Z M 305.5,129.5 C 306.27,132.383 305.437,135.05 303,137.5C 302.333,136.167 302.333,134.833 303,133.5C 304.095,132.307 304.928,130.973 305.5,129.5 Z M 252.5,142.5 C 253.5,142.5 254.5,142.5 255.5,142.5C 255.778,144.346 255.111,145.68 253.5,146.5C 252.571,145.311 252.238,143.978 252.5,142.5 Z M 304.5,147.5 C 305.629,149.666 305.129,151.666 303,153.5C 303.15,151.494 303.65,149.494 304.5,147.5 Z M 296.5,234.5 C 301.511,234.334 306.511,234.501 311.5,235C 313.211,236.133 313.711,237.633 313,239.5C 307.764,248.865 299.93,253.032 289.5,252C 286.797,250.18 285.964,247.68 287,244.5C 289.056,240.008 292.223,236.675 296.5,234.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.581" fill="#fefffe" d="M 258.5,98.5 C 267.212,98.7261 275.879,99.3928 284.5,100.5C 284.977,122.497 285.311,144.497 285.5,166.5C 254.603,165.98 223.77,164.98 193,163.5C 191.215,143.28 190.382,123.114 190.5,103C 213.274,100.85 235.941,99.3501 258.5,98.5 Z M 240.5,100.5 C 224.365,102.527 208.032,103.86 191.5,104.5C 192.29,123.847 193.29,143.18 194.5,162.5C 214.002,163.043 233.502,163.71 253,164.5C 263.284,163.684 273.451,163.351 283.5,163.5C 284.107,161.225 284.441,158.891 284.5,156.5C 283.421,138.447 282.754,120.447 282.5,102.5C 279.893,101.682 277.226,101.182 274.5,101C 263.172,100.5 251.838,100.333 240.5,100.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
|
||||||
|
<g><path style="opacity:1" fill="#3771a2" d="M 245.5,103.5 C 249.619,103.488 253.452,104.488 257,106.5C 258.563,111.718 258.896,117.051 258,122.5C 257.5,124.333 256.333,125.5 254.5,126C 249.447,126.217 244.447,126.717 239.5,127.5C 238.808,128.025 238.308,128.692 238,129.5C 237.502,132.482 237.335,135.482 237.5,138.5C 234.635,138.945 232.135,138.278 230,136.5C 226.638,129.903 226.804,123.403 230.5,117C 236.419,115.804 242.419,115.138 248.5,115C 245.183,114.502 241.85,114.335 238.5,114.5C 238.336,111.813 238.503,109.146 239,106.5C 241.166,105.269 243.333,104.269 245.5,103.5 Z M 241.5,107.5 C 241.238,108.978 241.571,110.311 242.5,111.5C 245.194,109.537 244.861,108.203 241.5,107.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.355" fill="#fefffe" d="M 197.5,105.5 C 198.289,105.783 198.956,106.283 199.5,107C 195.364,110.545 194.697,110.045 197.5,105.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.461" fill="#fefffe" d="M 200.5,109.5 C 202.028,109.517 202.528,110.184 202,111.5C 200.333,112.833 198.667,114.167 197,115.5C 196.5,115 196,114.5 195.5,114C 197.24,112.483 198.906,110.983 200.5,109.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.559" fill="#fefffe" d="M 91.5,110.5 C 95.717,110.447 100.05,110.947 104.5,112C 108.277,119.115 106.277,123.782 98.5,126C 87.2522,127.947 83.7522,123.781 88,113.5C 89.1451,112.364 90.3117,111.364 91.5,110.5 Z M 96.5,112.5 C 94.9087,113.219 93.4087,114.219 92,115.5C 91,114.167 90,114.167 89,115.5C 86.7091,118.835 87.2091,121.668 90.5,124C 94.2739,125.183 97.4406,124.349 100,121.5C 102.898,116.702 101.732,113.702 96.5,112.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.994" fill="#fdd041" d="M 259.5,115.5 C 262.157,115.162 264.49,115.829 266.5,117.5C 272.893,134.625 266.893,141.792 248.5,139C 251.817,139.498 255.15,139.665 258.5,139.5C 259.411,146.925 256.078,150.592 248.5,150.5C 240.385,150.39 237.052,146.39 238.5,138.5C 238.667,135.833 238.833,133.167 239,130.5C 239.833,129.667 240.667,128.833 241.5,128C 246.5,127.667 251.5,127.333 256.5,127C 257.333,126.167 258.167,125.333 259,124.5C 259.498,121.518 259.665,118.518 259.5,115.5 Z M 252.5,142.5 C 252.238,143.978 252.571,145.311 253.5,146.5C 255.111,145.68 255.778,144.346 255.5,142.5C 254.5,142.5 253.5,142.5 252.5,142.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.53" fill="#fefffe" d="M 195.5,194.5 C 226.578,195.56 257.578,197.727 288.5,201C 290.329,201.273 291.829,202.107 293,203.5C 293.695,206.385 294.528,209.218 295.5,212C 291.492,219.977 285.825,226.644 278.5,232C 264.495,231.833 250.495,231.167 236.5,230C 219.234,227.676 201.9,226.01 184.5,225C 181.058,224.573 179.558,222.74 180,219.5C 184.203,210.486 189.37,202.153 195.5,194.5 Z M 196.5,196.5 C 227.585,197.464 258.585,199.63 289.5,203C 291.767,204.081 291.934,205.581 290,207.5C 286.167,211.333 282.333,215.167 278.5,219C 279,219.167 279.5,219.333 280,219.5C 283.934,215.566 287.934,211.566 292,207.5C 292.5,209 293,210.5 293.5,212C 289.644,218.865 284.644,224.865 278.5,230C 247.051,229.389 215.718,227.055 184.5,223C 183.09,222.632 182.09,221.799 181.5,220.5C 186.01,212.136 191.01,204.136 196.5,196.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.528" fill="#fefffe" d="M 202.5,200.5 C 207.244,200.038 208.244,201.538 205.5,205C 203.866,205.494 202.199,205.66 200.5,205.5C 200.365,203.446 201.032,201.779 202.5,200.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.501" fill="#fefffe" d="M 211.5,202.5 C 214.896,202.633 215.229,203.633 212.5,205.5C 213.5,206.167 214.5,206.833 215.5,207.5C 213.136,208.82 211.469,208.154 210.5,205.5C 210.685,204.416 211.018,203.416 211.5,202.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.38" fill="#fefffe" d="M 240.5,204.5 C 242.308,204.491 243.975,204.991 245.5,206C 245,206.5 244.5,207 244,207.5C 242.271,207.026 241.105,206.026 240.5,204.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.511" fill="#fefffe" d="M 253.5,205.5 C 255.264,204.288 256.93,204.621 258.5,206.5C 256.603,207.652 254.936,207.319 253.5,205.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.47" fill="#fefffe" d="M 271.5,205.5 C 274.462,205.117 275.462,206.117 274.5,208.5C 272.787,208.121 271.787,207.121 271.5,205.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.519" fill="#fefffe" d="M 249.5,207.5 C 250.675,207.281 251.675,207.614 252.5,208.5C 250.948,209.798 249.948,209.465 249.5,207.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.612" fill="#fefffe" d="M 279.5,207.5 C 281.167,207.5 282.833,207.5 284.5,207.5C 284.5,208.5 284.5,209.5 284.5,210.5C 282.396,210.799 280.396,210.466 278.5,209.5C 278.863,208.817 279.196,208.15 279.5,207.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.561" fill="#fefffe" d="M 199.5,209.5 C 202.68,209.176 203.847,210.51 203,213.5C 201.301,214.406 199.467,214.739 197.5,214.5C 197.392,212.486 198.058,210.82 199.5,209.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.414" fill="#fefffe" d="M 266.5,209.5 C 267.675,209.281 268.675,209.614 269.5,210.5C 267.948,211.798 266.948,211.465 266.5,209.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.57" fill="#fefffe" d="M 207.5,210.5 C 208.833,210.5 210.167,210.5 211.5,210.5C 211.143,214.395 209.143,215.395 205.5,213.5C 206.193,212.482 206.859,211.482 207.5,210.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.482" fill="#fefffe" d="M 236.5,211.5 C 241.645,212.482 241.812,214.149 237,216.5C 235.941,216.37 235.108,215.87 234.5,215C 235.823,214.184 236.489,213.017 236.5,211.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.513" fill="#fefffe" d="M 108.5,212.5 C 120.3,230.076 130.633,248.743 139.5,268.5C 139.167,268.833 138.833,269.167 138.5,269.5C 128.246,250.659 118.246,231.659 108.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.39" fill="#fefffe" d="M 219.5,212.5 C 221.549,212.706 221.883,213.539 220.5,215C 219.056,215.781 217.723,215.614 216.5,214.5C 217.602,213.824 218.602,213.158 219.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.435" fill="#fefffe" d="M 224.5,212.5 C 226.337,212.639 226.67,213.306 225.5,214.5C 224.702,214.043 224.369,213.376 224.5,212.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.602" fill="#fefffe" d="M 193.5,216.5 C 194.833,216.5 196.167,216.5 197.5,216.5C 197.5,217.833 197.5,219.167 197.5,220.5C 195.396,220.799 193.396,220.466 191.5,219.5C 192.193,218.482 192.859,217.482 193.5,216.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.453" fill="#fefffe" d="M 271.5,216.5 C 276.368,217.09 276.034,218.09 270.5,219.5C 269.833,219.167 269.167,218.833 268.5,218.5C 269.602,217.824 270.602,217.158 271.5,216.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.505" fill="#fefffe" d="M 213.5,218.5 C 216.022,218.128 218.022,218.961 219.5,221C 219.167,221.333 218.833,221.667 218.5,222C 214.129,222.828 209.795,222.661 205.5,221.5C 207.766,220.686 210.1,220.186 212.5,220C 213.056,219.617 213.389,219.117 213.5,218.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.373" fill="#fefffe" d="M 223.5,220.5 C 224.978,220.238 226.311,220.571 227.5,221.5C 226.833,221.833 226.167,222.167 225.5,222.5C 224.287,222.253 223.62,221.586 223.5,220.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.606" fill="#fefffe" d="M 255.5,220.5 C 257.288,220.215 258.955,220.548 260.5,221.5C 258.796,223.849 256.463,224.849 253.5,224.5C 253.527,222.801 254.194,221.467 255.5,220.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.498" fill="#fefffe" d="M 244.5,221.5 C 245.675,221.281 246.675,221.614 247.5,222.5C 244.272,225.259 243.272,224.926 244.5,221.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.373" fill="#fefffe" d="M 233.5,222.5 C 234.675,222.281 235.675,222.614 236.5,223.5C 234.948,224.798 233.948,224.465 233.5,222.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.512" fill="#fefffe" d="M 269.5,222.5 C 271.337,222.639 271.67,223.306 270.5,224.5C 265.586,225.869 265.253,225.203 269.5,222.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.652" fill="#fefffe" d="M 296.5,236.5 C 297.978,236.238 299.311,236.571 300.5,237.5C 299.68,239.111 298.346,239.778 296.5,239.5C 296.5,238.5 296.5,237.5 296.5,236.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.476" fill="#fefffe" d="M 309.5,236.5 C 310.289,236.783 310.956,237.283 311.5,238C 306.628,240.039 303.294,243.539 301.5,248.5C 300.686,246.048 301.186,243.715 303,241.5C 305.326,239.934 307.492,238.268 309.5,236.5 Z"/></g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 17 KiB |
4
images/string-intern/string_interning.svg
vendored
Executable file
After Width: | Height: | Size: 27 KiB |
4
images/string-intern/string_interning_dark_theme.svg
vendored
Executable file
After Width: | Height: | Size: 28 KiB |
BIN
images/tic-tac-toe/after_board_initialized.png
vendored
Before Width: | Height: | Size: 159 KiB |
4
images/tic-tac-toe/after_board_initialized.svg
vendored
Executable file
After Width: | Height: | Size: 18 KiB |
4
images/tic-tac-toe/after_board_initialized_dark_theme.svg
vendored
Executable file
After Width: | Height: | Size: 19 KiB |
BIN
images/tic-tac-toe/after_row_initialized.png
vendored
Before Width: | Height: | Size: 50 KiB |
4
images/tic-tac-toe/after_row_initialized.svg
vendored
Executable file
After Width: | Height: | Size: 11 KiB |
4
images/tic-tac-toe/after_row_initialized_dark_theme.svg
vendored
Executable file
After Width: | Height: | Size: 12 KiB |
0
irrelevant/generated.md
vendored
24
irrelevant/insert_ids.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import uuid
|
||||||
|
|
||||||
|
new_file = []
|
||||||
|
original_file = []
|
||||||
|
|
||||||
|
fname = "../README.md"
|
||||||
|
|
||||||
|
|
||||||
|
def generate_random_id_comment():
|
||||||
|
random_id = uuid.uuid4()
|
||||||
|
return f"<!-- Example ID: {random_id} --!>"
|
||||||
|
|
||||||
|
|
||||||
|
with open(fname, "r") as f:
|
||||||
|
original_file = f.readlines()
|
||||||
|
|
||||||
|
|
||||||
|
for line in original_file:
|
||||||
|
new_file.append(line)
|
||||||
|
if line.strip().startswith("### "):
|
||||||
|
new_file.append(generate_random_id_comment())
|
||||||
|
|
||||||
|
with open(fname, "w") as f:
|
||||||
|
f.write("".join(new_file))
|
397
irrelevant/notebook_generator.py
Normal file
@ -0,0 +1,397 @@
|
|||||||
|
"""
|
||||||
|
An inefficient monolithic piece of code that'll generate jupyter notebook
|
||||||
|
from the projects main README.
|
||||||
|
|
||||||
|
PS: If you are a recruiter, please don't judge me by this piece of code. I wrote it
|
||||||
|
in hurry. I know this is messy and can be simplified, but I don't want to change it
|
||||||
|
much because it just works.
|
||||||
|
|
||||||
|
Simplifictions and improvements through patches are more than welcome however :)
|
||||||
|
|
||||||
|
|
||||||
|
#TODOs
|
||||||
|
|
||||||
|
- CLI arguments for running this thing
|
||||||
|
- Add it to prepush hook
|
||||||
|
- Add support for skip comments, to skip examples that are not meant for notebook environment.
|
||||||
|
- Use templates?
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import pprint
|
||||||
|
|
||||||
|
fpath = os.path.join(os.path.dirname( __file__ ), '..', 'README.md')
|
||||||
|
examples = []
|
||||||
|
|
||||||
|
# The globals
|
||||||
|
current_example = 1
|
||||||
|
sequence_num = 1
|
||||||
|
current_section_name = ""
|
||||||
|
|
||||||
|
|
||||||
|
STATEMENT_PREFIXES = ["...", ">>> ", "$ "]
|
||||||
|
|
||||||
|
HOSTED_NOTEBOOK_INSTRUCTIONS = """
|
||||||
|
|
||||||
|
## Hosted notebook instructions
|
||||||
|
|
||||||
|
This is just an experimental attempt of browsing wtfpython through jupyter notebooks. Some examples are read-only because,
|
||||||
|
- they either require a version of Python that's not supported in the hosted runtime.
|
||||||
|
- or they can't be reproduced in the notebook envrinonment.
|
||||||
|
|
||||||
|
The expected outputs are already present in collapsed cells following the code cells. The Google colab provides Python2 (2.7) and Python3 (3.6, default) runtimes. You can switch among these for Python2 specific examples. For examples specific to other minor versions, you can simply refer to collapsed outputs (it's not possible to control the minor version in hosted notebooks as of now). You can check the active version using
|
||||||
|
|
||||||
|
```py
|
||||||
|
>>> import sys
|
||||||
|
>>> sys.version
|
||||||
|
# Prints out Python version here.
|
||||||
|
```
|
||||||
|
|
||||||
|
That being said, most of the examples do work as expected. If you face any trouble, feel free to consult the original content on wtfpython and create an issue in the repo. Have fun!
|
||||||
|
|
||||||
|
---
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def generate_code_block(statements, output):
|
||||||
|
"""
|
||||||
|
Generates a code block that executes the given statements.
|
||||||
|
|
||||||
|
:param statements: The list of statements to execute.
|
||||||
|
:type statements: list(str)
|
||||||
|
"""
|
||||||
|
global sequence_num
|
||||||
|
result = {
|
||||||
|
"type": "code",
|
||||||
|
"sequence_num": sequence_num,
|
||||||
|
"statements": statements,
|
||||||
|
"output": output
|
||||||
|
}
|
||||||
|
sequence_num += 1
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def generate_markdown_block(lines):
|
||||||
|
"""
|
||||||
|
Generates a markdown block from a list of lines.
|
||||||
|
"""
|
||||||
|
global sequence_num
|
||||||
|
result = {
|
||||||
|
"type": "markdown",
|
||||||
|
"sequence_num": sequence_num,
|
||||||
|
"value": lines
|
||||||
|
}
|
||||||
|
sequence_num += 1
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def is_interactive_statement(line):
|
||||||
|
for prefix in STATEMENT_PREFIXES:
|
||||||
|
if line.lstrip().startswith(prefix):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def parse_example_parts(lines, title, current_line):
|
||||||
|
"""
|
||||||
|
Parse the given lines and return a dictionary with two keys:
|
||||||
|
build_up, which contains all the text before an H4 (explanation) is encountered,
|
||||||
|
and
|
||||||
|
explanation, which contains all the text after build_up until --- or another H3 is encountered.
|
||||||
|
"""
|
||||||
|
parts = {
|
||||||
|
"build_up": [],
|
||||||
|
"explanation": []
|
||||||
|
}
|
||||||
|
content = [title]
|
||||||
|
statements_so_far = []
|
||||||
|
output_so_far = []
|
||||||
|
next_line = current_line
|
||||||
|
# store build_up till an H4 (explanation) is encountered
|
||||||
|
while not (next_line.startswith("#### ")or next_line.startswith('---')):
|
||||||
|
# Watching out for the snippets
|
||||||
|
if next_line.startswith("```py"):
|
||||||
|
# It's a snippet, whatever found until now is text
|
||||||
|
is_interactive = False
|
||||||
|
output_encountered = False
|
||||||
|
if content:
|
||||||
|
parts["build_up"].append(generate_markdown_block(content))
|
||||||
|
content = []
|
||||||
|
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
while not next_line.startswith("```"):
|
||||||
|
if is_interactive_statement(next_line):
|
||||||
|
is_interactive = True
|
||||||
|
if (output_so_far):
|
||||||
|
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
|
||||||
|
statements_so_far, output_so_far = [], []
|
||||||
|
statements_so_far.append(next_line)
|
||||||
|
else:
|
||||||
|
# can be either output or normal code
|
||||||
|
if is_interactive:
|
||||||
|
output_so_far.append(next_line)
|
||||||
|
elif output_encountered:
|
||||||
|
output_so_far.append(next_line)
|
||||||
|
else:
|
||||||
|
statements_so_far.append(next_line)
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
# Snippet is over
|
||||||
|
parts["build_up"].append(generate_code_block(statements_so_far, output_so_far))
|
||||||
|
statements_so_far, output_so_far = [], []
|
||||||
|
next_line = next(lines)
|
||||||
|
else:
|
||||||
|
# It's a text, go on.
|
||||||
|
content.append(next_line)
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
# Explanation encountered, save any content till now (if any)
|
||||||
|
if content:
|
||||||
|
parts["build_up"].append(generate_markdown_block(content))
|
||||||
|
|
||||||
|
# Reset stuff
|
||||||
|
content = []
|
||||||
|
statements_so_far, output_so_far = [], []
|
||||||
|
|
||||||
|
# store lines again until --- or another H3 is encountered
|
||||||
|
while not (next_line.startswith("---") or
|
||||||
|
next_line.startswith("### ")):
|
||||||
|
if next_line.lstrip().startswith("```py"):
|
||||||
|
# It's a snippet, whatever found until now is text
|
||||||
|
is_interactive = False
|
||||||
|
if content:
|
||||||
|
parts["explanation"].append(generate_markdown_block(content))
|
||||||
|
content = []
|
||||||
|
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
while not next_line.lstrip().startswith("```"):
|
||||||
|
if is_interactive_statement(next_line):
|
||||||
|
is_interactive = True
|
||||||
|
if (output_so_far):
|
||||||
|
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
|
||||||
|
statements_so_far, output_so_far = [], []
|
||||||
|
statements_so_far.append(next_line)
|
||||||
|
else:
|
||||||
|
# can be either output or normal code
|
||||||
|
if is_interactive:
|
||||||
|
output_so_far.append(next_line)
|
||||||
|
else:
|
||||||
|
statements_so_far.append(next_line)
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
# Snippet is over
|
||||||
|
parts["explanation"].append(generate_code_block(statements_so_far, output_so_far))
|
||||||
|
statements_so_far, output_so_far = [], []
|
||||||
|
next_line = next(lines)
|
||||||
|
else:
|
||||||
|
# It's a text, go on.
|
||||||
|
content.append(next_line)
|
||||||
|
next_line = next(lines)
|
||||||
|
|
||||||
|
# All done
|
||||||
|
if content:
|
||||||
|
parts["explanation"].append(generate_markdown_block(content))
|
||||||
|
|
||||||
|
return next_line, parts
|
||||||
|
|
||||||
|
|
||||||
|
def remove_from_beginning(tokens, line):
|
||||||
|
for token in tokens:
|
||||||
|
if line.lstrip().startswith(token):
|
||||||
|
line = line.replace(token, "")
|
||||||
|
return line
|
||||||
|
|
||||||
|
|
||||||
|
def inspect_and_sanitize_code_lines(lines):
|
||||||
|
"""
|
||||||
|
Remove lines from the beginning of a code block that are not statements.
|
||||||
|
|
||||||
|
:param lines: A list of strings, each representing a line in the code block.
|
||||||
|
:returns is_print_present, sanitized_lines: A boolean indicating whether print was present in the original code and a list of strings representing
|
||||||
|
sanitized lines. The latter may be an empty list if all input lines were removed as comments or whitespace (and thus did not contain any statements).
|
||||||
|
This function does not remove blank lines at the end of `lines`.
|
||||||
|
"""
|
||||||
|
tokens_to_remove = STATEMENT_PREFIXES
|
||||||
|
result = []
|
||||||
|
is_print_present = False
|
||||||
|
for line in lines:
|
||||||
|
line = remove_from_beginning(tokens_to_remove, line)
|
||||||
|
if line.startswith("print ") or line.startswith("print("):
|
||||||
|
is_print_present = True
|
||||||
|
result.append(line)
|
||||||
|
return is_print_present, result
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_cells(cell_contents, read_only):
|
||||||
|
"""
|
||||||
|
Converts a list of dictionaries containing markdown and code cells into a Jupyter notebook.
|
||||||
|
|
||||||
|
:param cell_contents: A list of dictionaries, each
|
||||||
|
dictionary representing either a markdown or code cell. Each dictionary should have the following keys: "type", which is either "markdown" or "code",
|
||||||
|
and "value". The value for type = 'markdown' is the content as string, whereas the value for type = 'code' is another dictionary with two keys,
|
||||||
|
statements and output. The statements key contains all lines in between ```py\n``` (including) until ```\n```, while output contains all lines after
|
||||||
|
```.output py\n```.
|
||||||
|
:type cell_contents: List[Dict]
|
||||||
|
|
||||||
|
:param read_only (optional): If True then only print outputs are included in converted
|
||||||
|
cells. Default False
|
||||||
|
:type read_only (optional): bool
|
||||||
|
|
||||||
|
:returns A Jupyter notebook containing all cells from input parameter `cell_contents`.
|
||||||
|
Each converted cell has metadata attribute collapsed set to true if it's code-cell otherwise None if it's markdow-cell.
|
||||||
|
"""
|
||||||
|
cells = []
|
||||||
|
for stuff in cell_contents:
|
||||||
|
if stuff["type"] == "markdown":
|
||||||
|
# todo add metadata later
|
||||||
|
cells.append(
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": stuff["value"]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
elif stuff["type"] == "code":
|
||||||
|
if read_only:
|
||||||
|
# Skip read only
|
||||||
|
# TODO: Fix
|
||||||
|
cells.append(
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": ["```py\n"] + stuff["statements"] + ["```\n"] + ["```py\n"] + stuff['output'] + ["```\n"]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
|
is_print_present, sanitized_code = inspect_and_sanitize_code_lines(stuff["statements"])
|
||||||
|
if is_print_present:
|
||||||
|
cells.append(
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": True,
|
||||||
|
|
||||||
|
},
|
||||||
|
"execution_count": None,
|
||||||
|
"outputs": [{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": stuff["output"]
|
||||||
|
}],
|
||||||
|
"source": sanitized_code
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
cells.append(
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": None,
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": True
|
||||||
|
},
|
||||||
|
"outputs": [{
|
||||||
|
"data": {
|
||||||
|
"text/plain": stuff["output"]
|
||||||
|
},
|
||||||
|
"output_type": "execute_result",
|
||||||
|
"metadata": {},
|
||||||
|
"execution_count": None
|
||||||
|
}],
|
||||||
|
"source": sanitized_code
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return cells
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_notebook(pre_examples_content, parsed_json, post_examples_content):
|
||||||
|
"""
|
||||||
|
Convert a JSON file containing the examples to a Jupyter Notebook.
|
||||||
|
"""
|
||||||
|
result = {
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 2
|
||||||
|
}
|
||||||
|
|
||||||
|
notebook_path = "wtf.ipynb"
|
||||||
|
|
||||||
|
result["cells"] += convert_to_cells([generate_markdown_block(pre_examples_content)], False)
|
||||||
|
|
||||||
|
for example in parsed_json:
|
||||||
|
parts = example["parts"]
|
||||||
|
build_up = parts.get("build_up")
|
||||||
|
explanation = parts.get("explanation")
|
||||||
|
read_only = example.get("read_only")
|
||||||
|
|
||||||
|
if build_up:
|
||||||
|
result["cells"] += convert_to_cells(build_up, read_only)
|
||||||
|
|
||||||
|
if explanation:
|
||||||
|
result["cells"] += convert_to_cells(explanation, read_only)
|
||||||
|
|
||||||
|
result["cells"] += convert_to_cells([generate_markdown_block(post_examples_content)], False)
|
||||||
|
|
||||||
|
#pprint.pprint(result, indent=2)
|
||||||
|
with open(notebook_path, "w") as f:
|
||||||
|
json.dump(result, f, indent=2)
|
||||||
|
|
||||||
|
|
||||||
|
with open(fpath, 'r+', encoding="utf-8") as f:
|
||||||
|
lines = iter(f.readlines())
|
||||||
|
line = next(lines)
|
||||||
|
result = []
|
||||||
|
pre_examples_phase = True
|
||||||
|
pre_stuff = []
|
||||||
|
post_stuff = []
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
if line.startswith("## "):
|
||||||
|
pre_examples_phase = False
|
||||||
|
# A section is encountered
|
||||||
|
current_section_name = line.replace("## ", "").strip()
|
||||||
|
section_text = []
|
||||||
|
line = next(lines)
|
||||||
|
# Until a new section is encountered
|
||||||
|
while not (line.startswith("## ") or line.startswith("# ")):
|
||||||
|
# check if it's a H3
|
||||||
|
if line.startswith("### "):
|
||||||
|
# An example is encountered
|
||||||
|
title_line = line
|
||||||
|
line = next(lines)
|
||||||
|
read_only = False
|
||||||
|
while line.strip() == "" or line.startswith('<!--'):
|
||||||
|
#TODO: Capture example ID here using regex.
|
||||||
|
if '<!-- read-only -->' in line:
|
||||||
|
read_only = True
|
||||||
|
line = next(lines)
|
||||||
|
|
||||||
|
example_details = {
|
||||||
|
"id": current_example,
|
||||||
|
"title": title_line.replace("### ", ""),
|
||||||
|
"section": current_section_name,
|
||||||
|
"read_only": read_only
|
||||||
|
}
|
||||||
|
line, example_details["parts"] = parse_example_parts(lines, title_line, line)
|
||||||
|
result.append(example_details)
|
||||||
|
current_example += 1
|
||||||
|
else:
|
||||||
|
section_text.append(line)
|
||||||
|
line = next(lines)
|
||||||
|
else:
|
||||||
|
if pre_examples_phase:
|
||||||
|
pre_stuff.append(line)
|
||||||
|
else:
|
||||||
|
post_stuff.append(line)
|
||||||
|
line = next(lines)
|
||||||
|
|
||||||
|
except StopIteration as e:
|
||||||
|
#pprint.pprint(result, indent=2)
|
||||||
|
pre_stuff.append(HOSTED_NOTEBOOK_INSTRUCTIONS)
|
||||||
|
result.sort(key = lambda x: x["read_only"])
|
||||||
|
convert_to_notebook(pre_stuff, result, post_stuff)
|
7
irrelevant/notebook_instructions.md
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
## Generating the notebook
|
||||||
|
|
||||||
|
- Expand the relative links in README.md to absolute ones
|
||||||
|
- Remove the TOC in README.md (because Google colab generates its own anyway)
|
||||||
|
- Reorder the examples, so that the ones that work are upfront.
|
||||||
|
- Run the `notebook_generator.py`, it will generate a notebook named `wtf.ipynb`
|
||||||
|
- Revert the README.md changes (optional)
|
@ -139,7 +139,7 @@ f*
|
|||||||
Half triple-quoted strings
|
Half triple-quoted strings
|
||||||
f
|
f
|
||||||
|
|
||||||
Implicity key type conversion
|
Implicit key type conversion
|
||||||
f*
|
f*
|
||||||
|
|
||||||
Stubborn `del` operator
|
Stubborn `del` operator
|
@ -1,6 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
Parses the README.md and generated the table
|
This script parses the README.md and generates the table
|
||||||
`CONTRIBUTORS.md`.
|
`CONTRIBUTORS.md`.
|
||||||
|
|
||||||
|
No longer works since we've moved on contributors to CONTRIBUTORS.md entirely.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pprint
|
import pprint
|
||||||
@ -39,7 +41,7 @@ for handle, issues in contribs.items():
|
|||||||
issue_string = ', '.join([issue_format.format(i, i) for i in issues])
|
issue_string = ', '.join([issue_format.format(i, i) for i in issues])
|
||||||
resp = requests.get(github_rest_api.format(handle))
|
resp = requests.get(github_rest_api.format(handle))
|
||||||
name = handle
|
name = handle
|
||||||
if resp.status_code is 200:
|
if resp.status_code == 200:
|
||||||
pprint.pprint(resp.json()['name'])
|
pprint.pprint(resp.json()['name'])
|
||||||
else:
|
else:
|
||||||
print(handle, resp.content)
|
print(handle, resp.content)
|
||||||
@ -48,4 +50,4 @@ for handle, issues in contribs.items():
|
|||||||
handle,
|
handle,
|
||||||
issue_string))
|
issue_string))
|
||||||
|
|
||||||
print(table_header + "\n".join(rows_so_far))
|
print(table_header + "\n".join(rows_so_far))
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
This inefficient module would parse the README.md in the initial version of
|
This inefficient module would parse the README.md in the initial version of
|
||||||
WTFPython, and enabl me to categorize and reorder a hell lot of examples with
|
WTFPython, and enable me to categorize and reorder a hell lot of examples with
|
||||||
the help of the file `add_categories` (part of which is automatically
|
the help of the file `add_categories` (part of which is automatically
|
||||||
generated).
|
generated).
|
||||||
|
|
||||||
@ -10,6 +10,12 @@ After the refactor, this module would not work now with necessary updates in
|
|||||||
the code.
|
the code.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
raw_input # Python 2
|
||||||
|
except NameError:
|
||||||
|
raw_input = input # Python 3
|
||||||
|
|
||||||
|
|
||||||
fname = "README.md"
|
fname = "README.md"
|
||||||
snippets = []
|
snippets = []
|
||||||
|
|
||||||
@ -80,6 +86,7 @@ with open("add_categories", "r") as f:
|
|||||||
}
|
}
|
||||||
content.next()
|
content.next()
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
|
pass
|
||||||
|
|
||||||
for idx, snip in enumerate(snippets):
|
for idx, snip in enumerate(snippets):
|
||||||
snippets[idx]["category"] = snips_by_title[snip["title"]]["category"]
|
snippets[idx]["category"] = snips_by_title[snip["title"]]["category"]
|
13469
irrelevant/wtf.ipynb
vendored
Normal file
41
package.json
vendored
@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "wtfpython",
|
|
||||||
"version": "2.0.0",
|
|
||||||
"description": "A collection of trick Python snippets and lesser known features",
|
|
||||||
"bin": "wtfpython",
|
|
||||||
"scripts": {
|
|
||||||
"postpublish": "git push origin master",
|
|
||||||
"toc": "doctoc --github --title '# Table of Contents' --maxlevel 3 README.md"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/satwikkansal/wtfPython.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"python",
|
|
||||||
"specification",
|
|
||||||
"notes",
|
|
||||||
"wtf",
|
|
||||||
"learning",
|
|
||||||
"guide",
|
|
||||||
"handbook"
|
|
||||||
],
|
|
||||||
"author": "Satwik Kansal <satwikkansal@gmail.com> (https://satwikkansal.xyz)",
|
|
||||||
"license": "WTFPL 2.0",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/satwikkansal/wtfPython/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/satwikkansal/wtfPython#readme",
|
|
||||||
"devDependencies": {
|
|
||||||
"doctoc": "^1.3.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"boxen": "^1.1.0",
|
|
||||||
"chalk": "^1.1.1",
|
|
||||||
"default-pager": "^1.1.0",
|
|
||||||
"meow": "^3.7.0",
|
|
||||||
"msee": "^0.3.3",
|
|
||||||
"through2": "^2.0.2",
|
|
||||||
"update-notifier": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
63
translations/ru-russian/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
Приветствуются все виды изменений. Не стесняйтесь предлагать броские и смешные названия для существующих примеров. Цель - сделать эту коллекцию как можно более интересной для чтения. Вот несколько способов, с помощью которых вы можете внести свой вклад,
|
||||||
|
|
||||||
|
- Если вы заинтересованы в переводе проекта на другой язык (некоторые люди уже делали это в прошлом), пожалуйста, не стесняйтесь открыть тему и дайте мне знать, если вам нужна какая-либо помощь.
|
||||||
|
- Если изменения, которые вы предлагаете, значительны, то создание issue перед внесением изменений будет оценено по достоинству. Если вы хотите поработать над issue (это очень рекомендуется), выразите свою заинтересованность и вы будете назначены исполнителем.
|
||||||
|
- Если вы добавляете новый пример, настоятельно рекомендуется создать issue, чтобы обсудить ее перед отправкой изменений. Для добавления нового примера вы можете использовать следующий шаблон:
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
### ▶ Какое-то причудливое название. *
|
||||||
|
* в конце названия означает, что пример был добавлен недавно.
|
||||||
|
|
||||||
|
```py
|
||||||
|
# Подготовка кода.
|
||||||
|
# Подготовка к волшебству...
|
||||||
|
```
|
||||||
|
|
||||||
|
**Вывод (версия Python):**
|
||||||
|
```py
|
||||||
|
>>> triggering_statement
|
||||||
|
Вероятно, неожиданный вывод
|
||||||
|
|
||||||
|
```
|
||||||
|
(Необязательно): Одна строка, описывающая неожиданный вывод.
|
||||||
|
|
||||||
|
#### 💡 Объяснение:
|
||||||
|
* Краткое объяснение того, что происходит и почему это происходит.
|
||||||
|
```py
|
||||||
|
Подготовка примеров для пояснения (при необходимости)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Вывод:**
|
||||||
|
```py
|
||||||
|
>>> trigger # пример, облегчающий понимание магии
|
||||||
|
# обоснованный вывод
|
||||||
|
```
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
Несколько моментов, которые стоит учитывать при написании примера,
|
||||||
|
|
||||||
|
- Если вы решили отправить новый пример без создания issue и обсуждения, пожалуйста, проверьте проект, чтобы убедиться, что в нем уже нет похожих примеров.
|
||||||
|
- Старайтесь быть последовательными в именах и значениях, которые вы используете для переменных. Например, большинство имен переменных в проекте имеют вид `some_string`, `some_list`, `some_dict` и т.д. Вы увидите много `x` для однобуквенных имен переменных, и `"wtf"` в качестве значений для строк. В проекте нет строгой схемы, как таковой, но вы можете взглянуть на другие примеры, чтобы понять суть.
|
||||||
|
- Старайтесь быть как можно более креативными, чтобы добавить элемент "сюрприза" во время подготовки примеров. Иногда это может означать написание фрагмента, который здравомыслящий программист никогда бы не написал.
|
||||||
|
- Также не стесняйтесь добавлять свое имя в список [контрибьюторов](/CONTRIBUTORS.md).
|
||||||
|
|
||||||
|
**Некоторые часто задаваемые вопросы**
|
||||||
|
|
||||||
|
Что это такое после каждого заголовка сниппета (###) в README: <!-- ID примера: 30f1d3fc-e267-4b30-84ef-4d9e7091ac1a --->? Нужно ли его добавлять вручную или можно игнорировать при создании новых сниппетов?
|
||||||
|
|
||||||
|
Это случайный UUID, он используется для идентификации примеров в нескольких переводах проекта. Как контрибьютор, вы не должны беспокоиться о том, как он используется, вы просто должны добавлять новый случайный UUID к новым примерам в этом формате.
|
||||||
|
|
||||||
|
Куда следует добавлять новые сниппеты? В начало/в конец раздела?
|
||||||
|
|
||||||
|
При определении порядка учитывается множество факторов (зависимость от других примеров, уровень сложности, категория и т.д.). Я бы предложил просто добавить новый пример в конец раздела, который вы считаете более подходящим (или просто добавить его в раздел "Разное"). О его порядке можно будет позаботиться в будущих редакциях.
|
||||||
|
|
||||||
|
В чем разница между разделами (первые два очень похожи)?
|
||||||
|
|
||||||
|
Раздел "Напрягите мозг" содержит более надуманные примеры, с которыми вы не столкнетесь в реальной жизни, в то время как раздел "Скользкие склоны" содержит примеры, с которыми можно чаще сталкиваться при программировании.
|
||||||
|
|
||||||
|
Перед оглавлением написано, что для его создания использовался markdown-toc -i README.md --maxdepth 3. Пакет pip markdown-toc не содержит ни флагов -i, ни --maxdepth. Какой пакет имеется в виду, или какая версия этого пакета?
|
||||||
|
Должна ли новая запись в оглавлении для фрагмента быть создана с помощью вышеуказанной команды или вручную (в случае, если вышеуказанная команда делает больше, чем просто добавляет запись)?
|
||||||
|
|
||||||
|
Мы используем пакет [markdown-toc](https://www.npmjs.com/package/markdown-toc) npm для создания ToC (содержание). Однако у него есть некоторые проблемы со специальными символами (не уверен, что они уже исправлены). Чаще всего я просто вставляю ссылку toc вручную в нужное место. Инструмент удобен, когда мне нужно сделать большую перестановку, в остальных случаях просто обновлять toc вручную удобнее.
|
||||||
|
|
||||||
|
Если у вас есть вопросы, не стесняйтесь спрашивать в [issue](https://github.com/satwikkansal/wtfpython/issues/269) (спасибо [@LiquidFun](https://github.com/LiquidFun) за ее создание).
|
42
translations/ru-russian/CONTRIBUTORS.md
vendored
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
Ниже перечислены (без определенного порядка) замечательные люди, которые внесли вклад в развитие wtfpython.
|
||||||
|
|
||||||
|
| Автор | Github | Issues |
|
||||||
|
|-------------|--------|--------|
|
||||||
|
| Lucas-C | [Lucas-C](https://github.com/Lucas-C) | [#36](https://github.com/satwikkansal/wtfpython/issues/36) |
|
||||||
|
| MittalAshok | [MittalAshok](https://github.com/MittalAshok) | [#23](https://github.com/satwikkansal/wtfpython/issues/23) |
|
||||||
|
| asottile | [asottile](https://github.com/asottile) | [#40](https://github.com/satwikkansal/wtfpython/issues/40) |
|
||||||
|
| MostAwesomeDude | [MostAwesomeDude](https://github.com/MostAwesomeDude) | [#1](https://github.com/satwikkansal/wtfpython/issues/1) |
|
||||||
|
| tukkek | [tukkek](https://github.com/tukkek) | [#11](https://github.com/satwikkansal/wtfpython/issues/11), [#26](https://github.com/satwikkansal/wtfpython/issues/26) |
|
||||||
|
| PiaFraus | [PiaFraus](https://github.com/PiaFraus) | [#9](https://github.com/satwikkansal/wtfpython/issues/9) |
|
||||||
|
| chris-rands | [chris-rands](https://github.com/chris-rands) | [#32](https://github.com/satwikkansal/wtfpython/issues/32) |
|
||||||
|
| sohaibfarooqi | [sohaibfarooqi](https://github.com/sohaibfarooqi) | [#63](https://github.com/satwikkansal/wtfpython/issues/63) |
|
||||||
|
| ipid | [ipid](https://github.com/ipid) | [#145](https://github.com/satwikkansal/wtfpython/issues/145) |
|
||||||
|
| roshnet | [roshnet](https://github.com/roshnet) | [#140](https://github.com/satwikkansal/wtfpython/issues/140) |
|
||||||
|
| daidai21 | [daidai21](https://github.com/daidai21) | [#137](https://github.com/satwikkansal/wtfpython/issues/137) |
|
||||||
|
| scidam | [scidam](https://github.com/scidam) | [#136](https://github.com/satwikkansal/wtfpython/issues/136) |
|
||||||
|
| pmjpawelec | [pmjpawelec](https://github.com/pmjpawelec) | [#121](https://github.com/satwikkansal/wtfpython/issues/121) |
|
||||||
|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [#112](https://github.com/satwikkansal/wtfpython/issues/112) |
|
||||||
|
| mishaturnbull | [mishaturnbull](https://github.com/mishaturnbull) | [#108](https://github.com/satwikkansal/wtfpython/issues/108) |
|
||||||
|
| MuseBoy | [MuseBoy](https://github.com/MuseBoy) | [#101](https://github.com/satwikkansal/wtfpython/issues/101) |
|
||||||
|
| Ghost account | N/A | [#96](https://github.com/satwikkansal/wtfpython/issues/96) |
|
||||||
|
| koddo | [koddo](https://github.com/koddo) | [#80](https://github.com/satwikkansal/wtfpython/issues/80), [#73](https://github.com/satwikkansal/wtfpython/issues/73) |
|
||||||
|
| jab | [jab](https://github.com/jab) | [#77](https://github.com/satwikkansal/wtfpython/issues/77) |
|
||||||
|
| Jongy | [Jongy](https://github.com/Jongy) | [#208](https://github.com/satwikkansal/wtfpython/issues/208), [#210](https://github.com/satwikkansal/wtfpython/issues/210), [#233](https://github.com/satwikkansal/wtfpython/issues/233) |
|
||||||
|
| Diptangsu Goswami | [diptangsu](https://github.com/diptangsu) | [#193](https://github.com/satwikkansal/wtfpython/issues/193) |
|
||||||
|
| Charles | [charles-l](https://github.com/charles-l) | [#245](https://github.com/satwikkansal/wtfpython/issues/245) |
|
||||||
|
| LiquidFun | [LiquidFun](https://github.com/LiquidFun) | [#267](https://github.com/satwikkansal/wtfpython/issues/267) |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Переводчики**
|
||||||
|
|
||||||
|
| Переводчик | Github | Язык |
|
||||||
|
|-------------|--------|--------|
|
||||||
|
| leisurelicht | [leisurelicht](https://github.com/leisurelicht) | [Chinese](https://github.com/leisurelicht/wtfpython-cn) |
|
||||||
|
| vuduclyunitn | [vuduclyunitn](https://github.com/vuduclyunitn) | [Vietnamese](https://github.com/vuduclyunitn/wtfptyhon-vi) |
|
||||||
|
| José De Freitas | [JoseDeFreitas](https://github.com/JoseDeFreitas) | [Spanish](https://github.com/JoseDeFreitas/wtfpython-es) |
|
||||||
|
| Vadim Nifadev | [nifadyev](https://github.com/nifadyev) | [Russian](https://github.com/satwikkansal/wtfpython/tree/master/translations/ru-russian) |
|
||||||
|
|
||||||
|
Спасибо всем за ваше время и за то, что делаете wtfpython еще более потрясающим! :smile:
|
||||||
|
|
||||||
|
PS: Этот список обновляется после каждого крупного релиза, если я забыл добавить сюда ваш вклад, пожалуйста, не стесняйтесь сделать Pull request.
|
3965
translations/ru-russian/README.md
vendored
Normal file
70
translations/ru-russian/code-of-conduct.md
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# Кодекс Поведения участника
|
||||||
|
|
||||||
|
## Наши обязательства
|
||||||
|
|
||||||
|
Мы, как участники, авторы и лидеры обязуемся сделать участие в сообществе
|
||||||
|
свободным от притеснений для всех, независимо от возраста, телосложения,
|
||||||
|
видимых или невидимых ограничений способности, этнической принадлежности,
|
||||||
|
половых признаков, гендерной идентичности и выражения, уровня опыта,
|
||||||
|
образования, социально-экономического статуса, национальности, внешности,
|
||||||
|
расы, религии, или сексуальной идентичности и ориентации.
|
||||||
|
|
||||||
|
Мы обещаем действовать и взаимодействовать таким образом, чтобы вносить вклад в открытое,
|
||||||
|
дружелюбное, многообразное, инклюзивное и здоровое сообщество.
|
||||||
|
|
||||||
|
## Наши стандарты
|
||||||
|
|
||||||
|
Примеры поведения, создающие условия для благоприятных взаимоотношений включают в себя:
|
||||||
|
|
||||||
|
* Проявление доброты и эмпатии к другим участникам проекта
|
||||||
|
* Уважение к чужой точке зрения и опыту
|
||||||
|
* Конструктивная критика и принятие конструктивной критики
|
||||||
|
* Принятие ответственности, принесение извинений тем, кто пострадал от наших ошибок
|
||||||
|
и извлечение уроков из опыта
|
||||||
|
* Ориентирование на то, что лучше подходит для сообщества, а не только для нас лично
|
||||||
|
|
||||||
|
Примеры неприемлемого поведения участников включают в себя:
|
||||||
|
|
||||||
|
* Использование выражений или изображений сексуального характера и нежелательное сексуальное внимание или домогательство в любой форме
|
||||||
|
* Троллинг, оскорбительные или уничижительные комментарии, переход на личности или затрагивание политических убеждений
|
||||||
|
* Публичное или приватное домогательство
|
||||||
|
* Публикация личной информации других лиц, например, физического или электронного адреса, без явного разрешения
|
||||||
|
* Иное поведение, которое обоснованно считать неуместным в профессиональной обстановке
|
||||||
|
|
||||||
|
## Обязанности
|
||||||
|
|
||||||
|
Лидеры сообщества отвечают за разъяснение и применение наших стандартов приемлемого
|
||||||
|
поведения и будут предпринимать соответствующие и честные меры по исправлению положения
|
||||||
|
в ответ на любое поведение, которое они сочтут неприемлемым, угрожающим, оскорбительным или вредным.
|
||||||
|
|
||||||
|
Лидеры сообщества обладают правом и обязанностью удалять, редактировать или отклонять
|
||||||
|
комментарии, коммиты, код, изменения в вики, вопросы и другой вклад, который не совпадает
|
||||||
|
с Кодексом Поведения, и предоставят причины принятого решения, когда сочтут нужным.
|
||||||
|
|
||||||
|
## Область применения
|
||||||
|
|
||||||
|
Данный Кодекс Поведения применим во всех публичных физических и цифровых пространства сообщества,
|
||||||
|
а также когда человек официально представляет сообщество в публичных местах.
|
||||||
|
Примеры представления проекта или сообщества включают использование официальной электронной почты,
|
||||||
|
публикации в официальном аккаунте в социальных сетях,
|
||||||
|
или упоминания как представителя в онлайн или офлайн мероприятии.
|
||||||
|
|
||||||
|
## Приведение в исполнение
|
||||||
|
|
||||||
|
О случаях домогательства, а так же оскорбительного или иного другого неприемлемого
|
||||||
|
поведения можно сообщить ответственным лидерам сообщества с помощью email.
|
||||||
|
Все жалобы будут рассмотрены и расследованы оперативно и беспристрастно.
|
||||||
|
|
||||||
|
Все лидеры сообщества обязаны уважать неприкосновенность частной жизни и личную
|
||||||
|
неприкосновенность автора сообщения.
|
||||||
|
|
||||||
|
## Атрибуция
|
||||||
|
|
||||||
|
Данный Кодекс Поведения основан на [Кодекс Поведения участника][homepage],
|
||||||
|
версии 2.0, доступной по адресу
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Принципы Воздействия в Сообществе были вдохновлены [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
85
wtfpython
vendored
@ -1,85 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
const obj = require('through2').obj;
|
|
||||||
const pager = require('default-pager');
|
|
||||||
const msee = require('msee');
|
|
||||||
const join = require('path').join;
|
|
||||||
const boxen = require('boxen');
|
|
||||||
const chalk = require('chalk');
|
|
||||||
const updateNotifier = require('update-notifier');
|
|
||||||
const pkg = require('./package.json');
|
|
||||||
const meow = require('meow');
|
|
||||||
|
|
||||||
const cli = meow([
|
|
||||||
'Usage',
|
|
||||||
' bash-handbook',
|
|
||||||
'',
|
|
||||||
'Options',
|
|
||||||
' --lang, -l Translation language',
|
|
||||||
'',
|
|
||||||
'Examples',
|
|
||||||
' bash-handbook',
|
|
||||||
' bash-handbook --lang pt-br'
|
|
||||||
], {
|
|
||||||
string: [
|
|
||||||
'lang'
|
|
||||||
],
|
|
||||||
alias: {
|
|
||||||
l: 'lang',
|
|
||||||
h: 'help'
|
|
||||||
},
|
|
||||||
default: {
|
|
||||||
lang: ''
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const boxenOpts = {
|
|
||||||
borderColor: 'yellow',
|
|
||||||
margin: {
|
|
||||||
bottom: 1
|
|
||||||
},
|
|
||||||
padding: {
|
|
||||||
right: 1,
|
|
||||||
left: 1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const mseeOpts = {
|
|
||||||
paragraphEnd: '\n\n'
|
|
||||||
};
|
|
||||||
|
|
||||||
const notifier = updateNotifier({ pkg });
|
|
||||||
|
|
||||||
process.env.PAGER = process.env.PAGER || 'less';
|
|
||||||
process.env.LESS = process.env.LESS || 'FRX';
|
|
||||||
|
|
||||||
const lang = cli.flags.lang
|
|
||||||
.toLowerCase()
|
|
||||||
.split('-')
|
|
||||||
.map((l, i) => i === 0 ? l : l.toUpperCase())
|
|
||||||
.join('-');
|
|
||||||
|
|
||||||
const translation = join(__dirname, !lang ? './README.md' : `./README-${lang}.md`);
|
|
||||||
|
|
||||||
fs.stat(translation, function (err, stats) {
|
|
||||||
if (err) {
|
|
||||||
console.log('The %s translation does not exist', chalk.bold(lang));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.createReadStream(translation)
|
|
||||||
.pipe(obj(function (chunk, enc, cb) {
|
|
||||||
const message = [];
|
|
||||||
|
|
||||||
if (notifier.update) {
|
|
||||||
message.push(`Update available: {green.bold ${notifier.update.latest}} {dim current: ${notifier.update.current}}`);
|
|
||||||
message.push(`Run {blue npm install -g ${pkg.name}} to update.`);
|
|
||||||
this.push(boxen(message.join('\n'), boxenOpts));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.push(msee.parse(chunk.toString(), mseeOpts));
|
|
||||||
cb();
|
|
||||||
}))
|
|
||||||
.pipe(pager());
|
|
||||||
});
|
|
BIN
wtfpython-pypi/__pycache__/main.cpython-35.pyc
vendored
2190
wtfpython-pypi/content.md
vendored
BIN
wtfpython-pypi/main.pyc
vendored
@ -1,41 +0,0 @@
|
|||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
setup(name='wtfpython',
|
|
||||||
version='0.1.3',
|
|
||||||
description='What the f*ck Python!',
|
|
||||||
author="Satwik Kansal",
|
|
||||||
maintainer="Satwik Kansal",
|
|
||||||
maintainer_email='satwikkansal@gmail.com',
|
|
||||||
url='https://github.com/satwikkansal/wtfpython',
|
|
||||||
platforms='any',
|
|
||||||
license="WTFPL 2.0",
|
|
||||||
long_description="An interesting collection of subtle & tricky Python Snippets"
|
|
||||||
" and features.",
|
|
||||||
keywords="wtfpython gotchas snippets tricky",
|
|
||||||
packages=find_packages(),
|
|
||||||
entry_points = {
|
|
||||||
'console_scripts': ['wtfpython = wtf_python.main:load_and_read']
|
|
||||||
},
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 4 - Beta',
|
|
||||||
|
|
||||||
'Environment :: Console',
|
|
||||||
'Environment :: MacOS X',
|
|
||||||
'Environment :: Win32 (MS Windows)',
|
|
||||||
|
|
||||||
'Intended Audience :: Science/Research',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'Intended Audience :: Education',
|
|
||||||
'Intended Audience :: End Users/Desktop',
|
|
||||||
|
|
||||||
'Operating System :: OS Independent',
|
|
||||||
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 2',
|
|
||||||
|
|
||||||
'Topic :: Documentation',
|
|
||||||
'Topic :: Education',
|
|
||||||
'Topic :: Scientific/Engineering',
|
|
||||||
'Topic :: Software Development'],
|
|
||||||
)
|
|
BIN
wtfpython-pypi/wtf_python/__init__.pyc
vendored
@ -1,35 +0,0 @@
|
|||||||
import pydoc
|
|
||||||
try:
|
|
||||||
from urllib.request import urlretrieve
|
|
||||||
except ImportError:
|
|
||||||
from urllib import urlretrieve
|
|
||||||
|
|
||||||
url = ("https://raw.githubusercontent.com/satwikkansal/"
|
|
||||||
"wtfpython/master/README.md")
|
|
||||||
file_name = "content.md"
|
|
||||||
|
|
||||||
|
|
||||||
def fetch_updated_doc():
|
|
||||||
try:
|
|
||||||
print("Fetching the latest version...")
|
|
||||||
urlretrieve(url, file_name)
|
|
||||||
print("Done!")
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
print("Uh oh, failed to check for the latest version, "
|
|
||||||
"using the local version for now.")
|
|
||||||
|
|
||||||
|
|
||||||
def render_doc():
|
|
||||||
with open(file_name, 'r') as f:
|
|
||||||
content = f.read()
|
|
||||||
pydoc.pager(content)
|
|
||||||
|
|
||||||
|
|
||||||
def load_and_read():
|
|
||||||
fetch_updated_doc()
|
|
||||||
render_doc()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__== "__main__":
|
|
||||||
load_and_read()
|
|
BIN
wtfpython-pypi/wtf_python/main.pyc
vendored
8
wtfpython-pypi/wtfpython
vendored
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from wtf_python.main import load_and_read
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sys.exit(load_and_read())
|
|