diff --git a/diff.txt b/diff.txt index 988571c..0a4bd9b 100644 --- a/diff.txt +++ b/diff.txt @@ -1,2 +1,2 @@ -当前翻译版本对应的原版提交为: cfec971a97750f7315f8b02d4298b0bb32fd9b9d +当前翻译版本对应的原版提交为: f4dcd84ce56a34661e561b824fa2733b4e0c80ff 当前要翻译版本对应的原版提交为: 无 \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile index 9e9d201..963704a 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -19,7 +19,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf latexpdfja text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @@ -183,4 +183,4 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." serve: - cd $(BUILDDIR)/html && python3 -m http.server 8005 + cd $(BUILDDIR)/dirhtml && python3 -m http.server 8005 diff --git a/docs/_extra/ads.txt b/docs/_extra/ads.txt index e42b39f..52291a9 100644 --- a/docs/_extra/ads.txt +++ b/docs/_extra/ads.txt @@ -1,154 +1,340 @@ -google.com, pub-2802445174821308, RESELLER, f08c47fec0942fa0 - - -appnexus.com, 8692, DIRECT, f5ab79cb980f11d1 - - -districtm.io, 100835, DIRECT -appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 -google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 - - -appnexus.com, 1613, reseller -appnexus.com, 3326, reseller -google.com, pub-1409765517756851, reseller -google.com, pub-4075894099602271, reseller -freewheel.tv, 146081, reseller -rubiconproject.com, 8861, reseller, 0bfd66d529a55807 - - -aol.com, 11119, DIRECT -adtech.com, 11341, DIRECT -coxmt.com, 2000067907202, RESELLER -Openx.com, 537143344, RESELLER -indexexchange.com, 175407, RESELLER - - -sonobi.com, 337f0e70cc, DIRECT -rhythmone.com, 1059622079, RESELLER -contextweb.com, 560606, RESELLER - - -sovrn.com, 217352, DIRECT, fafdf38b16bf6b2b -lijit.com, 217352, DIRECT, fafdf38b16bf6b2b -openx.com, 537120960, RESELLER -openx.com, 83499, RESELLER -openx.com, 538959099, RESELLER -pubmatic.com, 137711, RESELLER -pubmatic.com, 156212, RESELLER -pubmatic.com, 62483, RESELLER -contextweb.com, 558511, RESELLER -gumgum.com, 11645, RESELLER, ffdef49475d318a9 - - -openx.com, 539824308, RESELLER, 6a698e2ec38604c6 - - -rubiconproject.com, 17822, DIRECT, 0bfd66d529a55807 - - -gumgum.com, 13174, DIRECT, ffdef49475d318a9 +33across.com, 0010b00002Mpn7AAAR, DIRECT, bbea06d9c4d2853c +33across.com, 0013300001kQj2HAAS, RESELLER, bbea06d9c4d2853c +33across.com, 0013300001qkdlwAAA, RESELLER 33across.com, 0013300001r0t9mAAA, RESELLER +33across.com, 0014000001aXjnGAAS, RESELLER, bbea06d9c4d2853c # 33 Across +33across.com,0013300001r0t9mAAA,reseller,bbea06d9c4d2853c +ad-generation.jp,12474,RESELLER,7f4ea9029ac04e53 +adform.com, 183, RESELLER +adform.com, 2708, DIRECT, 9f5210a2f0999e32 +adtech.com, 10947, DIRECT, e1a5b5b6e3255540 +adtech.com, 11095, RESELLER +adtech.com, 11119, RESELLER +adtech.com, 11208, RESELLER +adtech.com, 11341, DIRECT +adtech.com, 12094, RESELLER +adtech.com, 12094, RESELLER # 33 Across adtech.com, 9904, RESELLER +adtech.com,12068,RESELLER,e1a5b5b6e3255540 +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 +advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 # 33 Across +advertising.com, 11602, RESELLER Advertising.com, 16736, RESELLER +advertising.com, 19623, RESELLER # AOL - One +advertising.com, 24410, RESELLER +advertising.com, 28409, DIRECT, e1a5b5b6e3255540 +advertising.com, 28509, DIRECT, e1a5b5b6e3255540 +advertising.com, 28605, RESELLER # RhythmOne +advertising.com, 7372, RESELLER +advertising.com, 8603, RESELLER # Taboola +amxrtb.com, 105199384, DIRECT +aol.com, 11119, DIRECT +aol.com, 53392, RESELLER # Taboola aolcloud.net, 9904, RESELLER appnexus.com, 1001, RESELLER, f5ab79cb980f11d1 +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 +appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 # 33 Across +appnexus.com, 11786, RESELLER, f5ab79cb980f11d1 +appnexus.com, 11801, RESELLER +appnexus.com, 11924, RESELLER, f5ab79cb980f11d1 +appnexus.com, 12061, RESELLER +appnexus.com, 12263, RESELLER +appnexus.com, 12290, RESELLER, f5ab79cb980f11d1 +appnexus.com, 12366, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1314, RESELLER +Appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1360, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1613, reseller +appnexus.com, 1908, RESELLER +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 +appnexus.com, 1908, RESELLER, f5ab79cb980f11d1 # DistrictM appnexus.com, 1942, RESELLER, f5ab79cb980f11d1 +appnexus.com, 2530, RESELLER appnexus.com, 2758, RESELLER, f5ab79cb980f11d1 appnexus.com, 3135, RESELLER, f5ab79cb980f11d1 +appnexus.com, 3153, DIRECT +appnexus.com, 3153, RESELLER +appnexus.com, 3153, RESELLER, f5ab79cb980f11d1 +appnexus.com, 3326, reseller +appnexus.com, 4052, RESELLER +appnexus.com, 4052, RESELLER, f5ab79cb980f11d1 # Conversant +appnexus.com, 6849, RESELLER, f5ab79cb980f11d1 # RhythmOne +appnexus.com, 7118, RESELLER +appnexus.com, 7556, DIRECT, f5ab79cb980f11d1 appnexus.com, 7597, RESELLER, f5ab79cb980f11d1 +appnexus.com, 7911, RESELLER #yieldmo +appnexus.com, 7944, RESELLER +appnexus.com, 8692, DIRECT, f5ab79cb980f11d1 +appnexus.com, 9316, RESELLER, f5ab79cb980f11d1 # AppNexus +appnexus.com, 9393, DIRECT +appnexus.com, 9393, RESELLER #Video #Display, f5ab79cb980f11d1 +appnexus.com,1001,reseller,f5ab79cb980f11d1 +appnexus.com,10239,reseller,f5ab79cb980f11d1 +appnexus.com,1356,reseller,f5ab79cb980f11d1 +appnexus.com,1908,RESELLER,f5ab79cb980f11d1 +appnexus.com,2758,reseller,f5ab79cb980f11d1 +appnexus.com,3663,RESELLER,f5ab79cb980f11d1 +appnexus.com,7597,reseller,f5ab79cb980f11d1 +appnexus.com,9316,reseller,f5ab79cb980f11d1 +aps.amazon.com,094e2c86-72d9-47d6-a647-d95ce39ad4c7,DIRECT +aps.amazon.com,2840f06c-5d89-4853-a03e-3bfa567dd33c,reseller +aps.amazon.com,48266a61-b3d9-4cb7-b172-553abc6a42a4,DIRECT +aralego.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +audienciad.com, 202922, DIRECT bidtellect.com, 1407, RESELLER, 1c34aa2d85d45e93 +bidtellect.com,1407,reseller,1c34aa2d85d45e93 +brightcom.com, 20292, DIRECT +ccoxmt.com, 2000067997702, RESELLER +consumable.com, 2000908, DIRECT, aefcd3d2f45b5070 contextweb.com, 558355, RESELLER +contextweb.com, 558511, RESELLER +contextweb.com, 560606, RESELLER +contextweb.com, 560606, RESELLER, 89ff185a4c4e857 +contextweb.com, 560606, RESELLER, 89ff185a4c4e857c +contextweb.com, 561118, RESELLER, 89ff185a4c4e857c #yieldmo +contextweb.com, 561998, RESELLER, 89ff185a4c4e857c +contextweb.com, 562350, RESELLER, 89ff185a4c4e857c +contextweb.com,558355,reseller +conversantmedia.com, 20923, RESELLER # Conversant +conversantmedia.com, 39882, DIRECT, 03113cd04947736d +conversantmedia.com, 40790, RESELLER, 03113cd04947736d +conversantmedia.com, 41812, DIRECT +coxmt.com, 2000067907202, RESELLER criteo.com, 109412, DIRECT, 9fac4a4a87c2a44f +districtm.io, 100808, DIRECT +districtm.io, 100835, DIRECT +districtm.io, 100835, DIRECT, 3fd707be9c4527c3 +districtm.io, 101080, RESELLER +districtm.io, 101769, RESELLER, 3fd707be9c4527c3 # DistrictM +districtm.io,100962,RESELLER,3fd707be9c4527c3 +EMXDGT.com, 1133, DIRECT, 1e1d41537f7cad7f +emxdgt.com, 20, DIRECT, 1e1d41537f7cad7f +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f +emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f # 33 Across +EMXDGT.com,1284,reseller,1e1d41537f7cad7f +engagebdr.com, 10417, RESELLER # EngageDBR +freewheel.tv, 146081, reseller +freewheel.tv, 19129, RESELLER +freewheel.tv, 19133, RESELLER +freewheel.tv, 33081, RESELLER +freewheel.tv, 33601, RESELLER +freewheel.tv, 799841, RESELLER # Taboola +freewheel.tv, 799921, RESELLER # Taboola +google.com, pub-1320774679920841, RESELLER, f08c47fec0942fa0 +google.com, pub-1409765517756851, reseller +google.com, pub-2290755540215120, RESELLER, f08c47fec0942fa0 +google.com, pub-2802445174821308, RESELLER, f08c47fec0942fa0 google.com, pub-3848273848634341, RESELLER, f08c47fec0942fa0 +google.com, pub-4075894099602271, reseller +google.com, pub-4207323757133151, RESELLER, f08c47fec0942fa0 +google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 +google.com, pub-5231479214411897, RESELLER, f08c47fec0942fa0 +Google.com, pub-5995202563537249, RESELLER, f08c47fec0942fa0 +google.com, pub-6314168058065736, RESELLER, f08c47fec0942fa0 +google.com, pub-8172268348509349, RESELLER, f08c47fec0942fa0 google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 +google.com, pub-9557089510405422, RESELLER, f08c47fec0942fa0 # 33 Across +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 +google.com, pub-9685734445476814, RESELLER, f08c47fec0942fa0 # DistrictM +google.com,pub-3848273848634341,reseller,f08c47fec0942fa0 +google.com,pub-9557089510405422,reseller,f08c47fec0942fa0 +gumgum.com, 11645, RESELLER, ffdef49475d318a9 +gumgum.com, 13174, DIRECT, ffdef49475d318a9 +gumgum.com, 13318, RESELLER, ffdef49475d318a9 +gumgum.com, 13318, RESELLER, ffdef49475d318a9 # 33 Across +gumgum.com, 13504, RESELLER, ffdef49475d318a9 +gumgum.com,13174,DIRECT,ffdef49475d318a9 +gumgum.com,14141,RESELLER,ffdef49475d318a9 +improvedigital.com, 1362, RESELLER +improvedigital.com, 1669, RESELLER # ImproveDigital +improvedigital.com, 185, RESELLER +indexexchange.com, 175407, RESELLER indexexchange.com, 177754, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 182257, RESELLER, 50b1c356f2c5c8fc # RhythmOne +indexexchange.com, 183965, RESELLER, 50b1c356f2c5c8fc # AOL - One +indexexchange.com, 184914, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 186046, RESELLER +indexexchange.com, 186248, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 187196, DIRECT +indexexchange.com, 187454, DIRECT, 50b1c356f2c5c8fc +indexexchange.com, 189744, RESELLER +indexexchange.com, 189872, RESELLER +indexexchange.com, 191503, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 191740, RESELLER, 50b1c356f2c5c8fc # Index +indexexchange.com, 191923, RESELLER +indexexchange.com, 191973, RESELLER, 50b1c356f2c5c8fc +indexexchange.com, 193351, DIRECT +lijit.com, 217352, DIRECT, fafdf38b16bf6b2b +lijit.com, 217352-eb, DIRECT, fafdf38b16bf6b2b +lijit.com, 248396, DIRECT, fafdf38b16bf6b2b +lijit.com, 248396-eb, DIRECT, fafdf38b16bf6b2b +lijit.com, 260380, RESELLER, fafdf38b16bf6b2b +lijit.com, 270524, RESELLER, fafdf38b16bf6b2b +lijit.com,217352,DIRECT,fafdf38b16bf6b2b lkqd.com, 470, RESELLER, 59c49fa9598a0117 lkqd.net, 470, RESELLER, 59c49fa9598a0117 +Newormedia.com, 2169, DIRECT +newormedia.com, 4908, DIRECT +onetag.com, 572a470226457b8, RESELLER # OneTag +onetag.com, 664e107d9f2b748, RESELLER #yieldmo +onomagic.com, 202921, DIRECT +openx.com, 539824308, RESELLER, 6a698e2ec38604c6 openx.com, 537120563, RESELLER, 6a698e2ec38604c6 +openx.com, 537120563, RESELLER, 6a698e2ec38604c6 # 33 Across +openx.com, 537120960, RESELLER +openx.com, 537127577, RESELLER, 6a698e2ec38604c6 +Openx.com, 537143344, RESELLER openx.com, 537149485, RESELLER, 6a698e2ec38604c6 +openx.com, 537150004, DIRECT, 6a698e2ec38604c6 +openx.com, 537153209, RESELLER, 6a698e2ec38604c6 +openx.com, 538959099, RESELLER +openx.com, 538959099, RESELLER, 6a698e2ec38604c6 +openx.com, 539699341, DIRECT, 6a698e2ec38604c6 +openx.com, 539824308, RESELLER, 6a698e2ec38604c6 openx.com, 540003333, RESELLER, 6a698e2ec38604c6 -outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 +openx.com, 540031703, RESELLER, 6a698e2ec38604c6 # Conversant +openx.com, 540258065, RESELLER, 6a698e2ec38604c6 +openx.com, 540274407, RESELLER, 6a698e2ec38604c6 +openx.com, 540337213, RESELLER, 6a698e2ec38604c6 +openx.com, 540401713, RESELLER, 6a698e2ec38604c6 # OpenX +openx.com, 541159484, RESELLER, 6a698e2ec38604c6 +openx.com, 542511596, RESELLER, 6a698e2ec38604c6 +openx.com, 83499, RESELLER +openx.com,537149485,reseller,6a698e2ec38604c6 +openx.com,540191398,RESELLER,6a698e2ec38604c6 +openx.com,540833447, RESELLER, 6a698e2ec38604c6 outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, DIRECT -pubmatic.com, 50758, RESELLER, 5d62403b186f2ace -revcontent.com, 76611, RESELLER -rhythmone.com, 78519861, RESELLER -smaato.com, 1100033117, RESELLER -spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 -spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 -springserve.com, 686, DIRECT, a24eb641fc82e93d - - -indexexchange.com, 187196, DIRECT - -rhythmone.com, 1059622079, RESELLER, a670c89d4a324e47 -contextweb.com, 560606, RESELLER, 89ff185a4c4e857 -ccoxmt.com, 2000067997702, RESELLER -adtech.com, 11119, RESELLER -33across.com, 0013300001r0t9mAAA, RESELLER -adtech.com, 9904, RESELLER -Advertising.com, 16736, RESELLER -aolcloud.net, 9904, RESELLER -appnexus.com, 7597, RESELLER, f5ab79cb980f11d1 -bidtellect.com, 1407, RESELLER, 1c34aa2d85d45e93 -contextweb.com, 558355, RESELLER -criteo.com, 109412, DIRECT, 9fac4a4a87c2a44f -indexexchange.com, 177754, RESELLER, 50b1c356f2c5c8fc -lkqd.com, 470, RESELLER, 59c49fa9598a0117 -lkqd.net, 470, RESELLER, 59c49fa9598a0117 outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, RESELLER -outbrain.com, 01a755b08c8c22b15d46a8b753ab6955d4, DIRECT -revcontent.com, 76611, RESELLER -smaato.com, 1100033117, RESELLER -spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 -spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 -springserve.com, 686, DIRECT, a24eb641fc82e93d - -33across.com, 0010b00002Mpn7AAAR, DIRECT, bbea06d9c4d2853c -rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 +outbrain.com,00254374f0c468f3b2732db17fd42cb6e5,reseller +pubmatic.com, 137711, RESELLER +pubmatic.com, 137711, RESELLER, 5d62403b186f2ace +pubmatic.com, 156084, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156212, RESELLER +pubmatic.com, 156212, RESELLER, 5d62403b186f2ace +pubmatic.com, 156307, RESELLER, 5d62403b186f2ace # Taboola +pubmatic.com, 156319, DIRECT, 5d62403b186f2ace +pubmatic.com, 156325, RESELLER, 5d62403b186f2ace # AOL - One +pubmatic.com, 156344, RESELLER, 5d62403b186f2ace # Pubmatic pubmatic.com, 156423, RESELLER, 5d62403b186f2ace -appnexus.com, 10239, RESELLER, f5ab79cb980f11d1 -openx.com, 537120563, RESELLER, 6a698e2ec38604c6 -rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 -emxdgt.com, 326, RESELLER, 1e1d41537f7cad7f -gumgum.com, 13318, RESELLER, ffdef49475d318a9 -adtech.com, 12094, RESELLER -advangelists.com, 8d3bba7425e7c98c50f52ca1b52d3735, RESELLER, 60d26397ec060f98 -EMXDGT.com, 1133, DIRECT, 1e1d41537f7cad7f -Appnexus.com, 1356, RESELLER, f5ab79cb980f11d1 -Google.com, pub-5995202563537249, RESELLER, f08c47fec0942fa0 -sharethrough.com, 3a0f657b, DIRECT, d53b998a7bd4ecd2 -spotxchange.com, 212457, RESELLER -spotx.tv, 212457, RESELLER +pubmatic.com, 156423, RESELLER, 5d62403b186f2ace # 33 Across +pubmatic.com, 156458, RESELLER, 5d62403b186f2ace # AOL - One pubmatic.com, 156557, RESELLER -rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 -openx.com, 540274407, RESELLER, 6a698e2ec38604c6 -appnexus.com, 2530, RESELLER -appnexus.com, 3153, DIRECT -advertising.com, 11602, RESELLER -vertamedia.com, 287605, DIRECT, 7de89dc7742b5b11 -vertamedia.com, 287605, RESELLER, 7de89dc7742b5b11 -appnexus.com, 9393, DIRECT -adtech.com, 11095, RESELLER -coxmt.com, 2000067907202, RESELLER -openx.com, 537143344, RESELLER -indexexchange.com, 175407, RESELLER -districtm.io, 100808, DIRECT -appnexus.com, 7944, RESELLER -appnexus.com, 1908, RESELLER -openx.com, 537127577, RESELLER, 6a698e2ec38604c6 -openx.com, 540337213, RESELLER, 6a698e2ec38604c6 +pubmatic.com, 156595, RESELLER, 5d62403b186f2ace +pubmatic.com, 157367, DIRECT, 5d62403b186f2ace +pubmatic.com, 158100, RESELLER, 5d62403b186f2ace +pubmatic.com, 158355 , RESELLER, 5d62403b186f2ace +pubmatic.com, 158723, RESELLER, 5d62403b186f2ace +pubmatic.com, 159117, DIRECT, 5d62403b186f2ace +pubmatic.com, 159277, RESELLER, 5d62403b186f2ace # RhythmOne +pubmatic.com, 159330, RESELLER, 5d62403b186f2ace +pubmatic.com, 159477,RESELLER,5d62403b186f2ace +pubmatic.com, 160082 , RESELLER, 5d62403b186f2ace +pubmatic.com, 160131, RESELLER, 5d62403b186f2ace +pubmatic.com, 32987, RESELLER, 5d62403b186f2ace +pubmatic.com, 50758, RESELLER, 5d62403b186f2ace +pubmatic.com, 62483, RESELLER +pubmatic.com, 79136 , RESELLER, 5d62403b186f2ace +pubmatic.com,157150,RESELLER,5d62403b186f2ace +pubmatic.com,157897,reseller,5d62403b186f2ace +pubmatic.com,160006,RESELLER,5d62403b186f2ace +pubmatic.com,160096,RESELLER,5d62403b186f2ace +pubnative.net, 1007284, RESELLER, d641df8625486a7b #yieldmodisplay +pubnative.net, 1007285, RESELLER, d641df8625486a7b #yieldmonative +pubnative.net, 1007286, RESELLER, d641df8625486a7b #yieldmovideo +pubnx.com, 337-1, RESELLER, 8728b7e97e589da4 # Vertoz +revcontent.com, 76611, RESELLER +rhythmone.com, 1059622079, RESELLER +rhythmone.com, 1059622079, RESELLER, a670c89d4a324e47 rhythmone.com, 1114124056, RESELLER, a670c89d4a324e47 +rhythmone.com, 1166984029, RESELLER, a670c89d4a324e47 # Taboola rhythmone.com, 2241341073, RESELLER, a670c89d4a324e47 +rhythmone.com, 2310154583, DIRECT, a670c89d4a324e47 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 +rhythmone.com, 2439829435, RESELLER, a670c89d4a324e47 # 33 Across +rhythmone.com, 78519861, RESELLER +rhythmone.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne +rhythmone.com,1654642120,RESELLER,a670c89d4a324e47 +rhythmone.com,2310154583,DIRECT,a670c89d4a324e47 +rhythmone.com,78519861,reseller,a670c89d4a324e47 rtk.io, 819, DIRECT +rubiconproject.com, 13344, RESELLER, 0bfd66d529a55807 # Rubicon +rubiconproject.com, 15268, RESELLER, 0bfd66d529a55807 # RhythmOne +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 16414, RESELLER, 0bfd66d529a55807 # 33 Across +rubiconproject.com, 17070, RESELLER, 0bfd66d529a55807 #yieldmo +rubiconproject.com, 17632, DIRECT, 0bfd66d529a55807 rubiconproject.com, 17790, RESELLER, 0bfd66d529a55807 rubiconproject.com, 17792, RESELLER, 0bfd66d529a55807 - - -triplelift.com, 7205, DIRECT, 6c33edb13117fd86 -appnexus.com, 1314, RESELLER -spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 +rubiconproject.com, 17822, DIRECT, 0bfd66d529a55807 +rubiconproject.com, 17822, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 17960, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 18222, RESELLER, 0bfd66d529a55807 # AOL - One +rubiconproject.com, 18694, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 18890, DIRECT, 0bfd66d529a55807 +rubiconproject.com, 20130, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 20416, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 21310, RESELLER , 0bfd66d529a55807 +rubiconproject.com, 21642, RESELLER, 0bfd66d529a55807 +rubiconproject.com, 8861, reseller, 0bfd66d529a55807 +rubiconproject.com,18020,RESELLER,0bfd66d529a55807 +Sekindo.com, 20749, DIRECT, b6b21d256ef43532 +sharethrough.com, 3a0f657b, DIRECT, d53b998a7bd4ecd2 +sharethrough.com, d09156e5, RESELLER, d53b998a7bd4ecd2 +smaato.com, 1100033117, RESELLER +smaato.com, 1100047713, RESELLER, 07bcf65f187117b4 +smaato.com,1100044650,RESELLER,07bcf65f187117b4 +smartadserver.com, 3436, RESELLER +sonobi.com, 337f0e70cc, DIRECT +sonobi.com, 37dd19ad4a, RESELLER, d1a215d9eb5aee9e +sonobi.com, 6e5cfb5420, DIRECT, d1a215d9eb5aee9e +sonobi.com, e55fb5d7c2, DIRECT, d1a215d9eb5aee9e +sovrn.com, 217352, DIRECT, fafdf38b16bf6b2b +sovrn.com, 248396, DIRECT, fafdf38b16bf6b2b +sovrn.com, 260380, RESELLER, fafdf38b16bf6b2b +sovrn.com, 270524, RESELLER, fafdf38b16bf6b2b +sovrn.com,217352,DIRECT,fafdf38b16bf6b2b +sparcmedia.com, 310627, Direct +spotx.tv, 108933, RESELLER, 7842df1d2fe2db34 +spotx.tv, 147949, RESELLER, 7842df1d2fe2db34 +spotx.tv, 212457, RESELLER spotx.tv, 228454, RESELLER, 7842df1d2fe2db34 - -google.com, pub-4641608711979091, DIRECT, f08c47fec0942fa0 -Newormedia.com, 2169, DIRECT +spotx.tv, 270977, DIRECT, 7842df1d2fe2db34 +spotx.tv, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne +spotx.tv, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +spotx.tv, 84294, RESELLER, 7842df1d2fe2db34 +spotx.tv, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +spotxchange.com, 108933, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 147949, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 212457, RESELLER +spotxchange.com, 228454, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 270977, DIRECT, 7842df1d2fe2db34 +spotxchange.com, 285547, RESELLER, 7842df1d2fe2db34 # RhythmOne +spotxchange.com, 71451, RESELLER, 7842df1d2fe2db34 # Taboola +spotxchange.com, 84294, RESELLER, 7842df1d2fe2db34 +spotxchange.com, 94794, RESELLER, 7842df1d2fe2db34 # SpotX +springserve.com, 686, DIRECT, a24eb641fc82e93d +synacor.com, 82350, RESELLER, e108f11b2cdf7d5b +synacor.com,82151,reseller,e108f11b2cdf7d5b +teads.tv, 19014, DIRECT, 15a9c44f6d26cbe1 +telaria.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +telaria.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +telaria.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +themediagrid.com, P5JONV, RESELLER, 35d5010d7789b49d # Media Grid (IPONWEB) +tremorhub.com, mb9eo-oqsbf, RESELLER, 1a4e959a1b50034a +tremorhub.com, vtrdn-wjdav, DIRECT, 1a4e959a1b50034a +tremorhub.com, vtrdn-ysjam, DIRECT, 1a4e959a1b50034a +tremorhub.com, z87wm, RESELLER, 1a4e959a1b50034a # Taboola +triplelift.com, 7205, DIRECT, 6c33edb13117fd86 +ucfunnel.com, par-488A3E6BD8D997D0ED8B3BD34D8BA4B, RESELLER # ucFunnel +vertamedia.com, 287605, DIRECT, 7de89dc7742b5b11 +vertamedia.com, 287605, RESELLER, 7de89dc7742b5b11 +video.unrulymedia.com, 2310154583, DIRECT +video.unrulymedia.com, 905992537, RESELLER, a670c89d4a324e47 # RhythmOne +yahoo.com, 55771, RESELLER, e1a5b5b6e3255540 +yahoo.com, 55104, DIRECT, e1a5b5b6e3255540 +yahoo.com, 55317, RESELLER # Verizon +yahoo.com, 57289, RESELLER, e1a5b5b6e3255540 +yahoo.com, 57695, DIRECT, e1a5b5b6e3255540 +yahoo.com,55029,RESELLER,e1a5b5b6e3255540 +yieldmo.com, 2417496099628458357, DIRECT diff --git a/docs/dev/env.rst b/docs/dev/env.rst index d38c3a1..24373b6 100644 --- a/docs/dev/env.rst +++ b/docs/dev/env.rst @@ -120,6 +120,14 @@ Atom是web原生的(HTML、CSS、JS),专注于模块化的设计和简单 和大量的包。Python开发所推荐的插件是 `Linter `_ 和 `linter-flake8 `_ 的组合。 +Python (on Visual Studio Code) +------------------------------ + +`Python for Visual Studio Code `_ 是 `Visual Studio Code `_ 的扩展。 +它是一个免费、轻量级的开源编辑器,支持 Mac、Windows 和 Linux。 +使用 Node.js 和 Python 等开源技术构建,具有 Intellisense(自动完成)、本地和远程调试、linting 等引人注目的功能。 + +MIT 许可。 IDEs :::: @@ -130,7 +138,7 @@ PyCharm / IntelliJ IDEA `PyCharm `_ 由JetBrains公司开发,此公司还以 IntelliJ IDEA闻名。它们都共享着相同的基础代码,PyCharm中大多数特性能通过免费的 `Python 插件 `_ -带入到IntelliJ中。PyCharm由两个版本:专业版(Professional Edition)(30天试用)和 +带入到IntelliJ中。PyCharm有两个版本:专业版(Professional Edition)(30天试用)和 拥有相对少特性的社区版(Community Edition)(Apache 2.0 License)。 Python (在 Visual Studio Code 中) @@ -200,6 +208,16 @@ Eric (The Eric Python IDE) Python Shell、集成的调试器和灵活的插件系统等功能。它基于Qt GUI工具集,使用Python编写, 集成了Scintilla编辑器控制。Eric是一款超过10年活跃开发的开源软件工程(GPLv3许可)。 +Mu +-- + +`Mu `_ 是一个极简的 Python IDE,它可以在本地运行 Python 3 代码,也可以将代码部署到 BBC micro:bit +和运行 CircuitPython 的 Adafruit 板上。 + +Mu 为初学者设计,包含一个 Python 3 解释器,易于安装在 Windows、OS/X 和 Linux 上,还能在 Raspberry Pi 上很好地运行。 + +gitter 上有一个 Mu 活跃的支持社区。 + 解释器工具 ::::::::::::::::: diff --git a/docs/dev/pip-virtualenv.rst b/docs/dev/pip-virtualenv.rst index f0179ca..69aee49 100644 --- a/docs/dev/pip-virtualenv.rst +++ b/docs/dev/pip-virtualenv.rst @@ -67,7 +67,7 @@ Pip和Virtualenv的更多配置 .. code-block:: console gpip() { - PIP_REQUIRE_VIRTUALENV="" pip "$@" + PIP_REQUIRE_VIRTUALENV=false pip "$@" } 在保存完这个修改以及使用 ``source ~/.bashrc`` 来source一下 :file:`~/.bashrc` diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst index 1ed3ff6..5581b60 100644 --- a/docs/dev/virtualenvs.rst +++ b/docs/dev/virtualenvs.rst @@ -137,7 +137,7 @@ Pipenv 将在您的项目目录中安装超赞的 `Requests`_ 库并为您创建 Adding requests to Pipfile's [packages]... P.S. You have excellent taste! ✨ 🍰 ✨ -.. _Requests: http://docs.python-requests.org/en/master/ +.. _Requests: https://requests.readthedocs.io/en/latest/ 使用安装好的包 @@ -392,4 +392,4 @@ direnv $ brew install direnv -在Linux上,根据 `direnv.net ` 上的指南进行。 +在 Linux 上,根据 `direnv.net `_ 上的指南进行。 diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst index 32c8bdd..02c2655 100644 --- a/docs/intro/learning.rst +++ b/docs/intro/learning.rst @@ -136,7 +136,7 @@ Python Koans是Edgecase's Ruby Koans的迁移版。它使用测试驱动的方 对于那些使用语言并找出自己的困惑的人来说,这会是个有趣并有吸引力的选择。对于新手来说, 拥有一个额外的资源或者参考会是很有用的。 - `Python Koans `_ + `Python Koans `_ 要了解更多关于测试驱动开发的内容,可以查看以下资源: @@ -204,7 +204,7 @@ Pro Python 本书是面向从中级到高级,想明白Python是如何以及为何这样工作,如何将代码水平提高一级的 Python程序员。 - `Pro Python `_ + `Pro Python `_ Expert Python Programming @@ -218,7 +218,7 @@ Expert Python Programming讲解编写Python的最佳实践,并专注更高级 zc.buildout的一个章节。后面的章节详细讲述了最佳实践,比如编写文档、测试驱动开发、 版本控制、优化和分析。 - `Expert Python Programming `_ + `Expert Python Programming `_ A Guide to Python's Magic Methods diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst index 64d8c8a..4c49e95 100644 --- a/docs/scenarios/admin.rst +++ b/docs/scenarios/admin.rst @@ -138,42 +138,42 @@ Psutil # 用于email服务的包: import smtplib import string - MAX_NET_USAGE = 400000 + MAX_NET_USAGE = 400000 # 每秒字节数 MAX_ATTACKS = 4 attack = 0 - counter = 0 while attack <= MAX_ATTACKS: sleep(4) - counter = counter + 1 - # Check the cpu usage - if cpu_percent(interval = 1) > 70: - attack = attack + 1 - # Check the net usage - neti1 = net_io_counters()[1] - neto1 = net_io_counters()[0] + + # 使用命名元组检查网络使用情况 + neti1 = net_io_counters().bytes_recv + neto1 = net_io_counters().bytes_sent sleep(1) - neti2 = net_io_counters()[1] - neto2 = net_io_counters()[0] - # Calculate the bytes per second + neti2 = net_io_counters().bytes_recv + neto2 = net_io_counters().bytes_sent + + # 计算每秒字节数 net = ((neti2+neto2) - (neti1+neto1))/2 - if net > MAX_NET_USAGE: - attack = attack + 1 - if counter > 25: - attack = 0 - counter = 0 + + # 检查网络和cpu使用 + if (net > MAX_NET_USAGE) or (cpu_percent(interval = 1) > 70): + attack+=1 + elif attack > 1: + attack-=1 + # 如果attack大于4,就编写一封十分重要的email TO = "you@your_email.com" FROM = "webmaster@your_domain.com" SUBJECT = "Your domain is out of system resources!" text = "Go and fix your server!" - BODY = string.join(("From: %s" %FROM,"To: %s" %TO,"Subject: %s" %SUBJECT, "",text), "\r\n") + string="\r\n" + BODY = string.join(("From: %s" %FROM,"To: %s" %TO, + "Subject: %s" %SUBJECT, "",text)) server = smtplib.SMTP('127.0.0.1') server.sendmail(FROM, [TO], BODY) server.quit() -一个类似于基于psutil并广泛扩展的top,并拥有客服端-服务端监控能力的完全终端应用叫做 -`glance `_ 。 +一个基于psutil,类似于top命令并广泛扩展的功能全面的终端应用程序叫做 `glance `_ ,它具备客户端-服务端监控能力。 ******* @@ -348,13 +348,3 @@ Buildout 它实现了配置和构建脚本分离的原则。Buildout主要用于下载和设置正在开发或部署软件的 `Python eggs ` 格式的依赖。 在任何环境中构建任务的指南(recipe,原意为“食谱”,引申为“指南”)能被创建,许多早已可用。 - - -******* -Shinken -******* - -`Shinken `_ 是一个使用Python编写的现代化的兼容Nagios的监控框架。 -其主要目标是为用户的设计成可扩展到大型环境的监控系统提供灵活的框架。 - -Shinken与Nagios配置标准和插件向后兼容。它适用于任何支持Python的操作系统和架构,包括Windows、Linux和FreeBSD。 \ No newline at end of file diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst index c7f13f1..1b0ada5 100644 --- a/docs/scenarios/cli.rst +++ b/docs/scenarios/cli.rst @@ -27,7 +27,7 @@ Click ***** -`click `_ 是一个以尽可能少的代码,用组合方式创建命令行接口的Python包。 +`click `_ 是一个以尽可能少的代码,用组合方式创建命令行接口的Python包。 命令行接口创建工具(“Command-Line Interface Creation Kit”, Click)高度可配置,但也有开箱即用的默认值设置。 diff --git a/docs/scenarios/client.rst b/docs/scenarios/client.rst index 600a70a..d9ac9d9 100644 --- a/docs/scenarios/client.rst +++ b/docs/scenarios/client.rst @@ -19,7 +19,7 @@ Python的urllib2标准模块涵盖了所需的大多数HTTP功能,但它的API Requests将所有Python HTTP相关的功能剥离了出来,并与网络服务无缝衔接。Requests无需再在URL中添加查询语句或格式编码的POST数据。而集成在Requests中urllib3,则实现了持久连接和HTTP连接池的完全自动化。 -- `文档 `_ +- `文档 `_ - `PyPI http://pypi.org/project/requests>`_ - `GitHub `_ diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst index f761065..0848a32 100644 --- a/docs/scenarios/gui.rst +++ b/docs/scenarios/gui.rst @@ -71,12 +71,14 @@ PySide ****** PySide是跨平台的Qt GUI工具包的Python绑定。 +它的包名取决于主要的 Qt 版本(`PySide` 用于 Qt4,`PySide2` 用于 Qt5,`PySide6` 用于 Qt6)。 +这组绑定由 `Qt 公司 `_ 开发。 .. code-block:: console - $ pip install pyside + $ pip install pyside6 -https://wiki.qt.io/Category:LanguageBindings::PySide::Downloads +https://pyside.org **** diff --git a/docs/scenarios/json.rst b/docs/scenarios/json.rst index 88ae519..0edb045 100644 --- a/docs/scenarios/json.rst +++ b/docs/scenarios/json.rst @@ -5,7 +5,7 @@ JSON .. image:: https://farm5.staticflickr.com/4174/33928819683_97b5c6a184_k_d.jpg -`json `_ 库可以自字符串或文件中解析JSON。 +`json `_ 库可以自字符串或文件中解析JSON。 该库解析JSON后将其转为Python字典或者列表。它也可以转换Python字典或列表为JSON字符串。 @@ -45,21 +45,3 @@ JSON print(json.dumps(d)) '{"first_name": "Guido", "last_name": "Rossum", "titles": ["BDFL", "Developer"]}' - - -********** -simplejson -********** - -json库是Python2.6版中加入的。如果您使用更早版本的Python, -可以通过PyPI获取 `simplejson `_ 库。 - -simplejson类似json标准库,它使得使用老版本Python的开发者们可以使用json库中的最新特性。 - -如果json库不可用,您可以将simplejson取别名为json来使用: - -.. code-block:: python - - import simplejson as json - -在将simplejson当成json导入后,上面的例子会像您在使用标准json库一样正常运行。 \ No newline at end of file diff --git a/docs/scenarios/ml.rst b/docs/scenarios/ml.rst index c37ec6e..e5caf4e 100644 --- a/docs/scenarios/ml.rst +++ b/docs/scenarios/ml.rst @@ -15,7 +15,7 @@ SciPy 栈(SciPy stack) ********************************* SciPy 栈由数据科学所使用的一组核心帮助包组成,用于统计分析和数据可视化。 -由于其庞大的功能和易用性,scripy栈被认为是大多数数据科学应用的必备条件。 +由于其庞大的功能和易用性,SciPy 栈被认为是大多数数据科学应用的必备条件。 该栈包含以下包(提供文档链接): diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst index 02d4b57..15b322a 100644 --- a/docs/scenarios/scrape.rst +++ b/docs/scenarios/scrape.rst @@ -23,7 +23,7 @@ lxml和Requests ***************** `lxml `_ 是一个优美的扩展库,用来快速解析XML以及HTML文档 -即使所处理的标签非常混乱。我们也将使用 `Requests `_ +即使所处理的标签非常混乱。我们也将使用 `Requests `_ 模块取代内建的urllib2模块,因为其速度更快而且可读性更好。您可以通过使用 ``pip install lxml`` 与 ``pip install requests`` 命令来安装这两个模块。 @@ -74,8 +74,8 @@ XPath是一种在结构化文档(如HTML或XML)中定位信息的方式。 .. code-block:: python - print 'Buyers: ', buyers - print 'Prices: ', prices + print('Buyers: ', buyers) + print('Prices: ', prices) :: diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst index 82b7852..7c4ab8e 100644 --- a/docs/scenarios/speed.rst +++ b/docs/scenarios/speed.rst @@ -155,25 +155,25 @@ Cython .. code-block:: python import time - #启动pyx编译器 + # 启动pyx编译器 import pyximport pyximport.install() - #Cython的素数算法实现 + # Cython的素数算法实现 import primesCy - #Python的素数算法实现 + # Python的素数算法实现 import primes - print "Cython:" + print("Cython:") t1= time.time() - print primesCy.primes(500) + print(primesCy.primes(500)) t2= time.time() - print "Cython time: %s" %(t2-t1) - print "" - print "Python" + print("Cython time: %s" %(t2-t1)) + print("") + print("Python") t1= time.time() - print primes.primes(500) + print(primes.primes(500)) t2= time.time() - print "Python time: %s" %(t2-t1) + print("Python time: %s" %(t2-t1)) 这两行代码需要一些说明: diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst index 158470e..648b3ba 100644 --- a/docs/scenarios/web.rst +++ b/docs/scenarios/web.rst @@ -221,14 +221,6 @@ Heroku 维护了使用Python和Heroku交互的 `详细文章 `_(被称为Gondor)是由Kubernetes、CoreOS和Docker提供的PaaS。 -它们支持任一WSGI应用程序,并提供了部署 -`Django项目 `_ 的指南。 - - ********** 模板 diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst index 30ad1d5..e10d75d 100644 --- a/docs/scenarios/xml.rst +++ b/docs/scenarios/xml.rst @@ -78,3 +78,30 @@ xmltodict xmltodict 也有unparse函数让您可以转回XML。该函数有一个streaming模式适合用来 处理不能放入内存的文件,它还支持命名空间。 + +********** +xmlschema +********** + +`xmlschema `_ 提供了在Python中使用XSD模式的支持。 +与其他XML库不同,它提供了自动类型解析功能。因此,例如,如果模式定义一个元素为 ``int`` 类型,解析后的 ``dict`` 也将包含该元素的 ``int`` 值。 +此外,该库支持自动和显式验证XML文档是否符合模式。 + +.. code-block:: python + + from xmlschema import XMLSchema, etree_tostring + + # 加载XSD模式文件 + schema = XMLSchema("your_schema.xsd") + + # 验证是否符合模式 + schema.validate("your_file.xml") + + # 或者 + schema.is_valid("your_file.xml") + + # 解码文件 + data = schmema.decode("your_file.xml") + + # 编码为字符串 + s = etree_tostring(schema.encode(data)) diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst index 37d8303..df825ba 100644 --- a/docs/shipping/packaging.rst +++ b/docs/shipping/packaging.rst @@ -178,4 +178,4 @@ bdist_rpm命令使得 `producing an RPM file `_ - `alien `_ -- `dh-virtualenv `_ (for APT/DEB omnibus packaging) +- `dh-virtualenv `_ (用于 APT/DEB 综合打包) diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst index 7d19d69..24a4558 100644 --- a/docs/starting/install/osx.rst +++ b/docs/starting/install/osx.rst @@ -10,9 +10,9 @@ .. note:: 查看我们的 :ref:`在OS X上安装Python 3指南`. -Mac OS X 自带 Python 2.7。 +Mac OS X的 10.8~12.3 版本自带 Python 2.7。 -您不必安装和配置即可直接使用Python进行开发。 +如果您的Mac OS X版本在上述版本之间,不必安装和配置即可直接使用Python进行开发。 话虽如此,我还是强烈建议各位,在正式开始Python应用开发前,安装接下来教程中所介绍的工具和库。 特别应该安装Setuptools——它将简化安装和使用Python第三方库的流程。 diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst index d6a5ce9..32859e1 100644 --- a/docs/starting/install3/linux.rst +++ b/docs/starting/install3/linux.rst @@ -7,7 +7,7 @@ .. image:: https://farm5.staticflickr.com/4276/34435689480_2e6f358510_k_d.jpg -这份文档描述了如何在Ubuntu Linux机器上安装Python 3.6。 +这份文档描述了如何在Ubuntu Linux机器上安装Python 3.6 或 3.8。 想要获取已安装的Python 3版本号,可以通过终端运行命令: @@ -20,12 +20,12 @@ $ sudo apt-get update $ sudo apt-get install python3.6 -如果您使用的是其他版本的Ubuntu(比如LTS发行版),我们推荐使用 `deadsnakes PPA `_ 来安装 Python 3.6:: +如果您使用的是其他版本的Ubuntu(例如最新的 LTS 版本)或者您想使用更新的Python,我们建议使用 `deadsnakes PPA `_ 安装Python 3.8:: $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update - $ sudo apt-get install python3.6 + $ sudo apt-get install python3.8 如果您使用的是其他Linux发行版,有可能已经预装了Python 3。如果没有,使用发行版的包管理器。 比如,在Fedora上您可以使用 `dnf`: @@ -35,7 +35,7 @@ $ sudo dnf install python3 注意,如果 ``python3`` 包的版本不够新,还有其他方式安装更新的版本,这取决于所在的发行版。 -比如在Fedora 25上安装 ``python36`` 包来获取Python 3.6。如果您是Fedora用户,您可能想 +比如在Fedora 32上安装 ``python3.9`` 包来获取Python 3.9。如果您是Fedora用户,您可能想 阅读 `Fedora中可用的多Python版本`_ 。 .. _Fedora中可用的多Python版本: https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html @@ -45,19 +45,19 @@ 使用Python 3 ********************* -这个时候,在您系统上可能Python 2.7也是可用的。 +这个时候,在您系统上Python 2.7可能也是可用的。 .. code-block:: console $ python -将打开Python 2解释器。 +可能打开Python 2解释器。 .. code-block:: console $ python3 -将打开Python 3解释器。 +将会打开Python 3解释器。 **************** diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst index 6622a86..0aee256 100644 --- a/docs/starting/install3/osx.rst +++ b/docs/starting/install3/osx.rst @@ -9,9 +9,9 @@ .. image:: https://farm5.staticflickr.com/4276/34435689480_2e6f358510_k_d.jpg -Mac OS X 自带 Python 2.7。 +Mac OS X的 10.8~12.3 版本自带 Python 2.7。 -您不必安装和配置即可直接使用Python 2。本教程用来说明Python 3的安装。 +如果您的Mac OS X版本在上述版本之间,不必安装和配置即可直接使用Python 2。本教程用来说明Python 3的安装。 OS X自带的Python版本更适合用于学习而不是开发。因为版本与Python官网发布的 `官方最新稳定版本 `_ 相比可能已经过时。 @@ -41,7 +41,7 @@ OS X自带的Python版本更适合用于学习而不是开发。因为版本与P .. code-block:: console - $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 运行这段脚本将列出它会引起的改变,并在安装开始前提示您。 安装完成Homebrew后,需将其所在路径插入到 :envvar:`PATH` 环境变量的最前面,即在您所登录用户的 diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst index d06fa93..b5695e2 100644 --- a/docs/starting/which-python.rst +++ b/docs/starting/which-python.rst @@ -8,7 +8,7 @@ .. _which-python: *************************** -Python的现状 (2 vs 3) +Python的现状 (3 vs 2) *************************** 当选择Python解释器的时候,一个首先要面对的问题是:“我应该选择Python 2还是Python 3?” 答案并不像人们想象的那么明显。 @@ -16,9 +16,9 @@ Python的现状 (2 vs 3) 现状的基本要点如下: -1. 如今大部分生产应用使用 Python 2.7。 +1. 如今大部分生产应用使用 Python 3。 2. Python 3 已准备好用于生产应用的部署。 -3. Python 2.7 直到 2020 前只会得到必要的安全更新 [#pep373_eol]_。 +3. Python 2.7 已在 2020 年 1 月终止维护 [#pep373_eol]_。 4. “Python” 涵盖了 Python 3 和 Python 2。 @@ -36,10 +36,6 @@ Python的现状 (2 vs 3) - 将 Python 3 用于新的 Python 应用程序。 - 如果您是第一次学习 Python,熟悉 Python 2.7 将是非常有用的,但学习 Python 3 更有用。 - 两者都学。它们都是 “Python”。 -- 已经构建的软件通常依赖于 Python 2.7。 -- 如果您正在编写一个新的开源 Python 库,最好同时为 Python 2 和 3 编写。 - 若新库只支持 Python 3 会是一项政治声明,并将疏远您的许多用户。 - 这不是一个问题 —— 慢慢地,在未来三年内,这种情况会减少。 ****************** @@ -52,14 +48,10 @@ Python的现状 (2 vs 3) 鉴于此,如果您有一个强有力的理由只用Python 2,比如Python 3 没有足够能替代的Python 2 的特有库,或者您(像我)非常喜爱而且受Python 2启发。 -查看 `Can I Use Python 3? `_ 来看看是否有您 -依赖的软件阻止您用Python 3。 - `延伸阅读 `_ 写 `能够同时兼容Python 2.6,2.7,和Python 3的代码 `_ 是可能的。 -这包括从简单到困难的各种难度,取决于您所写软件的类型;如果您是初学者,其实有更重要的东西要操心。请注意,Python 2.6 -是生命周期结束的上游,所以您不应该试着编写兼容2.6的代码,除非您被专门安排做这件事。 +这包括从简单到困难的各种难度,取决于您所写软件的类型;如果您是初学者,其实有更重要的东西要操心。 *************** @@ -102,7 +94,7 @@ Jython 如果您需要与现有的Java代码库对接或者基于其他原因需要为JVM编写Python代码,那么 Jython是最好的选择。 -Jython现在支持到Python 2.7 [#jython_ver]_。 +Jython现在支持到Python 2.7 [#jython_ver]_ 。 IronPython 3 [#iron_ver3]_ 正在开发中,但截止到 2020 年 9 月尚未准备好。 IronPython ---------- @@ -115,23 +107,26 @@ IronPython到Visual Studio开发环境中,使之成为Windows开发者的理 IronPython支持Python 2.7 [#iron_ver]_。 -PythonNet ---------- +Python.Net +---------- `Python for .NET `_ 是一个近乎无缝集成的, 提供给本机已安装的Python .NET公共语言运行时(CLR)包。它采取与IronPython (见上文)相反的方法,与其说是竞争,不如说是互补。 -PythonNet与Mono相结合使用,通过.NET框架,能使Python在非windows系统上(如OS X和Linux)完成操作。它可以在除外IronPython的环境中无冲突运行。 +Python.Net与Mono相结合使用,通过.NET框架,能使Python在非windows系统上(如OS X和Linux)完成操作。它可以在除外IronPython的环境中无冲突运行。 -PythonNet支持Python 2.3到2.7 [#pythonnet_ver]_。 +Python.Net兼容Python 2.7和3.5-3.8 [#pythonnet_ver1]_ 。 -.. [#pep373_eol] https://www.python.org/dev/peps/pep-0373/#id2 -.. [#pypy_ver] http://pypy.org/compat.html +.. [#pypy_ver] https://pypy.org/compat.html .. [#jython_ver] https://hg.python.org/jython/file/412a8f9445f7/NEWS -.. [#iron_ver] http://ironpython.codeplex.com/releases/view/81726 +.. [#iron_ver] https://ironpython.net/download/ -.. [#pythonnet_ver] http://pythonnet.github.io/readme.html +.. [#iron_ver3] https://github.com/IronLanguages/ironpython3 + +.. [#pythonnet_ver1] https://pythonnet.github.io/ + +.. [#pep373_eol] https://www.python.org/dev/peps/pep-0373/#id2 diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst index 6937d38..1027e2e 100644 --- a/docs/writing/documentation.rst +++ b/docs/writing/documentation.rst @@ -74,8 +74,7 @@ Sphinx_ 无疑是最流行的Python文档工具。**请使用它吧。** 它能 reStructuredText ~~~~~~~~~~~~~~~~ -大多数Python文档是用 reStructuredText_ 编写的。它就像是内建了所有可选扩展的 -Markdown。 +大多数Python文档是用 reStructuredText_ 编写的。它和Markdown类似,但内建了所有可选扩展。 `reStructuredText Primer`_ 和 `reStructuredText Quick Reference`_ 应该会帮助 您熟悉它的语法。 diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst index 67ea8fd..101d8fe 100644 --- a/docs/writing/gotchas.rst +++ b/docs/writing/gotchas.rst @@ -223,7 +223,7 @@ Python的闭包是 *迟绑定* 。 流行的版本控制系统能够使用文件中定义的通配符来应用特殊规则。 一份忽略文件将确保匹配的文件未被检入存储库。 -Git_ 使用 ``.gitignore``,而 Mercurial_ 使用``.hgignore```。 +Git_ 使用 ``.gitignore``,而 Mercurial_ 使用 ``.hgignore``。 .. _Git: https://git-scm.com/ .. _Mercurial: https://www.mercurial-scm.org/ diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst index 40a0775..74eda11 100644 --- a/docs/writing/logging.rst +++ b/docs/writing/logging.rst @@ -20,11 +20,11 @@ 并结合其他用户资料构成用户报告或者用来优化商业目标。 ************************** -... 或者打印? +... 或者打印(Print)? ************************** -当需要在命令行应用中显示帮助文档时, ``打印`` 是一个相对于日志更好的选择。 -而在其他时候,日志总能优于 ``打印`` ,理由如下: +当需要在命令行应用中显示帮助文档时, ``print`` 是一个相对于日志更好的选择。 +而在其他时候,日志总能优于 ``print`` ,理由如下: - 日志事件产生的 `日志记录`_ ,包含清晰可用的诊断信息,如文件名称、路径、函数名和行号等。 - 包含日志模块的应用,默认可通过根记录器对应用的日志流进行访问,除非您将日志过滤了。 diff --git a/docs/writing/reading.rst b/docs/writing/reading.rst index 0bbbae6..f57d0e9 100644 --- a/docs/writing/reading.rst +++ b/docs/writing/reading.rst @@ -32,7 +32,7 @@ - `Requests `_ Requests是Apache2许可的HTTP库,使用Python编写。 -- `Tablib `_ +- `Tablib `_ Tablib是无格式的表格数据集库,使用Python编写。 diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst index 097d911..f8412d7 100644 --- a/docs/writing/structure.rst +++ b/docs/writing/structure.rst @@ -46,7 +46,7 @@ 仓库样例 ::::::::::::::::: -**请看这里**: 这是 `Kenneth Reitz在2013年推荐的 `_ 。 +**请看这里**: 这是 `Kenneth Reitz在2013年推荐的 `_ 。 这个仓库 `可以在GitHub上找到 `__ 。 @@ -104,7 +104,7 @@ License 如果您不太清楚您应该使用哪种许可方式,请查看 `choosealicense.com `_. -当然,您也可以在发布您的代码时不做任何许可说明,但是这显然阻碍潜在的用户使用您的代码。 +当然,您也可以在发布您的代码时不做任何许可说明,但是这会阻碍潜在的用户使用或参与贡献您的代码。 Setup.py :::::::: @@ -148,7 +148,7 @@ Test Suite :::::::::: -*想了解关于编写测试的建议,请查阅 :doc:`/writing/tests`。* +*想了解关于编写测试的建议,请查阅* :doc:`/writing/tests`。 .. csv-table:: :widths: 20, 40 @@ -630,7 +630,7 @@ Python提供两种内置或用户定义的类型。可变类型允许内容的 my_list = [1, 2, 3] my_list[0] = 4 - print my_list # [4, 2, 3] <- 原列表改变了 + print(my_list) # [4, 2, 3] <- 原列表改变了 x = 6 x = x + 1 # x 变量是一个新的变量 @@ -655,7 +655,7 @@ Python 中一个可能会让初学者惊讶的特性是:字符串是不可变 nums = "" for n in range(20): nums += str(n) # 慢且低效 - print nums + print(nums) **更好** @@ -665,7 +665,7 @@ Python 中一个可能会让初学者惊讶的特性是:字符串是不可变 nums = [] for n in range(20): nums.append(str(n)) - print "".join(nums) # 更高效 + print("".join(nums)) # 更高效 **最好** @@ -673,7 +673,7 @@ Python 中一个可能会让初学者惊讶的特性是:字符串是不可变 # 创建将0到19连接起来的字符串 (例 "012..1819") nums = [str(n) for n in range(20)] - print "".join(nums) + print("".join(nums)) 最后关于字符串的说明的一点是,使用 ``join()`` 并不总是最好的选择。比如当用预先 diff --git a/docs/writing/style.rst b/docs/writing/style.rst index 0811f6d..4eec944 100644 --- a/docs/writing/style.rst +++ b/docs/writing/style.rst @@ -60,9 +60,9 @@ Python代码具有高可读性的其中一个原因是它的相对完整的代 .. code-block:: python - print 'one'; print 'two' + print('one'); print('two') - if x == 1: print 'one' + if x == 1: print('one') if and : # do something @@ -71,11 +71,11 @@ Python代码具有高可读性的其中一个原因是它的相对完整的代 .. code-block:: python - print 'one' - print 'two' + print('one') + print('two') if x == 1: - print 'one' + print('one') cond1 = cond2 = @@ -303,9 +303,7 @@ com/questions/302459/what-is-a-programming-idiom>`_ 上有充足的讨论。 .. code-block:: python - four_lists = [[] for __ in xrange(4)] - -注意:在 Python 3 中使用 range() 而不是 xrange() + four_lists = [[] for __ in range(4)] 根据列表来创建字符串 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -418,8 +416,7 @@ PEP 8 :pep:`8` 是Python事实上的代码风格指南,我们可以在 `pep8.org `_ 上获得高质量的、易读的PEP 8版本。 -强烈推荐阅读这部分。整个Python社区都尽力遵循本文档中规定的准则。一些项目可能受其影响, -而其他项目可能 `修改其建议 `_。 +强烈推荐阅读这部分。整个Python社区都尽力遵循本文档中规定的准则。一些项目可能受其影响,而其他项目可能修改其建议。 也就是说,让您的 Python 代码遵循 PEP 8 通常是个好主意,这也有助于在与其他开发人员 一起工作时使代码更加具有可持续性。命令行程序 pycodestyle ``_ @@ -443,22 +440,63 @@ PEP 8 optparse.py:472:29: E221 multiple spaces before operator optparse.py:544:21: W601 .has_key() is deprecated, use 'in' -程序 `autopep8 `_ 能自动将代码格式化 -成 PEP 8 风格。用以下指令安装此程序: +自动格式化 +~~~~~~~~~~~~~~~~~~ + +有许多满足PEP 8规范的自动格式化代码工具。 + +**autopep8** + +`autopep8 `_ 程序能自动将代码格式化 +成 PEP 8 风格。用以下命令安装此程序: .. code-block:: console $ pip install autopep8 -用以下指令格式化一个文件: +用以下命令格式化一个文件: .. code-block:: console $ autopep8 --in-place optparse.py -不包含 ``--in-place`` 标志将会使得程序直接将更改的代码输出到控制台,以供审查。 +不包含 ``--in-place`` 选项将会使得程序直接将更改的代码输出到控制台,以供审查。 ``--aggressive`` 标志则会执行更多实质性的变化,而且可以多次使用以达到更佳的效果。 +**yapf** + +autopep8专注于解决PEP 8的合规性,而 `yapf `_ 除了满足PEP 8规范,还能够优化代码格式。 +它旨在提供编写PEP 8兼容代码的同时还能保持美观。用以下命令安装此程序: + +.. code-block:: console + + $ pip install yapf + +用以下命令格式化一个文件: + +.. code-block:: console + + $ yapf --in-place optparse.py + +与 autopep8 类似,运行不带 ``--in-place`` 选项的命令将输出差异以供审查,而不会应用格式化结果。 + +**black** + +自动格式化程序 `black `_ 对代码库进行确定的格式化。 +它专注于提供统一的代码风格,而无需用户进行配置。因此,black 的用户可以完全忘记格式化。 +此外,得益于确定的实现,可以保证git diff时只有最小化的改动。用以下命令安装此程序: + +.. code-block:: console + + $ pip install black + +用以下命令格式化一个文件: + +.. code-block:: console + + $ black optparse.py + +添加 ``--diff`` 选项的命令将输出差异以供审查,而不会应用格式化结果。 *********** 约定 @@ -478,10 +516,10 @@ PEP 8 .. code-block:: python if attr == True: - print 'True!' + print('True!') if attr == None: - print 'attr is None!' + print('attr is None!') **优雅**: @@ -489,15 +527,15 @@ PEP 8 # 检查值 if attr: - print 'attr is truthy!' + print('attr is truthy!') # 或者做相反的检查 if not attr: - print 'attr is falsey!' + print('attr is falsey!') # or, since None is considered false, explicitly check for it if attr is None: - print 'attr is None!' + print('attr is None!') 访问字典元素 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -511,9 +549,9 @@ PEP 8 d = {'hello': 'world'} if d.has_key('hello'): - print d['hello'] # 打印 'world' + print(d['hello']) # 打印 'world' else: - print 'default_value' + print('default_value') **优雅**: @@ -521,12 +559,12 @@ PEP 8 d = {'hello': 'world'} - print d.get('hello', 'default_value') # 打印 'world' - print d.get('thingy', 'default_value') # 打印 'default_value' + print(d.get('hello', 'default_value')) # 打印 'world' + print(d.get('thingy', 'default_value')) # 打印 'default_value' # Or: if 'hello' in d: - print d['hello'] + print(d['hello']) 维护列表的捷径 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -669,7 +707,7 @@ PEP 8 a = [3, 4, 5] for i, item in enumerate(a): - print i, item + print(i, item) # 打印 # 0 3 # 1 4 @@ -689,7 +727,7 @@ PEP 8 f = open('file.txt') a = f.read() - print a + print(a) f.close() **优雅**: @@ -698,7 +736,7 @@ PEP 8 with open('file.txt') as f: for line in f: - print line + print(line) ``with`` 语句会更好,因为它能确保您总是关闭文件,即使是在 ``with`` 的区块中 抛出一个异常。 diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst index 2dd3628..50e42be 100644 --- a/docs/writing/tests.rst +++ b/docs/writing/tests.rst @@ -204,30 +204,6 @@ tox允许通过简单的初始化样式配置文件,配置复杂的多参数 `tox `_ -Unittest2 ---------- - -Unittest2是Python2.7中unittest模型的补丁,它的API有所改善,并且对Python之前版本中已有的内容有了更好的说明。 - -如果使用Python2.6版本或者以下,需要使用pip安装unittest2。 - -.. code-block:: console - - $ pip install unittest2 - -将来您可能想要以unittest之名导入模块,目的是更容易地把代码移植到新的版本中。 - -.. code-block:: python - - import unittest2 as unittest - - class MyTest(unittest.TestCase): - ... - -如果切换到新的Python版本,并且不再需要unittest2模块,您只需要在测试模块中改变import内容,而不必改变其它代码。 - - `unittest2 `_ - mock ---- diff --git a/requirements.txt b/requirements.txt index d218b97..4a246ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,16 +5,16 @@ chardet==3.0.4 docutils==0.14 idna==2.7 imagesize==1.0.0 -Jinja2>=2.10.1 -MarkupSafe==1.0 +Jinja2==2.10 +MarkupSafe==1.1.1 packaging==17.1 Pygments==2.2.0 pyparsing==2.2.0 pytz==2018.5 -requests==2.20.0 +requests==2.19.1 six==1.11.0 snowballstemmer==1.2.1 Sphinx==1.7.6 sphinx-sitemap==0.3.1 sphinxcontrib-websupport==1.1.0 -urllib3>=1.24.2 +urllib3==1.23 diff --git a/runtime.txt b/runtime.txt index d70c8f8..cc1923a 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -3.6 +3.8