cehua_ZWJ
2019-01-30 6afaa4408f4e09e3e95dbd92f0d1cd5a1fb2942b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
6m[c @sedZddlZdZdZdZd„Zd„ZedkrReejƒnddl    Z    ddl
Z
ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZdd    lmZdd
lmZmZmZdd lm Z dd l!m"Z"m#Z#dd l$m%Z%yddl&m'Z(m)Z*Wn'e+k
r·ddl,m'Z(m)Z*nXyddl-m.Z.d„Z/WnRe+k
r)yddl-m0Z0d„Z/Wn!e+k
r%ddl-m/Z/nXnXej1j2dkZ3y"ej4j5ej6j5f\Z7Z8Wn#e9k
rƒd„Z7d„Z8nXe3rpddl:j;Z<ddl=Z>ddl?m@Z@mAZBddl?mCZCmDZEmFZGe jHeGddƒZGddlImJZJmKZKmLZLddlMmNZOddlPZPddlQmRZRddlSZSeTZUeTZVd„ZWd„ZXeYZZd „Z[nÎddl<Z<ddl>Z>ddl\m@Z@mAZBddl]mCZCmDZEmFZGddl^mJZJmKZKmLZLdd!lmZZZddl_ZPdd"l`m`ZRddlaZSddlMmNZOeVZVe*ZWebd#d$d%ƒdUd&d'„Zcd&d(d)„Zde3reednecZed*„Zfd+„Zgd,„Zhd-eifd.„ƒYZjd/eifd0„ƒYZkd1eifd2„ƒYZld3emfd4„ƒYZnd5enfd6„ƒYZod7enfd8„ƒYZpd9eofd:„ƒYZqd;eofd<„ƒYZrd=eofd>„ƒYZsd?„Ztd@eifdA„ƒYZudBeifdC„ƒYZvdDeifdE„ƒYZwdFeifdG„ƒYZxdH„ZydI„ZzdJeifdK„ƒYZ{dLeifdM„ƒYZ|dN„Z}dOexfdP„ƒYZ~dQe|fdR„ƒYZexZ€e|ZdSeenfdT„ƒYZ‚dUe‚fdV„ƒYZƒdWenfdX„ƒYZ„dYeifdZ„ƒYZ…d[eifd\„ƒYZ†d]eifd^„ƒYZ‡d_eOfd`„ƒYZˆdaeˆfdb„ƒYZ‰dceˆfdd„ƒYZŠdeeOfdf„ƒYZ‹eiƒZŒdgefdh„ƒYZŽdiefdj„ƒYZdkeifdl„ƒYZ‘dmeifdn„ƒYZ’doeifdp„ƒYZ“dqeifdr„ƒYZ”dsdtdu„Z•e–dv„Z—dwdwe˜dx„Z™eše˜dye–dz„Z›ešd{„Zœd|„Zd}„Zžd~„ZŸdd€„Z ejbdƒj¡Z¢d‚„Z£dƒ„Z¤d„„Z¥e–d…„Z¦e–d†„Z§d‡„Z¨dˆ„Z©d‰„ZªdŠ„Z«d‹dŒ„Z¬ddŽd„Z­d„Z®e®d‘ƒZ¯e®d’ƒZ°e®d“ƒZ±e®d”ƒZ²e®d•ƒZ³e®d–ƒZ´e®d—ƒZµe®d˜ƒZ¶e®d™ƒZ·e®dšƒZ¸e®d›ƒZ¹e®dœƒZºdeifdž„ƒYZ»dŸe»fd „ƒYZ¼d¡e»fd¢„ƒYZ½d£e»fd¤„ƒYZ¾d¥e»fd¦„ƒYZ¿d§e»fd¨„ƒYZÀd©e»fdª„ƒYZÁd«e»fd¬„ƒYZÂd­e»fd®„ƒYZÃd¯e»fd°„ƒYZÄd±e»fd²„ƒYZÅd³e»fd´„ƒYZÆdµe»fd¶„ƒYZÇd·e»fd¸„ƒYZÈd¹e»fdº„ƒYZÉd»e»fd¼„ƒYZÊd½e»fd¾„ƒYZËd¿e»fdÀ„ƒYZÌdÁe»fd„ƒYZÍdÃe»fdĄƒYZÎdÅeÎfdƄƒYZÏdÇeÏfdȄƒYZÐdÉe»fdʄƒYZÑie¼dË6e½dÌ6e¾dÍ6eÁdÎ6e¿dÏ6eÀdÐ6eÂdÑ6eÄdÒ6eÅdÓ6eÆdÔ6eÇdÕ6eÈdÖ6eÃd×6eÊdØ6eËdÙ6eÉdÚ6eÌdÛ6eÍdÜ6eÏdÝ6eÐdÞ6eÑdß6ZÒdà„ZÓdá„ZÔeœZÕe–dÍdâdãd‹e˜e˜e–e–e–dä„
ZÖdåej×fd愃YZØdçenfd脃YZÙdéeifdꄃYZÚdëeÚfd섃YZÛdíeÚfdYZÜdïeÚfdð„ƒYZÝdñeÚfdò„ƒYZÞdóeÙfdô„ƒYZßdõeifdö„ƒYZàd÷„Záe jHeádøeۃZâe jHeádøe܃Zãe jHeádøe݃Zädù„Zåe jHeådøeۃZæe jHeådøe܃Zçe jHeådøe݃ZèdúdûgZéiZêe˜aëe˜aìe<jíjîƒZïdüeïdý<dþeïdÿ<deïd<deïd<deïd<deïd<ed„eïjðƒDƒƒZñd    eZòe~ƒZóeƒZôejõƒZõeƒZöZ÷Zøe‡edkr)d
ned d ƒjùZúd „ZûedkraeûejƒndS(sÍ
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with URL parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file and with no dependencies other than the
Python Standard Library.
 
Homepage and documentation: http://bottlepy.org/
 
Copyright (c) 2017, Marcel Hellkamp.
License: MIT (see LICENSE for details)
iÿÿÿÿNsMarcel Hellkamps0.13-devtMITc    Cs0ddlm}|d|dddƒ}|j}|ddd    d
d ƒ|d d ddd
dƒ|ddddd
dƒ|ddddd
dƒ|ddddddd
dƒ|dddddd d
d!ƒ|d"dd    d
d#ƒ|d$dd    d
d%ƒ|d&d
d'd(d)ƒ|j|d*ƒ}||fS(+Niÿÿÿÿ(tArgumentParsertprogitusages%%(prog)s [options] package.module:apps    --versiontactiont
store_truethelpsshow version number.s-bs--bindtmetavartADDRESSsbind socket to ADDRESS.s-ss--servertdefaulttwsgirefsuse SERVER as backend.s-ps--plugintappendsinstall additional plugin/s.s-cs--conftFILEsload config values from FILE.s-Cs--params
NAME=VALUEsoverride config values.s--debugsstart server in debug mode.s--reloadsauto-reload on file changes.tappsWSGI app entry point.tnargst?i(targparseRt add_argumentt
parse_args(targsRtparsertopttcli_args((s#.\\ServerPython\webbottle\bottle.pyt
_cli_parses     cCst|ƒ\}}|}|jr}|jjdƒrOddl}|jjƒq}|jjdƒr}ddl}|jƒq}ndS(Ntgeventiÿÿÿÿteventlet(Rtservert
startswitht gevent.monkeytmonkeyt    patch_allRt monkey_patch(Rt parsed_argst_toptsRR((s#.\\ServerPython\webbottle\bottle.pyt
_cli_patch4s      t__main__(t FunctionType(tdatetdatetimet    timedelta(t TemporaryFile(t
format_exct    print_exc(t    normalize(tdumpstloads(t    signaturecCsÎt|ƒj}gddgf\}}}}x‚|jƒD]t\}}|j|jkra|}q:|j|jkr||}q:|j|ƒ|j|j    k    r:|j|jƒq:q:W|||t
|ƒpÊdfS(N( R/t
parameterstNonetitemstkindtVAR_POSITIONALt VAR_KEYWORDR R    temptyttuple(tfunctparamsRtvarargstkeywordstdefaultstnametparam((s#.\\ServerPython\webbottle\bottle.pyt
getargspecZs         (tgetfullargspeccCsEt|ƒ}t|dƒt|jƒ}||d|d|dfS(Niiii(R@tmakelistt
kwonlyargs(R8tspectkwargs((s#.\\ServerPython\webbottle\bottle.pyR?js (R?icCstjj|ƒS(N(tsyststdouttwrite(tx((s#.\\ServerPython\webbottle\bottle.pyt<lambda>yscCstjj|ƒS(N(REtstderrRG(RH((s#.\\ServerPython\webbottle\bottle.pyRIzs(turljoint SplitResult(t    urlencodetquotetunquotetencodingtlatin1(t SimpleCookietMorselt CookieError(tMutableMapping(tBytesIOcCstt|ƒƒS(N(tjson_ldsttouni(ts((s#.\\ServerPython\webbottle\bottle.pyRI‹scCs t|dƒS(Nt__call__(thasattr(RH((s#.\\ServerPython\webbottle\bottle.pyRIŒscGs%|d|dƒj|dƒ‚dS(Niii(twith_traceback(ta((s#.\\ServerPython\webbottle\bottle.pyt_raises(timap(tStringIOs&def _raise(*a): raise a[0], a[1], a[2]s<py3fix>texectutf8cCs6t|tƒr|j|ƒS|dkr,dSt|ƒS(Nt(t
isinstancetunicodetencodeR1tbytes(RYtenc((s#.\\ServerPython\webbottle\bottle.pyttob¡s tstrictcCs;t|tƒr|j||ƒSt|dkr4dn|ƒS(NRc(RdRgtdecodeReR1(RYRhterr((s#.\\ServerPython\webbottle\bottle.pyRX§scOs2ytj||||ŽWntk
r-nXdS(N(t    functoolstupdate_wrappertAttributeError(twrappertwrappedR]tka((s#.\\ServerPython\webbottle\bottle.pyRn³s cCsQd||||f}tdkr1t|ƒ‚ntj|tddƒt|ƒS(NsZWarning: Use of deprecated feature or API. (Deprecated in Bottle-%d.%d)
Cause: %s
Fix: %s
Rjt
stackleveli(tDEBUGtDeprecationWarningtwarningstwarn(tmajortminortcausetfixttext((s#.\\ServerPython\webbottle\bottle.pytdepr½s  cCs:t|ttttfƒr%t|ƒS|r2|gSgSdS(N(RdR7tlisttsettdict(tdata((s#.\\ServerPython\webbottle\bottle.pyRAÇs
 
t DictPropertycBsAeZdZded„Zd„Zd„Zd„Zd„Z    RS(s= Property that maps to a key in a local dict-like attribute. cCs!||||_|_|_dS(N(tattrtkeyt    read_only(tselfRƒR„R…((s#.\\ServerPython\webbottle\bottle.pyt__init__ÓscCs9tj||dgƒ||jp(|j|_|_|S(Ntupdated(RmRnR„t__name__tgetter(R†R8((s#.\\ServerPython\webbottle\bottle.pyRZÖscCsV|dkr|S|jt||jƒ}}||krN|j|ƒ||<n||S(N(R1R„tgetattrRƒRŠ(R†tobjtclsR„tstorage((s#.\\ServerPython\webbottle\bottle.pyt__get__Ûs   cCs5|jrtdƒ‚n|t||jƒ|j<dS(NsRead-Only property.(R…RoR‹RƒR„(R†RŒtvalue((s#.\\ServerPython\webbottle\bottle.pyt__set__ás    cCs2|jrtdƒ‚nt||jƒ|j=dS(NsRead-Only property.(R…RoR‹RƒR„(R†RŒ((s#.\\ServerPython\webbottle\bottle.pyt
__delete__ås    N(
R‰t
__module__t__doc__R1tFalseR‡RZRR‘R’(((s#.\\ServerPython\webbottle\bottle.pyR‚Ðs             tcached_propertycBs eZdZd„Zd„ZRS(s¥ A property that is only computed once per instance and then replaces
        itself with an ordinary attribute. Deleting the attribute resets the
        property. cCst||ƒ||_dS(N(RnR8(R†R8((s#.\\ServerPython\webbottle\bottle.pyR‡ïs cCs4|dkr|S|j|ƒ}|j|jj<|S(N(R1R8t__dict__R‰(R†RŒRR((s#.\\ServerPython\webbottle\bottle.pyRós  (R‰R“R”R‡R(((s#.\\ServerPython\webbottle\bottle.pyR–ês    tlazy_attributecBs eZdZd„Zd„ZRS(s4 A property that caches itself to the class object. cCs#tj||dgƒ||_dS(NRˆ(RmRnRŠ(R†R8((s#.\\ServerPython\webbottle\bottle.pyR‡üscCs&|j|ƒ}t||j|ƒ|S(N(RŠtsetattrR‰(R†RŒRR((s#.\\ServerPython\webbottle\bottle.pyRs(R‰R“R”R‡R(((s#.\\ServerPython\webbottle\bottle.pyR˜ùs    tBottleExceptioncBseZdZRS(s- A base class for exceptions used by bottle. (R‰R“R”(((s#.\\ServerPython\webbottle\bottle.pyRš
st
RouteErrorcBseZdZRS(s9 This is a base class for all routing related exceptions (R‰R“R”(((s#.\\ServerPython\webbottle\bottle.pyR›st
RouteResetcBseZdZRS(sf If raised by a plugin or request handler, the route is reset and all
        plugins are re-applied. (R‰R“R”(((s#.\\ServerPython\webbottle\bottle.pyRœstRouterUnknownModeErrorcBseZRS((R‰R“(((s#.\\ServerPython\webbottle\bottle.pyRstRouteSyntaxErrorcBseZdZRS(s@ The route parser found something not supported by this router. (R‰R“R”(((s#.\\ServerPython\webbottle\bottle.pyRž!stRouteBuildErrorcBseZdZRS(s The route could not be built. (R‰R“R”(((s#.\\ServerPython\webbottle\bottle.pyRŸ%scCs&d|kr|Stjdd„|ƒS(s^ Turn all capturing groups in a regular expression pattern into
        non-capturing groups. t(s(\\*)(\(\?P<[^>]+>|\((?!\?))cSs7t|jdƒƒdr&|jdƒS|jdƒdS(Niiis(?:(tlentgroup(tm((s#.\\ServerPython\webbottle\bottle.pyRI.s(tretsub(tp((s#.\\ServerPython\webbottle\bottle.pyt _re_flatten)s tRoutercBsteZdZdZdZdZed„Zd„Ze    j
dƒZ d„Z d d„Zd    „Zd
„Zd „ZRS( sA A Router is an ordered collection of route->target pairs. It is used to
        efficiently match WSGI requests against a number of routes and return
        the first target that satisfies the request. The target may be anything,
        usually a string, ID or callable object. A route consists of a path-rule
        and a HTTP method.
 
        The path-rule is either a static path (e.g. `/contact`) or a dynamic
        path that contains wildcards (e.g. `/wiki/<page>`). The wildcard syntax
        and details on the matching order are described in docs:`routing`.
    s[^/]+R¤iccszgˆ_iˆ_iˆ_iˆ_iˆ_iˆ_|ˆ_i‡fd†d6d„d6d„d6d„d6ˆ_dS(    Ncst|pˆjƒddfS(N(R§tdefault_patternR1(tconf(R†(s#.\\ServerPython\webbottle\bottle.pyRIOsR¤cSsdtd„fS(Ns-?\d+cSstt|ƒƒS(N(tstrtint(RH((s#.\\ServerPython\webbottle\bottle.pyRIQs(R¬(Rª((s#.\\ServerPython\webbottle\bottle.pyRIQsR¬cSsdtd„fS(Ns-?[\d.]+cSstt|ƒƒS(N(R«tfloat(RH((s#.\\ServerPython\webbottle\bottle.pyRIRs(R­(Rª((s#.\\ServerPython\webbottle\bottle.pyRIRsR­cSsdS(Ns.+?(s.+?NN(R1(Rª((s#.\\ServerPython\webbottle\bottle.pyRISstpath(trulest_groupstbuildertstatict dyna_routest dyna_regexest strict_ordertfilters(R†Rj((R†s#.\\ServerPython\webbottle\bottle.pyR‡Es                            
 
cCs||j|<dS(sâ Add a filter. The provided function is called with the configuration
        string as parameter and must return a (regexp, to_python, to_url) tuple.
        The first element is a string, the last two are callables or None. N(R¶(R†R=R8((s#.\\ServerPython\webbottle\bottle.pyt
add_filterVss€(\\*)(?:(?::([a-zA-Z_][a-zA-Z_0-9]*)?()(?:#(.*?)#)?)|(?:<([a-zA-Z_][a-zA-Z_0-9]*)?(?::([a-zA-Z_]*)(?::((?:\\.|[^\\>]+)+)?)?)?>))c    csed \}}x!|jj|ƒD] }||||jƒ!7}|jƒ}|ddk    rntddddƒnt|dƒdrµ||jdƒt|dƒ7}|jƒ}qn|rÌ|ddfVn|ddkré|dd!n
|d    d!\}}}||p d
|pdfV|jƒd}}qW|t|ƒksH|ra|||ddfVndS( NiRcii sUse of old route syntax.s&Use <name> instead of :name in routes.iiiR    (iRc(    t rule_syntaxtfinditertstarttgroupsR1R}R¡R¢tend(    R†truletoffsettprefixtmatchtgR=tfiltrRª((s#.\\ServerPython\webbottle\bottle.pyt _itertokensas$   
! 3csýd}g}d}g‰g}t}    x|j|ƒD]\}
} } | rt}    | dkrg|j} n|j| | ƒ\} }}|
s®|d| 7}d|}
|d7}n!|d|
| f7}|j|
ƒ|rëˆj|
|fƒn|j|
|pýtfƒq4|
r4|tj|
ƒ7}|jd|
fƒq4q4W||j
|<|r]||j
|<n|    r¤|j r¤|j j |iƒ|df|j ||j|ƒ<dSy tjd    |ƒ}|j‰Wn,tjk
rò}td
||fƒ‚nXˆr‡‡fd †}n!|jr)‡fd †}nd}t|ƒ}||||f}||f|jkr¬tr‹d }tj|||ftƒn||j||j||f<n@|jj |gƒj|ƒt|j|ƒd|j||f<|j|ƒdS(s< Add a new rule or replace the target for an existing rule. iRcR    s(?:%s)sanon%dis
(?P<%s>%s)Ns^(%s)$sCould not add Route: %s (%s)cshˆ|ƒjƒ}xOˆD]G\}}y|||ƒ||<Wqtk
r_tddƒ‚qXqW|S(NisPath has wrong format.(t    groupdictt
ValueErrort    HTTPError(R®turl_argsR=twildcard_filter(tre_matchR¶(s#.\\ServerPython\webbottle\bottle.pytgetargs s csˆ|ƒjƒS(N(RÄ(R®(RÉ(s#.\\ServerPython\webbottle\bottle.pyRʪss3Route <%s %s> overwrites a previously defined route(tTrueRÃR•tdefault_filterR¶R R«R¤tescapeR1R±RµR²t
setdefaulttbuildtcompileRÀterrorRžt
groupindexR§R°RtRvRwtRuntimeWarningR³R¡t_compile(R†R½tmethodttargetR=tanonstkeystpatternR±t    is_staticR„tmodeRªtmaskt    in_filtert
out_filtert
re_patternteRÊtflatpatt
whole_ruletmsg((R¶RÉs#.\\ServerPython\webbottle\bottle.pytaddusf 
          !$c CsØ|j|}g}|j|<|j}xªtdt|ƒ|ƒD]}||||!}d„|Dƒ}djd„|Dƒƒ}tj|ƒj}g|D]\}}}    }
|    |
f^q™} |j    || fƒq@WdS(Nicss!|]\}}}}|VqdS(N((t.0R!Rá((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Äst|css|]}d|VqdS(s(^%s$)N((RåRá((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Ås(
R³R´t_MAX_GROUPS_PER_PATTERNtrangeR¡tjoinR¤RÐRÀR ( R†RÕt    all_rulest
comborulest    maxgroupsRHtsometcombinedR!RÖRÊR¯((s#.\\ServerPython\webbottle\bottle.pyRÔ¾s     +c Osé|jj|ƒ}|s*td|ƒ‚nyŽx(t|ƒD]\}}||d|<q:Wdjg|D]-\}}|rŒ||j|ƒƒn|^qeƒ}    |s¥|    S|    dt|ƒSWn*tk
rä}
td|
jdƒ‚nXdS(s2 Build an URL by filling the wildcards in a rule. sNo route with that name.sanon%dRcRsMissing URL argument: %riN(    R±tgetRŸt    enumerateRétpopRMtKeyErrorR( R†t_nameR×tqueryR±tiRtntfturltE((s#.\\ServerPython\webbottle\bottle.pyRÏÊsC cCs6|djƒ}|dpd}|dkrAd|ddg}nd|dg}xØ|D]Ð}||jkr²||j|kr²|j||\}}||r«||ƒnifS||jkrWxc|j|D]Q\}}    ||ƒ}
|
rÏ|    |
jd\}}||r||ƒnifSqÏWqWqWWtgƒ} t|ƒ} x>t|jƒ| D])}||j|krW| j|ƒqWqWWx_t|jƒ| | D]F}x=|j|D].\}}    ||ƒ}
|
r°| j|ƒq°q°WqœW| rd    jt| ƒƒ} td
d d | ƒ‚ntd dt    |ƒƒ‚dS(sD Return a (target, url_args) tuple or raise HTTPError(400/404/405). tREQUEST_METHODt    PATH_INFOt/tHEADtPROXYtGETtANYit,i•sMethod not allowed.tAllowi”s Not found: N(
tupperR²R´t    lastindexRRäRétsortedRÆtrepr(R†tenvirontverbR®tmethodsRÕRÖRÊRîR¯RÀtallowedtnocheckt allow_header((s#.\\ServerPython\webbottle\bottle.pyRÀ×s:  " '   N(R‰R“R”R©RÌRçR•R‡R·R¤RÐR¸RÃR1RäRÔRÏRÀ(((s#.\\ServerPython\webbottle\bottle.pyR¨2s
          I          tRoutecBszeZdZd d d d„Zed„ƒZd„Zd„Zd„Z    d„Z
d„Z d„Z d d    „Z d
„ZRS( sî This class wraps a route callback along with route specific metadata and
        configuration and applies Plugins on demand. It is also responsible for
        turing an URL path rule into a regular expression usable by the Router.
    c    Ksw||_||_||_||_|p-d|_|p<g|_|pKg|_|jj    ƒ|_|jj
|ƒdS(N( R R½RÕtcallbackR1R=tpluginstskiplisttconfigt _make_overlayt    load_dict(    R†R R½RÕRR=RRR((s#.\\ServerPython\webbottle\bottle.pyR‡s                cCs
|jƒS(s The route callback with all plugins applied. This property is
            created on demand and then cached to speed up subsequent requests.(t_make_callback(R†((s#.\\ServerPython\webbottle\bottle.pytcallscCs|jjddƒdS(sk Forget any cached values. The next time :attr:`call` is accessed,
            all plugins are re-applied. RN(R—RñR1(R†((s#.\\ServerPython\webbottle\bottle.pytreset#scCs |jdS(s: Do all on-demand work immediately (useful for debugging).N(R(R†((s#.\\ServerPython\webbottle\bottle.pytprepare(sccsÂtƒ}x²t|jj|jƒD]—}t|jkr<Pnt|dtƒ}|ru||jks#||kruq#n||jks#t|ƒ|jkrŸq#n|rµ|j    |ƒn|Vq#WdS(s) Yield all Plugins affecting this route. R=N(
RtreversedR RRËRR‹R•ttypeRä(R†tuniqueR¦R=((s#.\\ServerPython\webbottle\bottle.pyt all_plugins,s     !$cCs•|j}x…|jƒD]w}y4t|dƒrC|j||ƒ}n ||ƒ}Wntk
rj|jƒSX||jk    rt||jƒqqW|S(Ntapply(RRR[RRœRRn(R†Rtplugin((s#.\\ServerPython\webbottle\bottle.pyR7s      cCs¾|j}t|trdnd|ƒ}tr3dnd}x~t||ƒr¹t||ƒr¹t||ƒ}|dj}t|tƒs<td„td„|ƒƒ}t    |ƒd}q<q<W|S(sq Return the callback. If the callback is a decorated function, try to
            recover the original function. t__func__tim_funct __closure__t func_closureicSs t|tƒS(N(RdR%(RH((s#.\\ServerPython\webbottle\bottle.pyRIRscSs|jS(N(t cell_contents(RH((s#.\\ServerPython\webbottle\bottle.pyRISs(
RR‹tpy3kR[R"RdR%tfiltertmapR~(R†R8t closure_attrt
attributes((s#.\\ServerPython\webbottle\bottle.pytget_undecorated_callbackEs    !     cCst|jƒƒdS(sÓ Return a list of argument names the callback (most likely) accepts
            as keyword arguments. If the callback is a decorated function, try
            to recover the original function before inspection. i(R?R((R†((s#.\\ServerPython\webbottle\bottle.pytget_callback_argsWscCs&tddddƒ|jj||ƒS(sp Lookup a config field and return its value, first checking the
            route.config, then route.app.config.ii s"Route.get_config() is deprectated.ssThe Route.config property already includes values from the application config for missing keys. Access it directly.(R}RRï(R†R„R    ((s#.\\ServerPython\webbottle\bottle.pyt
get_config]s cCs#|jƒ}d|j|j|fS(Ns
<%s %r %r>(R(RÕR½(R†tcb((s#.\\ServerPython\webbottle\bottle.pyt__repr__es N(R‰R“R”R1R‡R–RRRRRR(R)R*R,(((s#.\\ServerPython\webbottle\bottle.pyR ÿs                           tBottlecBs¦eZdZed„ƒZd„ZeddƒZd.ZdhZ    e
d„ƒZ d    „Z d
„Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd/d„Zd„Zd„Zd„Zd„Zd„Zd/dd/d/d/d/d„Zd/dd„Zd/dd„Zd/dd„Z d/d d!„Z!d/d"d#„Z"d$d/d%„Z#d&„Z$d'„Z%d/d(„Z&d)„Z'd*„Z(d+„Z)d,„Z*d-„Z+RS(0s^ Each Bottle object represents a single, distinct web application and
        consists of routes, callbacks, plugins, resources and configuration.
        Instances are callable WSGI applications.
 
        :param catchall: If true (default), handle all exceptions. Turn off to
                         let debugging middleware handle exceptions.
    cCs tƒ}|jddtƒ|S(Ntcatchalltvalidate(t
ConfigDicttmeta_settbool(Rtcfg((s#.\\ServerPython\webbottle\bottle.pyt_global_configws    cKs|jjƒ|_|jjtj|jdƒƒ|jjitd6ƒ|j    dƒt
kr€t ddddƒt
|jd<n|j    dƒt
kr¸t dddd    ƒt|jd
<ng|_ t ƒ|_g|_tƒ|_i|_g|_|jtƒƒ|jtƒƒdS( NRR.ii s"Bottle(catchall) keyword argument.sbThe 'catchall' setting is now part of the app configuration. Fix: `app.config['catchall'] = False`tautojsons"Bottle(autojson) keyword argument.seThe 'autojson' setting is now part of the app configuration. Fix: `app.config['json.enable'] = False`s json.disable(R4RRt_add_change_listenerRmtpartialt trigger_hooktupdateRËRïR•R}t_mountstResourceManagert    resourcestroutesR¨troutert error_handlerRtinstallt
JSONPlugintTemplatePlugin(R†RD((s#.\\ServerPython\webbottle\bottle.pyR‡}s*                          RR.tbefore_requestt after_requestt    app_resetcCstd„|jDƒƒS(Ncss|]}|gfVqdS(N((RåR=((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>¨s(R€t_Bottle__hook_names(R†((s#.\\ServerPython\webbottle\bottle.pyt_hooks¦scCsA||jkr)|j|jd|ƒn|j|j|ƒdS(s« Attach a callback to a hook. Three hooks are currently implemented:
 
            before_request
                Executed once before each request. The request context is
                available, but no routing has happened yet.
            after_request
                Executed once after each request regardless of its outcome.
            app_reset
                Called whenever :meth:`Bottle.reset` is called.
        iN(t_Bottle__hook_reversedRGtinsertR (R†R=R8((s#.\\ServerPython\webbottle\bottle.pytadd_hookªs cCs>||jkr:||j|kr:|j|j|ƒtSdS(s  Remove a callback from a hook. N(RGtremoveRË(R†R=R8((s#.\\ServerPython\webbottle\bottle.pyt remove_hookºs"cOs(g|j|D]}|||Ž^qS(s. Trigger a hook and return a list of results. (RG(R†t _Bottle__nameRRDthook((s#.\\ServerPython\webbottle\bottle.pyR8Àscs‡‡fd†}|S(se Return a decorator that attaches a callback to a hook. See
            :meth:`add_hook` for details.csˆjˆ|ƒ|S(N(RJ(R8(R†R=(s#.\\ServerPython\webbottle\bottle.pyt    decoratorÈs((R†R=RO((R†R=s#.\\ServerPython\webbottle\bottle.pyRNÄsc sóg|jdƒD]}|r|^q}|s=tdƒ‚nt|ƒ‰‡‡fd†}|jdtƒ|jddƒ|jdi|d6ˆd    6ƒ||d
<|jd dj|ƒ||jdƒsï|jddj|ƒ|ndS( NRüs+WSGI applications cannot be mounted to "/".cs‚zltjˆƒtgƒ‰d‡fd†}ˆtj|ƒ}ˆjr^tjˆj|ƒn|ˆ_ˆSWdtjˆ ƒXdS(NcsM|rt|Œn|ˆ_x$|D]\}}ˆj||ƒq#WˆjjS(N(R^tstatust
add_headertbodyR (RPt
headerlisttexc_infoR=R(trs(s#.\\ServerPython\webbottle\bottle.pytstart_responseÙs      (trequestt
path_shiftt HTTPResponseR1RRRt    itertoolstchain(RVRR(R t
path_depth(RUs#.\\ServerPython\webbottle\bottle.pytmountpoint_wrapperÔs  'tskipRÕRþt
mountpointR¿RÖRs /%s/<:re:.*>(tsplitRÅR¡RÎRËtrouteRétendswith(R†R¿R toptionsR¦tsegmentsR]((R R\s#.\\ServerPython\webbottle\bottle.pyt _mount_wsgiÎs( 
cKs ||jksd|jkrDtddddƒ|j|||S|rptddddƒ|j|||S|jdƒs¥tddd    d
ƒ|j|||S|jj|ƒ||jd <||jd<x7|jD],}||jjdƒ|_|j    |ƒqÙWdS( Ns
_mount.appii s?Application mounted multiple times. Falling back to WSGI mount.s:Clone application before mounting to a different location.s6Unsupported mount options. Falling back to WSGI mount.sBDo not specify any route options when mounting bottle application.Rüs3Prefix must end in '/'. Falling back to WSGI mount.s\Consider adding an explicit redirect from '/prefix' to '/prefix/' in the parent application.s _mount.prefix(
R:RR}ReRbR R=R½tlstript    add_route(R†R¿R RcRa((s#.\\ServerPython\webbottle\bottle.pyt
_mount_appðs$     cKsW|jdƒstdƒ‚nt|tƒr@|j|||S|j|||SdS(s“ Mount an application (:class:`Bottle` or plain WSGI) to a specific
            URL prefix. Example::
 
                parent_app.mount('/prefix/', child_app)
 
            :param prefix: path prefix or `mount-point`.
            :param app: an instance of :class:`Bottle` or a WSGI application.
 
            Plugins from the parent application are not applied to the routes
            of the mounted child application. If you need plugins in the child
            application, install them separately.
 
            While it is possible to use path wildcards within the prefix path
            (:class:`Bottle` childs only), it is highly discouraged.
 
            The prefix path must end with a slash. If you want to access the
            root of the child application via `/prefix` in addition to
            `/prefix/`, consider adding a route with a 307 redirect to the
            parent application.
        RüsPrefix must start with '/'N(RRÅRdR-RhRe(R†R¿R Rc((s#.\\ServerPython\webbottle\bottle.pytmounts
cCs=t|tƒr|j}nx|D]}|j|ƒq"WdS(sô Merge the routes of another :class:`Bottle` application or a list of
            :class:`Route` objects into this application. The routes keep their
            'owner', meaning that the :data:`Route.app` attribute is not
            changed. N(RdR-R=Rg(R†R=Ra((s#.\\ServerPython\webbottle\bottle.pytmerge%s  cCsit|dƒr|j|ƒnt|ƒ rKt|dƒ rKtdƒ‚n|jj|ƒ|jƒ|S(sâ Add a plugin to the list of plugins and prepare it for being
            applied to all routes of this application. A plugin may be a simple
            decorator or an object that implements the :class:`Plugin` API.
        tsetupRs.Plugins must be callable or implement .apply()(R[Rktcallablet    TypeErrorRR R(R†R((s#.\\ServerPython\webbottle\bottle.pyR@/s
cCsÏg|}}x¨tt|jƒƒddd…D]„\}}|tks~||ks~|t|ƒks~t|dtƒ|kr0|j|ƒ|j|=t|dƒr´|jƒq´q0q0W|rË|j    ƒn|S(s) Uninstall plugins. Pass an instance to remove a specific plugin, a type
            object to remove all plugins that match that type, a string to remove
            all plugins with a matching ``name`` attribute or ``True`` to remove all
            plugins. Return the list of removed plugins. NiÿÿÿÿR=tclose(
R~RðRRËRR‹R R[RnR(R†RtremovedRKRõ((s#.\\ServerPython\webbottle\bottle.pyt    uninstall;s /* 
 cCs“|dkr|j}n+t|tƒr3|g}n|j|g}x|D]}|jƒqJWtr‚x|D]}|jƒqkWn|jdƒdS(sª Reset all routes (force plugins to be re-applied) and clear all
            caches. If an ID or route object is given, only that specific route
            is affected. REN(R1R=RdR RRtRR8(R†RaR=((s#.\\ServerPython\webbottle\bottle.pyRJs    cCs4x-|jD]"}t|dƒr
|jƒq
q
WdS(s2 Close the application and all installed plugins. RnN(RR[Rn(R†R((s#.\\ServerPython\webbottle\bottle.pyRnXscKst||dS(s- Calls :func:`run` with the same parameters. N(trun(R†RD((s#.\\ServerPython\webbottle\bottle.pyRq]scCs|jj|ƒS(sÝ Search for a matching route and return a (:class:`Route` , urlargs)
            tuple. The second value is a dictionary with parameters extracted
            from the URL. Raise :exc:`HTTPError` (404/405) on a non-match.(R>RÀ(R†R((s#.\\ServerPython\webbottle\bottle.pyRÀascKsVtjjddƒjdƒd}|jj||jdƒ}ttd|ƒ|ƒS(s, Return a string that matches a named route t SCRIPT_NAMERcRü(RWRRïtstripR>RÏRfRK(R†t    routenametkargst
scriptnametlocation((s#.\\ServerPython\webbottle\bottle.pytget_urlgs"cCsL|jj|ƒ|jj|j|j|d|jƒtrH|jƒndS(sS Add a route object, but do not change the :data:`Route.app`
            attribute.R=N(    R=R R>RäR½RÕR=RtR(R†Ra((s#.\\ServerPython\webbottle\bottle.pyRgms%Rÿc     sitˆƒrdˆ‰}nt|ƒ‰t|ƒ‰‡‡‡‡‡‡‡fd†}|re||ƒS|S(s A decorator to bind a function to a request URL. Example::
 
                @app.route('/hello/<name>')
                def hello(name):
                    return 'Hello %s' % name
 
            The ``<name>`` part is a wildcard. See :class:`Router` for syntax
            details.
 
            :param path: Request path or a list of paths to listen to. If no
              path is specified, it is automatically generated from the
              signature of the function.
            :param method: HTTP method (`GET`, `POST`, `PUT`, ...) or a list of
              methods to listen to. (default: `GET`)
            :param callback: An optional shortcut to avoid the decorator
              syntax. ``route(..., callback=func)`` equals ``route(...)(func)``
            :param name: The name for this route. (default: None)
            :param apply: A decorator or plugin or a list of plugins. These are
              applied to the route callback in addition to installed plugins.
            :param skip: A list of plugins, plugin classes or names. Matching
              plugins are not installed to this route. ``True`` skips all.
 
            Any additional keyword arguments are stored as route-specific
            configuration and passed to plugins (see :meth:`Plugin.apply`).
        csŸt|tƒrt|ƒ}nxztˆƒp6t|ƒD]`}xWtˆƒD]I}|jƒ}tˆ|||dˆdˆdˆˆ}ˆj|ƒqJWq7W|S(NR=RR(Rdt
basestringtloadRAt yieldroutesRR Rg(RR½RRa(R=RR†RÕRR®R(s#.\\ServerPython\webbottle\bottle.pyRO˜s  N(RlR1RA(    R†R®RÕRR=RR^RRO((R=R†RRR®RRÕs#.\\ServerPython\webbottle\bottle.pyRats     ! cKs|j|||S(s Equals :meth:`route`. (Ra(R†R®RÕRc((s#.\\ServerPython\webbottle\bottle.pyRï¦stPOSTcKs|j|||S(s8 Equals :meth:`route` with a ``POST`` method parameter. (Ra(R†R®RÕRc((s#.\\ServerPython\webbottle\bottle.pytpostªstPUTcKs|j|||S(s7 Equals :meth:`route` with a ``PUT`` method parameter. (Ra(R†R®RÕRc((s#.\\ServerPython\webbottle\bottle.pytput®stDELETEcKs|j|||S(s: Equals :meth:`route` with a ``DELETE`` method parameter. (Ra(R†R®RÕRc((s#.\\ServerPython\webbottle\bottle.pytdelete²stPATCHcKs|j|||S(s9 Equals :meth:`route` with a ``PATCH`` method parameter. (Ra(R†R®RÕRc((s#.\\ServerPython\webbottle\bottle.pytpatch¶siôcs&‡‡fd†}|r"||ƒS|S(s– Register an output handler for a HTTP error code. Can
            be used as a decorator or called directly ::
 
                def error_handler_500(error):
                    return 'error_handler_500'
 
                app.error(code=500, callback=error_handler_500)
 
                @app.error(404)
                def error_handler_404(error):
                    return 'error_handler_404'
 
        cs5t|tƒrt|ƒ}n|ˆjtˆƒ<|S(N(RdRyRzR?R¬(R(tcodeR†(s#.\\ServerPython\webbottle\bottle.pyROÉs((R†R„RRO((R†R„s#.\\ServerPython\webbottle\bottle.pyRѺsc    Cs%tttd|dtddƒƒƒS(NRàttemplate_settingsR=t__ERROR_PAGE_TEMPLATE(RittemplatetERROR_PAGE_TEMPLATER€(R†tres((s#.\\ServerPython\webbottle\bottle.pytdefault_error_handlerÐscCs|d}|d<tr:|jdƒjddƒ|d<n||d<tj|ƒtjƒyxtrud}z¨yW|jdƒ|j    j
|ƒ\}}||d<||d    <||d
<|j |}PWnJt k
rã}|}Pn1t k
rtd d d dƒ|jƒwanXWdt|t ƒr7|jtƒny|jdƒWn&t k
rp}|}|jtƒnXXqaWWnˆtttfk
r–‚nltk
r}|js´‚ntƒ}|dj|ƒ|djƒtdd||ƒ}|jtƒnX|S(NRûsbottle.raw_pathRQRbtignores
bottle.appRCs route.handles bottle.routesroute.url_argsii sRouteReset exception deprecateds<Call route.call() after route.reset() and return the result.RDs wsgi.errorsiôsInternal Server Error(R#RfRkRWtbindtresponseRËR1R8R>RÀRRYRœR}RRdRtKeyboardInterruptt
SystemExitt MemoryErrort    ExceptionR.R*RGtflushRÆ(R†RR®toutRaRRùt
stacktrace((s#.\\ServerPython\webbottle\bottle.pyt_handleÓsX"
 
     
 
 
 
         c
    Cs"|s#dtkrdtd<ngSt|ttfƒrnt|dttfƒrn|ddd!j|ƒ}nt|tƒr’|jtjƒ}nt|tƒrÇdtkrÀt    |ƒtd<n|gSt|t
ƒr|j tƒ|j j |j|jƒ|ƒ}|j|ƒSt|tƒr=|j tƒ|j|jƒSt|dƒr˜dtjkrltjd|ƒSt|dƒs‹t|dƒ r˜t|ƒSny5t|ƒ}t|ƒ}x|sËt|ƒ}q¶WWnˆtk
rê|jdƒStk
r}|}nVtttfk
r‚n:tk
rW}|js<‚nt
dd    |tƒƒ}nXt|tƒrt|j|ƒSt|tƒr›t j!|g|ƒ}n_t|tƒrÔd
„}t"|t j!|g|ƒƒ}n&d t#|ƒ}    |jt
d|    ƒƒSt|dƒrt$||j%ƒ}n|S( sþ Try to convert the parameter into something WSGI compatible and set
        correct HTTP headers when possible.
        Support: False, str, unicode, dict, HTTPResponse, HTTPError, file-like,
        iterable of strings and iterable of unicodes
        sContent-Lengthitreadswsgi.file_wrapperRnt__iter__RciôsUnhandled exceptioncSs|jtjƒS(N(RfRtcharset(RH((s#.\\ServerPython\webbottle\bottle.pyRIDssUnsupported response type: %s(&RRdR7R~RgReRéRfR˜R¡RÆRR?Rït status_codeRŠt_castRYRRR[RWRtWSGIFileWrappertitertnextt StopIterationRŽRRR‘R.R*RZR[R_Rt
_closeiterRn(
R†R“tpeektiouttfirstRùRÑtnew_itertencoderRã((s#.\\ServerPython\webbottle\bottle.pyRšsj                            !cCsRyw|j|j|ƒƒ}tjdks:|ddkr_t|dƒrV|jƒng}n|tjtjƒ|SWnÔtt    t
fk
r–‚n¸t k
rM}|j s´‚ndt |jd    d
ƒƒ}tr|d t t|ƒƒt tƒƒf7}n|d j|ƒ|d jƒdg}|d|tjƒƒt|ƒgSXdS(s The bottle WSGI-interface. idieiÌi0RúRýRns4<h1>Critical error while processing request: %s</h1>RûRüsD<h2>Error:</h2>
<pre>
%s
</pre>
<h2>Traceback:</h2>
<pre>
%s
</pre>
s wsgi.errorss Content-Typestext/html; charset=UTF-8s500 INTERNAL SERVER ERRORN(idieiÌi0(s Content-Typestext/html; charset=UTF-8(RšR•Rt _status_codeR[Rnt _status_lineRSRŽRRR‘R.t html_escapeRïRtRR*RGR’RERTRi(R†RRVR“RùRltheaders((s#.\\ServerPython\webbottle\bottle.pytwsgiMs0         &    cCs|j||ƒS(s9 Each instance of :class:'Bottle' is a WSGI application. (R©(R†RRV((s#.\\ServerPython\webbottle\bottle.pyRZhscCstj|ƒ|S(sA Use this application as default for all module-level shortcuts. (t default_apptpush(R†((s#.\\ServerPython\webbottle\bottle.pyt    __enter__ls cCstjƒdS(N(RªRñ(R†texc_typet    exc_valuet    traceback((s#.\\ServerPython\webbottle\bottle.pyt__exit__qscCs3||jkr"td|ƒ‚n||j|<dS(Ns.Attribute %s already defined. Plugin conflict?(R—Ro(R†R=R((s#.\\ServerPython\webbottle\bottle.pyt __setattr__ts(sbefore_requests after_requests    app_resetsconfigN(,R‰R“R”R˜R4R‡R‚R.RFRHR–RGRJRLR8RNReRhRiRjR@RpR1RRnRqRÀRxRgRaRïR}RRRƒRÑRŠR•RšR©RZR¬R°R±(((s#.\\ServerPython\webbottle\bottle.pyR-nsV    $                    
    "            
                               ,        1 I                t BaseRequestcBsPeZdZdAZdZdBd„Zedddeƒd„ƒZ    edddeƒd„ƒZ
edd    deƒd
„ƒZ e d „ƒZ e d „ƒZedd deƒd„ƒZdBd„Zedddeƒd„ƒZdBdBejd„Zedddeƒd„ƒZedddeƒd„ƒZedddeƒd„ƒZedddeƒd„ƒZedddeƒd„ƒZd„Zed„ƒZedddeƒd „ƒZd!„Ze d"„ƒZe d#„ƒZ eZ!edd$deƒd%„ƒZ"e d&„ƒZ#edd'deƒd(„ƒZ$e d)„ƒZ%e d*„ƒZ&e d+„ƒZ'd,d-„Z(e d.„ƒZ)e d/„ƒZ*e d0„ƒZ+e d1„ƒZ,e d2„ƒZ-e d3„ƒZ.e d4„ƒZ/d5„Z0dBd6„Z1d7„Z2d8„Z3d9„Z4d:„Z5d;„Z6d<„Z7d=„Z8d>„Z9d?„Z:d@„Z;RS(Csd A wrapper for WSGI environment dictionaries that adds a lot of
        convenient access methods and properties. Most of them are read-only.
 
        Adding new attributes to a request actually adds them to the environ
        dictionary (as 'bottle.request.ext.<name>'). This is the recommended
        way to store and access request-specific data.
    RicCs,|dkrin||_||jd<dS(s! Wrap a WSGI environ dictionary. sbottle.requestN(R1R(R†R((s#.\\ServerPython\webbottle\bottle.pyR‡ss
bottle.appR…cCstdƒ‚dS(s+ Bottle application handling this request. s0This request is not connected to an application.N(t RuntimeError(R†((s#.\\ServerPython\webbottle\bottle.pyR ”ss bottle.routecCstdƒ‚dS(s= The bottle :class:`Route` object that matches this request. s)This request is not connected to a route.N(R³(R†((s#.\\ServerPython\webbottle\bottle.pyRa™ssroute.url_argscCstdƒ‚dS(s' The arguments extracted from the URL. s)This request is not connected to a route.N(R³(R†((s#.\\ServerPython\webbottle\bottle.pyRǞscCs d|jjddƒjdƒS(s† The value of ``PATH_INFO`` with exactly one prefixed slash (to fix
            broken clients and avoid the "empty path" edge case). RüRûRc(RRïRf(R†((s#.\\ServerPython\webbottle\bottle.pyR®£scCs|jjddƒjƒS(s6 The ``REQUEST_METHOD`` value as an uppercase string. RúRÿ(RRïR(R†((s#.\\ServerPython\webbottle\bottle.pyRÕ©ssbottle.request.headerscCs t|jƒS(sf A :class:`WSGIHeaderDict` that provides case-insensitive access to
            HTTP request headers. (tWSGIHeaderDictR(R†((s#.\\ServerPython\webbottle\bottle.pyR¨®scCs|jj||ƒS(sA Return the value of a request header, or a given default value. (R¨Rï(R†R=R    ((s#.\\ServerPython\webbottle\bottle.pyt
get_header´ssbottle.request.cookiescCs5t|jjddƒƒjƒ}td„|DƒƒS(sŒ Cookies parsed into a :class:`FormsDict`. Signed cookies are NOT
            decoded. Use :meth:`get_cookie` if you expect signed cookies. t HTTP_COOKIERccss!|]}|j|jfVqdS(N(R„R(Råtc((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>½s(RRRRïtvaluest    FormsDict(R†tcookies((s#.\\ServerPython\webbottle\bottle.pyRº¸s!c
Csä|jj|ƒ}|rÚ|rÖ|jdƒrÖd|krÖtt|djddƒƒ\}}tjt|ƒ|d|ƒjƒ}t    |t
j |ƒƒrÖt j t
j|ƒƒ}    |    rÓ|    d|krÓ|    dSqÖn|S|pã|S(s Return the content of a cookie. To read a `Signed Cookie`, the
            `secret` must match the one used to create the cookie (see
            :meth:`BaseResponse.set_cookie`). If anything goes wrong (missing
            cookie or wrong signature), return a default value. t!Rit    digestmodi(RºRïRR%RiR`thmactnewtdigestt_lscmptbase64t    b64encodetpickleR.t    b64decode(
R†R„R    tsecretR¼RtsigRãthashtdst((s#.\\ServerPython\webbottle\bottle.pyt
get_cookie¿s!%$sbottle.request.querycCsTtƒ}|jd<t|jjddƒƒ}x|D]\}}|||<q6W|S(s The :attr:`query_string` parsed into a :class:`FormsDict`. These
            values are sometimes called "URL arguments" or "GET parameters", but
            not to be confused with "URL wildcards" as they are provided by the
            :class:`Router`. s
bottle.gett QUERY_STRINGRc(R¹Rt
_parse_qslRï(R†RïtpairsR„R((s#.\\ServerPython\webbottle\bottle.pyRôÑs
sbottle.request.formscCsItƒ}x9|jjƒD](\}}t|tƒs|||<qqW|S(s Form values parsed from an `url-encoded` or `multipart/form-data`
            encoded POST or PUT request body. The result is returned as a
            :class:`FormsDict`. All keys and values are strings. File uploads
            are stored separately in :attr:`files`. (R¹R|tallitemsRdt
FileUpload(R†tformsR=titem((s#.\\ServerPython\webbottle\bottle.pyRÏÝs
    sbottle.request.paramscCsatƒ}x'|jjƒD]\}}|||<qWx'|jjƒD]\}}|||<qCW|S(s‰ A :class:`FormsDict` with the combined values of :attr:`query` and
            :attr:`forms`. File uploads are stored in :attr:`files`. (R¹RôRÍRÏ(R†R9R„R((s#.\\ServerPython\webbottle\bottle.pyR9és     sbottle.request.filescCsItƒ}x9|jjƒD](\}}t|tƒr|||<qqW|S(s˜ File uploads parsed from `multipart/form-data` encoded POST or PUT
            request body. The values are instances of :class:`FileUpload`.
 
        (R¹R|RÍRdRÎ(R†tfilesR=RÐ((s#.\\ServerPython\webbottle\bottle.pyRÑôs
    sbottle.request.jsoncCsˆ|jjddƒjƒjdƒd}|d    kr„|jƒ}|sJd
Syt|ƒSWq„ttfk
r€t    ddƒ‚q„Xnd
S( sL If the ``Content-Type`` header is ``application/json`` or
            ``application/json-rpc``, this property holds the parsed content
            of the request body. Only requests smaller than :attr:`MEMFILE_MAX`
            are processed to avoid memory exhaustion.
            Invalid JSON raises a 400 error response.
        t CONTENT_TYPERct;isapplication/jsonsapplication/json-rpcis Invalid JSON(sapplication/jsonsapplication/json-rpcN(
RRïtlowerR`t_get_body_stringR1t
json_loadsRÅRmRÆ(R†tctypetb((s#.\\ServerPython\webbottle\bottle.pytjsons(  ccsWtd|jƒ}x>|rR|t||ƒƒ}|s:Pn|V|t|ƒ8}qWdS(Ni(tmaxtcontent_lengthtminR¡(R†R–tbufsizetmaxreadtpart((s#.\\ServerPython\webbottle\bottle.pyt
_iter_bodys    c cs•tddƒ}tdƒtdƒtdƒ}}}xYtr|dƒ}xT|d|kr |dƒ}||7}|s‚|‚nt|ƒ|krM|‚qMqMW|j|ƒ\}}    }    ytt|jƒƒdƒ}
Wntk
rñ|‚nX|
d    krPn|} xg|
d    krq| s5|t    |
|ƒƒ} n| |
 | |
} } | sY|‚n| V|
t| ƒ8}
q W|d
ƒ|kr8|‚q8q8WdS( Nis*Error while parsing chunked transfer body.s
RÓRciiþÿÿÿiii(
RÆRiRËR¡t    partitionR¬ttonatRsRÅRÜ( R–RÝRltrntsemtbstheaderR·tsizeR!RÞtbuffRß((s#.\\ServerPython\webbottle\bottle.pyt _iter_chunkeds:&      
      
     sbottle.request.bodycCsy|jdj}Wn)tk
r?tƒ|jd<|jdSX|jrR|jn|j}tƒdt}}}x‚|||jƒD]n}|j    |ƒ|t
|ƒ7}| r…||jkr…t ddƒ|}}|j    |j ƒƒ~t }q…q…W||jd<|jdƒ|S(Ns
wsgi.inputiRÛsw+b(RR–RòRVtchunkedRéRàR•t MEMFILE_MAXRGR¡R)tgetvalueRËtseek(R†t    read_funct    body_iterRRt    body_sizet is_temp_fileRßttmp((s#.\\ServerPython\webbottle\bottle.pyt_body7s$      cCsƒ|j}||jkr*tddƒ‚n|dkrF|jd}n|jj|ƒ}t|ƒ|jkrtddƒ‚n|S(s~ read body until content-length or MEMFILE_MAX into a string. Raise
            HTTPError(413) on requests that are to large. isRequest entity too largeii(RÛRëRÆRRR–R¡(R†tclenR((s#.\\ServerPython\webbottle\bottle.pyRÕLs     cCs|jjdƒ|jS(sl The HTTP request body as a seek-able file-like object. Depending on
            :attr:`MEMFILE_MAX`, this is either a temporary file or a
            :class:`io.BytesIO` instance. Accessing this property for the first
            time reads and replaces the ``wsgi.input`` environ variable.
            Subsequent accesses just do a `seek(0)` on the file object. i(RóRí(R†((s#.\\ServerPython\webbottle\bottle.pyRRXscCsd|jjddƒjƒkS(s( True if Chunked transfer encoding was. RêtHTTP_TRANSFER_ENCODINGRc(RRïRÔ(R†((s#.\\ServerPython\webbottle\bottle.pyRêbs sbottle.request.postc    CsNtƒ}|jjdƒs[tt|jƒdƒƒ}x|D]\}}|||<q=W|Sidd6}x1dD])}||jkro|j|||<qoqoWtd|jd    |d
t    ƒ}t
rÍd |d <nt j |}||d <|j pòg}xR|D]J}|jr6t|j|j|j|jƒ||j<qü|j||j<qüW|S(sÜ The values of :attr:`forms` and :attr:`files` combined into a single
            :class:`FormsDict`. Values are either strings (form values) or
            instances of :class:`cgi.FieldStorage` (file uploads).
        s
multipart/RQRcRÊRúRÒtCONTENT_LENGTHtfpRtkeep_blank_valuesRbRPs_cgi.FieldStorage(sREQUEST_METHODs CONTENT_TYPERö(R¹t content_typeRRËRâRÕRR€RRRËR#tcgit FieldStorageR~tfilenameRÎtfileR=R¨R(    R†R}RÌR„Rtsafe_envRRRÐ((s#.\\ServerPython\webbottle\bottle.pyR|ks,       
     cCs |jjƒS(só The full request URI including hostname and scheme. If your app
            lives behind a reverse proxy or load balancer and you get confusing
            results, make sure that the ``X-Forwarded-Host`` header is set
            correctly. (turlpartstgeturl(R†((s#.\\ServerPython\webbottle\bottle.pyRøŒssbottle.request.urlpartsc    CsÕ|j}|jdƒp'|jddƒ}|jdƒpE|jdƒ}|s§|jddƒ}|jdƒ}|r§||dkrŠd    nd
kr§|d |7}q§nt|jƒ}t||||jd ƒd ƒS(sõ The :attr:`url` string as an :class:`urlparse.SplitResult` tuple.
            The tuple contains (scheme, host, path, query_string and fragment),
            but the fragment is always empty because it is not visible to the
            server. tHTTP_X_FORWARDED_PROTOswsgi.url_schemethttptHTTP_X_FORWARDED_HOSTt    HTTP_HOSTt SERVER_NAMEs    127.0.0.1t SERVER_PORTt80t443t:RÊRc(RRïturlquotetfullpathtUrlSplitResult(R†tenvRthosttportR®((s#.\\ServerPython\webbottle\bottle.pyRÿ”s    $cCst|j|jjdƒƒS(s: Request path including :attr:`script_name` (if present). Rü(RKt script_nameR®Rf(R†((s#.\\ServerPython\webbottle\bottle.pyR §scCs|jjddƒS(sh The raw :attr:`query` part of the URL (everything in between ``?``
            and ``#``) as a string. RÊRc(RRï(R†((s#.\\ServerPython\webbottle\bottle.pyt query_string¬scCs4|jjddƒjdƒ}|r0d|dSdS(sñ The initial portion of the URL's `path` that was removed by a higher
            level (server or routing middleware) before the application was
            called. This script path is returned with leading and tailing
            slashes. RrRcRü(RRïRs(R†R((s#.\\ServerPython\webbottle\bottle.pyR²sicCsCt|jjddƒ|j|ƒ\}}|||d<|d<dS(s÷ Shift path segments from :attr:`path` to :attr:`script_name` and
            vice versa.
 
           :param shift: The number of path segments to shift. May be negative
                         to change the shift direction. (default: 1)
        RrRüRûN(RXRRïR®(R†tshifttscriptR®((s#.\\ServerPython\webbottle\bottle.pyRX»s*cCst|jjdƒpdƒS(sÞ The request body length as an integer. The client is responsible to
            set this header. Otherwise, the real length of the body is unknown
            and -1 is returned. In this case, :attr:`body` will be empty. Röiÿÿÿÿ(R¬RRï(R†((s#.\\ServerPython\webbottle\bottle.pyRÛÅscCs|jjddƒjƒS(sA The Content-Type header as a lowercase-string (default: empty). RÒRc(RRïRÔ(R†((s#.\\ServerPython\webbottle\bottle.pyRùÌscCs%|jjddƒ}|jƒdkS(sÉ True if the request was triggered by a XMLHttpRequest. This only
            works with JavaScript libraries that support the `X-Requested-With`
            header (most of the popular libraries do). tHTTP_X_REQUESTED_WITHRctxmlhttprequest(RRïRÔ(R†trequested_with((s#.\\ServerPython\webbottle\bottle.pytis_xhrÑscCs|jS(s9 Alias for :attr:`is_xhr`. "Ajax" is not the right term. (R(R†((s#.\\ServerPython\webbottle\bottle.pytis_ajaxÙscCsKt|jjddƒƒ}|r%|S|jjdƒ}|rG|dfSdS(s« HTTP authentication data as a (user, password) tuple. This
            implementation currently supports basic (not digest) authentication
            only. If the authentication happened at a higher level (e.g. in the
            front web-server or a middleware), the password field is None, but
            the user field is looked up from the ``REMOTE_USER`` environ
            variable. On any errors, None is returned. tHTTP_AUTHORIZATIONRct REMOTE_USERN(t
parse_authRRïR1(R†tbasictruser((s#.\\ServerPython\webbottle\bottle.pytauthÞs
cCsa|jjdƒ}|r>g|jdƒD]}|jƒ^q(S|jjdƒ}|r]|gSgS(s( A list of all IPs that were involved in this request, starting with
            the client IP and followed by zero or more proxies. This does only
            work if all proxies support the ```X-Forwarded-For`` header. Note
            that this information can be forged by malicious clients. tHTTP_X_FORWARDED_FORRt REMOTE_ADDR(RRïR`Rs(R†tproxytiptremote((s#.\\ServerPython\webbottle\bottle.pyt remote_routeìs
&cCs|j}|r|dSdS(sg The client IP as a string. Note that this information can be forged
            by malicious clients. iN(R$R1(R†Ra((s#.\\ServerPython\webbottle\bottle.pyt remote_addr÷s    cCst|jjƒƒS(sD Return a new :class:`Request` with a shallow :attr:`environ` copy. (tRequestRtcopy(R†((s#.\\ServerPython\webbottle\bottle.pyR'þscCs|jj||ƒS(N(RRï(R†RR    ((s#.\\ServerPython\webbottle\bottle.pyRïscCs |j|S(N(R(R†R„((s#.\\ServerPython\webbottle\bottle.pyt __getitem__scCsd||<|j|=dS(NRc(R(R†R„((s#.\\ServerPython\webbottle\bottle.pyt __delitem__s
cCs t|jƒS(N(RœR(R†((s#.\\ServerPython\webbottle\bottle.pyR— scCs t|jƒS(N(R¡R(R†((s#.\\ServerPython\webbottle\bottle.pyt__len__scCs |jjƒS(N(RRØ(R†((s#.\\ServerPython\webbottle\bottle.pyRØscCs¢|jjdƒr!tdƒ‚n||j|<d}|dkrId}n-|d
kr^d}n|jd ƒrvd}nx%|D]}|jjd|dƒq}WdS(sA Change an environ value and clear all caches that depend on it. sbottle.request.readonlys$The environ dictionary is read-only.s
wsgi.inputRRRÏRÑR9R}RÙRÊRôtHTTP_R¨Rºsbottle.request.N((sbodysformssfilessparamsspostsjson(squerysparams(sheadersscookies(RRïRòRRñR1(R†R„Rttodelete((s#.\\ServerPython\webbottle\bottle.pyt __setitem__s                cCsd|jj|j|jfS(Ns <%s: %s %s>(t    __class__R‰RÕRø(R†((s#.\\ServerPython\webbottle\bottle.pyR,(scCs]y5|jd|}t|dƒr0|j|ƒS|SWn!tk
rXtd|ƒ‚nXdS(s@ Search in self.environ for additional user defined attributes. sbottle.request.ext.%sRsAttribute %r not defined.N(RR[RRòRo(R†R=tvar((s#.\\ServerPython\webbottle\bottle.pyt __getattr__+s
$ cCs\|dkrtj|||ƒSd|}||jkrKtd|ƒ‚n||j|<dS(NRsbottle.request.ext.%ssAttribute already defined: %s(tobjectR±RRo(R†R=RR„((s#.\\ServerPython\webbottle\bottle.pyR±3s  
cCs:y|jd|=Wn!tk
r5td|ƒ‚nXdS(Nsbottle.request.ext.%ssAttribute not defined: %s(RRòRo(R†R=R((s#.\\ServerPython\webbottle\bottle.pyt __delattr__:s (senvironN(<R‰R“R”t    __slots__RëR1R‡R‚RËR RaRÇtpropertyR®RÕR¨RµRºthashlibtsha256RÉRôRÏR9RÑRÙRàt staticmethodRéRóRÕRRRêRÿR|RøRÿR RRRXRÛRùRRRR$R%R'RïR(R)R—R*RØR-R,R0R±R2(((s#.\\ServerPython\webbottle\bottle.pyR²sf               
!    
                                          cCsMd|ks$d|ks$d|kr7td|ƒ‚n|jƒjddƒS(Ns
s ts4Header names must not contain control characters: %rR!t-(RÅttitletreplace(R„((s#.\\ServerPython\webbottle\bottle.pyt_hkeyAs$cCsGt|ƒ}d|ks0d|ks0d|krCtd|ƒ‚n|S(Ns
s R8s4Header value must not contain control characters: %r(RâRÅ(R((s#.\\ServerPython\webbottle\bottle.pyt_hvalGs $tHeaderPropertycBs5eZdddd„Zd„Zd„Zd„ZRS(RccCs=|||_|_|||_|_d|jƒ|_dS(NsCurrent value of the %r header.(R=R    treadertwriterR:R”(R†R=R?R@R    ((s#.\\ServerPython\webbottle\bottle.pyR‡OscCsB|dkr|S|j|j|jƒ}|jr>|j|ƒS|S(N(R1RµR=R    R?(R†RŒR!R((s#.\\ServerPython\webbottle\bottle.pyRTs cCs)|jr|j|ƒn|||j<dS(N(R@R=(R†RŒR((s#.\\ServerPython\webbottle\bottle.pyR‘YscCs||j=dS(N(R=(R†RŒ((s#.\\ServerPython\webbottle\bottle.pyR’\sN(R‰R“R1R‡RR‘R’(((s#.\\ServerPython\webbottle\bottle.pyR>Ns        t BaseResponsec
BseZdZdZdZied+ƒd6ed,ƒd 6Zd d-d-d„Zd-d„Z    d„Z
d„Z e d„ƒZ e d„ƒZd„Zd„Ze eed-dƒZ[[e d„ƒZd„Zd„Zd„Zd„Zd-d„Zd„Zd„Zd„Ze d „ƒZedƒZedd!eƒZed"d!d#„d$d%„ƒZ e d&d'„ƒZ!d-e"j#d(„Z$d)„Z%d*„Z&RS(.sº Storage class for a response body as well as headers and cookies.
 
        This class does support dict-like case-insensitive item-access to
        headers, but is NOT a dict. Most notably, iterating over a response
        yields parts of the body and not the headers.
 
        :param body: The response body as one of the supported types.
        :param status: Either an HTTP status code (e.g. 200) or a status line
                       including the reason phrase (e.g. '200 OK').
        :param headers: A dictionary or a list of name-value pairs.
 
        Additional keyword arguments are added to the list of headers.
        Underscores in the header name are replaced with dashes.
    iÈstext/html; charset=UTF-8s Content-TypesContent-LengthiÌRsContent-EncodingsContent-Languages Content-Ranges Content-Md5s Last-Modifiedi0RccKsµd|_i|_||_|p'|j|_|r{t|tƒrQ|jƒ}nx'|D]\}}|j    ||ƒqXWn|r±x-|jƒD]\}}|j    ||ƒqŽWndS(N(
R1t_cookiest_headersRRtdefault_statusRPRdR€R2RQ(R†RRRPR¨t more_headersR=R((s#.\\ServerPython\webbottle\bottle.pyR‡|s            cCs“|p    t}t|tƒs!t‚|ƒ}|j|_td„|jjƒDƒƒ|_|jrtƒ|_|jj    |jj
ddƒƒn|S(s Returns a copy of self. css"|]\}}||fVqdS(N((Råtktv((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>sRæRc( RAt
issubclasstAssertionErrorRPR€RCR2RBRRRztoutput(R†RR'((s#.\\ServerPython\webbottle\bottle.pyR'Šs      "     "cCs t|jƒS(N(RœRR(R†((s#.\\ServerPython\webbottle\bottle.pyR—–scCs&t|jdƒr"|jjƒndS(NRn(R[RRRn(R†((s#.\\ServerPython\webbottle\bottle.pyRn™scCs|jS(s; The HTTP status line as a string (e.g. ``404 Not Found``).(R¦(R†((s#.\\ServerPython\webbottle\bottle.pyt status_linescCs|jS(s/ The HTTP status code as an integer (e.g. 404).(R¥(R†((s#.\\ServerPython\webbottle\bottle.pyR™¢scCs¶t|tƒr(|tj|ƒ}}n=d|krY|jƒ}t|jƒdƒ}n tdƒ‚d|ko|dknstdƒ‚n||_t|p©d|ƒ|_    dS(Nt is+String status line without a reason phrase.idiçsStatus code out of range.s
%d Unknown(
RdR¬t_HTTP_STATUS_LINESRïRsR`RÅR¥R«R¦(R†RPR„((s#.\\ServerPython\webbottle\bottle.pyt _set_status§s       cCs|jS(N(R¦(R†((s#.\\ServerPython\webbottle\bottle.pyt _get_status´ssQ A writeable property to change the HTTP response status. It accepts
            either a numeric code (100-999) or a string with a custom reason
            phrase (e.g. "404 Brain not found"). Both :data:`status_line` and
            :data:`status_code` are updated accordingly. The return value is
            always a status string. cCstƒ}|j|_|S(sl An instance of :class:`HeaderDict`, a case-insensitive dict-like
            view on the response headers. (t
HeaderDictRCR€(R†thdict((s#.\\ServerPython\webbottle\bottle.pyR¨Às     cCst|ƒ|jkS(N(R<RC(R†R=((s#.\\ServerPython\webbottle\bottle.pyt __contains__ÈscCs|jt|ƒ=dS(N(RCR<(R†R=((s#.\\ServerPython\webbottle\bottle.pyR)ËscCs|jt|ƒdS(Niÿÿÿÿ(RCR<(R†R=((s#.\\ServerPython\webbottle\bottle.pyR(ÎscCs t|ƒg|jt|ƒ<dS(N(R=RCR<(R†R=R((s#.\\ServerPython\webbottle\bottle.pyR-ÑscCs |jjt|ƒ|gƒdS(s| Return the value of a previously defined header. If there is no
            header with that name, return a default value. iÿÿÿÿ(RCRïR<(R†R=R    ((s#.\\ServerPython\webbottle\bottle.pyRµÔscCs t|ƒg|jt|ƒ<dS(sh Create a new response header, replacing any previously defined
            headers with the same name. N(R=RCR<(R†R=R((s#.\\ServerPython\webbottle\bottle.pyt
set_headerÙscCs,|jjt|ƒgƒjt|ƒƒdS(s= Add an additional response header, not removing duplicates. N(RCRÎR<R R=(R†R=R((s#.\\ServerPython\webbottle\bottle.pyRQÞscCs|jS(sx Yield (header, value) tuples, skipping headers that are not
            allowed with the current response status code. (RS(R†((s#.\\ServerPython\webbottle\bottle.pyt iter_headersâsc CsSg}t|jjƒƒ}d|jkrF|jd|jgfƒn|j|jkr”|j|j}g|D]}|d|kro|^qo}n|g|D]%\}}|D]}||f^q®qž7}|jrx9|jjƒD]%}|jdt    |j
ƒƒfƒqãWnt rOg|D]*\}    }
|    |
j dƒj dƒf^q}n|S(s. WSGI conform list of (header, value) tuples. s Content-Typeis
Set-CookieRbRQ(R~RCR2R tdefault_content_typeR¥t bad_headersRBR¸R=t OutputStringR#RfRk( R†R“R¨RVthR=tvalstvalR·RFRG((s#.\\ServerPython\webbottle\bottle.pyRSçs,6    &:R?tExpirescCstjt|ƒƒS(N(R'tutcfromtimestampt
parse_date(RH((s#.\\ServerPython\webbottle\bottle.pyRIýsR@cCs
t|ƒS(N(t    http_date(RH((s#.\\ServerPython\webbottle\bottle.pyRIþssUTF-8cCs:d|jkr6|jjdƒdjdƒdjƒS|S(sJ Return the charset specified in the content-type header (default: utf8). scharset=iÿÿÿÿRÓi(RùR`Rs(R†R    ((s#.\\ServerPython\webbottle\bottle.pyR˜s'c    KsK|jstƒ|_ndtjd<|rÅt|tƒsPtddddƒntjt    j
||gdƒƒ}tjt j t |ƒ|d|ƒjƒƒ}tt d    ƒ|t d
ƒ|ƒ}nt|tƒsãtd ƒ‚nt|ƒt|ƒd krtd ƒ‚n||j|<x)|jƒD]\}}|dkrmt|tƒrm|j|jdd}qmn|dkrÙt|ttfƒr|jƒ}n't|ttfƒrÄtj|ƒ}ntjd|ƒ}n|dkr |jƒdkr t d|fƒ‚n|dkr&| r&q(n||j||j!ddƒ<q(WdS(sõ Create a new cookie or replace an old one. If the `secret` parameter is
            set, create a `Signed Cookie` (described below).
 
            :param name: the name of the cookie.
            :param value: the value of the cookie.
            :param secret: a signature key required for signed cookies.
 
            Additionally, this method accepts all RFC 2109 attributes that are
            supported by :class:`cookie.Morsel`, including:
 
            :param max_age: maximum age in seconds. (default: None)
            :param expires: a datetime object or UNIX timestamp. (default: None)
            :param domain: the domain that is allowed to read the cookie.
              (default: current domain)
            :param path: limits the cookie to a given path (default: current path)
            :param secure: limit the cookie to HTTPS connections (default: off).
            :param httponly: prevents client-side javascript to read this cookie
              (default: off, requires Python 2.6 or newer).
            :param same_site: disables third-party use for a cookie.
              Allowed attributes: `lax` and `strict`.
              In strict mode the cookie will never be sent.
              In lax mode the cookie is only sent with a top-level GET request.
 
            If neither `expires` nor `max_age` is set (default), the cookie will
            expire at the end of the browser session (as soon as the browser
            window is closed).
 
            Signed cookies may store any pickle-able object and are
            cryptographically signed to prevent manipulation. Keep in mind that
            cookies are limited to 4kb in most browsers.
 
            Warning: Pickle is a potentially dangerous format. If an attacker
            gains access to the secret key, he could forge cookies that execute
            code on server side if unpickeld. Using pickle is discouraged and
            support for it will be removed in later versions of bottle.
 
            Warning: Signed cookies are not encrypted (the client can still see
            the content) and not copy-protected (the client can restore an old
            cookie). The main intention is to make pickling and unpickling
            save, not to store secret information at client side.
        tSameSites    same-siteii s9Pickling of arbitrary objects into cookies is deprecated.s:Only store strings in cookies. JSON strings are fine, too.iÿÿÿÿR¼R»Rs+Secret key required for non-string cookies.iØs#Content does not fit into a cookie.tmax_ageiitexpiress%a, %d %b %Y %H:%M:%S GMTt    same_sitetlaxRjsInvalid attribute %rtsecurethttponlyR!R9N(Rcsstrict(RdRe("RBRRRSt    _reservedRdRyR}RÁRÂRÃR-R½R¾RiR¿RXRmR¡RÅR2R(tsecondstdaystdatedateR't    timetupleR¬R­ttimetgmtimetstrftimeRÔRTR;(    R†R=RRÅR¼RctencodedRÆR„((s#.\\ServerPython\webbottle\bottle.pyt
set_cookies>*      
!'   cKs+d|d<d|d<|j|d|dS(sq Delete a cookie. Be sure to use the same `domain` and `path`
            settings as used to create the cookie. iÿÿÿÿR`iRaRcN(Ro(R†R„RD((s#.\\ServerPython\webbottle\bottle.pyt delete_cookieZs
 
cCsDd}x7|jD],\}}|d|jƒ|jƒf7}qW|S(NRcs%s: %s
(RSR:Rs(R†R“R=R((s#.\\ServerPython\webbottle\bottle.pyR,as$(s Content-TypesContent-Length(sAllowsContent-EncodingsContent-LanguagesContent-Lengths Content-Ranges Content-Types Content-Md5s Last-ModifiedN('R‰R“R”RDRUt    frozensetRVR1R‡R'R—RnR4RKR™RNRORPR¨RRR)R(R-RµRSRQRTRSR>RùR¬RÛRaR˜R5R6RoRpR,(((s#.\\ServerPython\webbottle\bottle.pyRA`sR                                                               S    csLtjƒ‰‡fd†}‡fd†}‡fd†}t|||dƒS(Ncs/y ˆjSWntk
r*tdƒ‚nXdS(Ns Request context not initialized.(R/RoR³(R!(tls(s#.\\ServerPython\webbottle\bottle.pytfgetks  cs |ˆ_dS(N(R/(R!R(Rr(s#.\\ServerPython\webbottle\bottle.pytfsetqscs
ˆ`dS(N(R/(R!(Rr(s#.\\ServerPython\webbottle\bottle.pytfdeltssThread-local property(t    threadingtlocalR4(RsRtRu((Rrs#.\\ServerPython\webbottle\bottle.pyt_local_propertyhs
 t LocalRequestcBs eZdZejZeƒZRS(sT A thread-local subclass of :class:`BaseRequest` with a different
        set of attributes for each thread. There is usually only one global
        instance of this class (:data:`request`). If accessed during a
        request/response cycle, this instance always refers to the *current*
        request (even on a multithreaded server). (R‰R“R”R²R‡RŒRxR(((s#.\\ServerPython\webbottle\bottle.pyRyzs    t LocalResponsecBsDeZdZejZeƒZeƒZeƒZ    eƒZ
eƒZ RS(s+ A thread-local subclass of :class:`BaseResponse` with a different
        set of attributes for each thread. There is usually only one global
        instance of this class (:data:`response`). Its attributes are used
        to build the HTTP response at the end of the request/response cycle.
    ( R‰R“R”RAR‡RŒRxR¦R¥RBRCRR(((s#.\\ServerPython\webbottle\bottle.pyRz„s                    RYcBs#eZdddd„Zd„ZRS(RccKs#tt|ƒj||||dS(N(tsuperRYR‡(R†RRRPR¨RE((s#.\\ServerPython\webbottle\bottle.pyR‡—scCs@|j|_|j|_|j|_|j|_|j|_dS(N(R¥R¦RCRBRR(R†tother((s#.\\ServerPython\webbottle\bottle.pyRšs
    N(R‰R“R1R‡R(((s#.\\ServerPython\webbottle\bottle.pyRY–sRÆcBs#eZdZddddd„ZRS(iôcKs2||_||_tt|ƒj|||dS(N(t    exceptionR¯R{RÆR‡(R†RPRRR}R¯RE((s#.\\ServerPython\webbottle\bottle.pyR‡¥s        N(R‰R“RDR1R‡(((s#.\\ServerPython\webbottle\bottle.pyRÆ¢s
t PluginErrorcBseZRS((R‰R“(((s#.\\ServerPython\webbottle\bottle.pyR~³sRAcBs2eZdZdZed„Zd„Zd„ZRS(RÙicCs ||_dS(N(t
json_dumps(R†R((s#.\\ServerPython\webbottle\bottle.pyR‡»scCs†|jjddtdtddƒ|jjddtdtddƒ|jjddtdtdd    ƒ|jjd
dddd ƒdS( Ns json.enableR    R/Rs.Enable or disable automatic dict->json filter.s
json.asciis*Use only 7-bit ASCII characters in output.s json.indents*Add whitespace to make json more readable.sjson.dump_funcs]If defined, use this function to transform dict into json. The other options no longer apply.(Rt_defineRËR2R•R1(R†R ((s#.\\ServerPython\webbottle\bottle.pyRk¾scs,|j‰|jsˆS‡‡fd†}|S(Ncsšyˆ||Ž}Wntk
r.}|}nXt|tƒrWˆ|ƒ}dt_|St|tƒr–t|jtƒr–ˆ|jƒ|_d|_n|S(Nsapplication/json(RYRdR€RRùRR(R]Rrtrvtrespt json_response(R-R(s#.\\ServerPython\webbottle\bottle.pyRpÎs
     ! (R(R†RRaRp((R-Rs#.\\ServerPython\webbottle\bottle.pyRÊs
        (R‰R“R=tapiRR‡RkR(((s#.\\ServerPython\webbottle\bottle.pyRA·s
      RBcBs,eZdZdZdZd„Zd„ZRS(s This plugin applies the :func:`view` decorator to all routes with a
        `template` config parameter. If the parameter is a tuple, the second
        element must be a dict with additional options (e.g. `template_engine`)
        or default variables for the template. R‡icCs ||_dS(N(ttpl(R†R ((s#.\\ServerPython\webbottle\bottle.pyRkêscCs{|jjdƒ}t|ttfƒrTt|ƒdkrTt|d|d|ƒSt|tƒrst|ƒ|ƒS|SdS(NR‡iii(RRïRdR7R~R¡tviewR«(R†RRaRª((s#.\\ServerPython\webbottle\bottle.pyRís '(R‰R“R”R=R„RkR(((s#.\\ServerPython\webbottle\bottle.pyRBâs
    t_ImportRedirectcBs&eZd„Zdd„Zd„ZRS(cCsv||_||_tjj|tj|ƒƒ|_|jjj    it
d6gd6gd6|d6ƒtj j |ƒdS(s@ Create a virtual package that redirects imports (see PEP 302). t__file__t__path__t__all__t
__loader__N( R=timpmaskREtmodulesRÎtimpt
new_moduletmoduleR—R9Rˆt    meta_pathR (R†R=RŒ((s#.\\ServerPython\webbottle\bottle.pyR‡ùs        ! cCs=d|krdS|jddƒd}||jkr9dS|S(Nt.ii(trsplitR=(R†tfullnameR®tpackname((s#.\\ServerPython\webbottle\bottle.pyt find_modules  cCs|tjkrtj|S|jddƒd}|j|}t|ƒtj|}tj|<t|j||ƒ||_|S(NR’i(RERR“RŒt
__import__R™RR‹(R†R”tmodnametrealnameR((s#.\\ServerPython\webbottle\bottle.pyt load_module s  
    N(R‰R“R‡R1R–Rš(((s#.\\ServerPython\webbottle\bottle.pyR‡øs     t    MultiDictcBs
eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
e rd    „Z d
„Z d „Ze
Ze Ze ZeZn?d „Z d „Z d„Zd„Zd„Zd„Zd„Zdddd„Zd„Zd„Zd„ZeZeZRS(sé This dict stores multiple values per key, but behaves exactly like a
        normal dict in that it returns only the newest value for any given key.
        There are special methods available to access the full list of values.
    cOs,td„t||ŽjƒDƒƒ|_dS(Ncss$|]\}}||gfVqdS(N((RåRFRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>"s(R€R2(R†R]RF((s#.\\ServerPython\webbottle\bottle.pyR‡!scCs t|jƒS(N(R¡R€(R†((s#.\\ServerPython\webbottle\bottle.pyR*$scCs t|jƒS(N(RœR€(R†((s#.\\ServerPython\webbottle\bottle.pyR—'scCs ||jkS(N(R€(R†R„((s#.\\ServerPython\webbottle\bottle.pyRR*scCs|j|=dS(N(R€(R†R„((s#.\\ServerPython\webbottle\bottle.pyR)-scCs|j|dS(Niÿÿÿÿ(R€(R†R„((s#.\\ServerPython\webbottle\bottle.pyR(0scCs|j||ƒdS(N(R (R†R„R((s#.\\ServerPython\webbottle\bottle.pyR-3scCs |jjƒS(N(R€RØ(R†((s#.\\ServerPython\webbottle\bottle.pyRØ6scCsd„|jjƒDƒS(Ncss|]}|dVqdS(iÿÿÿÿN((RåRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr><s(R€R¸(R†((s#.\\ServerPython\webbottle\bottle.pyR¸;scCsd„|jjƒDƒS(Ncss%|]\}}||dfVqdS(iÿÿÿÿN((RåRFRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>?s(R€R2(R†((s#.\\ServerPython\webbottle\bottle.pyR2>scCsd„|jjƒDƒS(Ncss.|]$\}}|D]}||fVqqdS(N((RåRFtvlRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Bs(R€R2(R†((s#.\\ServerPython\webbottle\bottle.pyRÍAscCs$g|jjƒD]}|d^qS(Niÿÿÿÿ(R€R¸(R†RG((s#.\\ServerPython\webbottle\bottle.pyR¸KscCs0g|jjƒD]\}}||df^qS(Niÿÿÿÿ(R€R2(R†RFRG((s#.\\ServerPython\webbottle\bottle.pyR2NscCs |jjƒS(N(R€titerkeys(R†((s#.\\ServerPython\webbottle\bottle.pyRQscCsd„|jjƒDƒS(Ncss|]}|dVqdS(iÿÿÿÿN((RåRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Us(R€t
itervalues(R†((s#.\\ServerPython\webbottle\bottle.pyRžTscCsd„|jjƒDƒS(Ncss%|]\}}||dfVqdS(iÿÿÿÿN((RåRFRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Xs(R€t    iteritems(R†((s#.\\ServerPython\webbottle\bottle.pyRŸWscCsd„|jjƒDƒS(Ncss.|]$\}}|D]}||fVqqdS(N((RåRFRœRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>[s(R€RŸ(R†((s#.\\ServerPython\webbottle\bottle.pyt iterallitemsZscCs9g|jjƒD]%\}}|D]}||f^q qS(N(R€RŸ(R†RFRœRG((s#.\\ServerPython\webbottle\bottle.pyRÍ]siÿÿÿÿcCsAy)|j||}|r$||ƒS|SWntk
r<nX|S(sÓ Return the most recent value for a key.
 
            :param default: The default value to be returned if the key is not
                   present or the type conversion fails.
            :param index: An index for the list of available values.
            :param type: If defined, this callable is used to cast the value
                    into a specific type. Exception are suppressed and result in
                    the default value to be returned.
        (R€R‘(R†R„R    tindexRRZ((s#.\\ServerPython\webbottle\bottle.pyRï`s
 cCs |jj|gƒj|ƒdS(s5 Add a new value to the list of values for this key. N(R€RÎR (R†R„R((s#.\\ServerPython\webbottle\bottle.pyR qscCs|g|j|<dS(s1 Replace the list of values with a single value. N(R€(R†R„R((s#.\\ServerPython\webbottle\bottle.pyR;uscCs|jj|ƒpgS(s5 Return a (possibly empty) list of values for a key. (R€Rï(R†R„((s#.\\ServerPython\webbottle\bottle.pytgetallysN(R‰R“R”R‡R*R—RRR)R(R-RØR#R¸R2RÍRRžRŸR R1RïR R;R¢tgetonetgetlist(((s#.\\ServerPython\webbottle\bottle.pyR›s<                                                                                        R¹cBsPeZdZdZeZdd„Zdd„Zddd„Z    e
ƒd„Z RS(s© This :class:`MultiDict` subclass is used to store request form data.
        Additionally to the normal dict-like item access methods (which return
        unmodified data as native strings), this container also supports
        attribute-like access to its values. Attributes are automatically de-
        or recoded to match :attr:`input_encoding` (default: 'utf8'). Missing
        attributes default to an empty string. RbcCsdt|tƒr7|jr7|jdƒj|p3|jƒSt|tƒr\|j|pX|jƒS|SdS(NRQ(RdRetrecode_unicodeRfRktinput_encodingRg(R†RYRP((s#.\\ServerPython\webbottle\bottle.pyt_fixs
cCsqtƒ}|p|j}|_t|_xB|jƒD]4\}}|j|j||ƒ|j||ƒƒq5W|S(sª Returns a copy with all keys and values de- or recoded to match
            :attr:`input_encoding`. Some libraries (e.g. WTForms) want a
            unicode dictionary. (R¹R¦R•R¥RÍR R§(R†RPR'RhR„R((s#.\\ServerPython\webbottle\bottle.pyRk˜s         ,cCs7y|j|||ƒSWnttfk
r2|SXdS(s7 Return the value as a unicode string, or the default. N(R§t UnicodeErrorRò(R†R=R    RP((s#.\\ServerPython\webbottle\bottle.pyt
getunicode£scCsG|jdƒr4|jdƒr4tt|ƒj|ƒS|j|d|ƒS(Nt__R    (RRbR{R¹R0R©(R†R=R    ((s#.\\ServerPython\webbottle\bottle.pyR0ªsN( R‰R“R”R¦RËR¥R1R§RkR©ReR0(((s#.\\ServerPython\webbottle\bottle.pyR¹‚s  RPcBsneZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d d    d
„Z d „Z RS( sz A case-insensitive version of :class:`MultiDict` that defaults to
        replace the old value instead of appending it. cOs,i|_|s|r(|j||ŽndS(N(R€R9(R†R]Rr((s#.\\ServerPython\webbottle\bottle.pyR‡´s     cCst|ƒ|jkS(N(R<R€(R†R„((s#.\\ServerPython\webbottle\bottle.pyRR¸scCs|jt|ƒ=dS(N(R€R<(R†R„((s#.\\ServerPython\webbottle\bottle.pyR)»scCs|jt|ƒdS(Niÿÿÿÿ(R€R<(R†R„((s#.\\ServerPython\webbottle\bottle.pyR(¾scCs t|ƒg|jt|ƒ<dS(N(R=R€R<(R†R„R((s#.\\ServerPython\webbottle\bottle.pyR-ÁscCs,|jjt|ƒgƒjt|ƒƒdS(N(R€RÎR<R R=(R†R„R((s#.\\ServerPython\webbottle\bottle.pyR ÄscCs t|ƒg|jt|ƒ<dS(N(R=R€R<(R†R„R((s#.\\ServerPython\webbottle\bottle.pyR;ÇscCs|jjt|ƒƒpgS(N(R€RïR<(R†R„((s#.\\ServerPython\webbottle\bottle.pyR¢ÊsiÿÿÿÿcCstj|t|ƒ||ƒS(N(R›RïR<(R†R„R    R¡((s#.\\ServerPython\webbottle\bottle.pyRïÍscCs;x4d„|DƒD]"}||jkr|j|=qqWdS(Ncss|]}t|ƒVqdS(N(R<(RåRö((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>Ñs(R€(R†tnamesR=((s#.\\ServerPython\webbottle\bottle.pyR$ÐsN(R‰R“R”R‡RRR)R(R-R R;R¢R1RïR$(((s#.\\ServerPython\webbottle\bottle.pyRP°s                                R´cBsqeZdZd Zd„Zd„Zdd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „ZRS(s  This dict-like class wraps a WSGI environ dict and provides convenient
        access to HTTP_* fields. Keys and values are native strings
        (2.x bytes or 3.x unicode) and keys are case-insensitive. If the WSGI
        environment contains non-native string values, these are de- or encoded
        using a lossless 'latin1' character set.
 
        The API will remain stable even on changes to the relevant PEPs.
        Currently PEP 333, 444 and 3333 are supported. (PEP 444 is the only one
        that uses non-native strings.)
    RÒRöcCs ||_dS(N(R(R†R((s#.\\ServerPython\webbottle\bottle.pyR‡äscCs3|jddƒjƒ}||jkr+|Sd|S(s6 Translate header field name to CGI/WSGI environ key. R9R!R+(R;Rtcgikeys(R†R„((s#.\\ServerPython\webbottle\bottle.pyt_ekeyçscCs|jj|j|ƒ|ƒS(s: Return the header value as is (may be bytes or unicode). (RRïR­(R†R„R    ((s#.\\ServerPython\webbottle\bottle.pytrawîscCs\|j|j|ƒ}trXt|tƒrF|jdƒjdƒ}qX|jdƒ}n|S(NRQRb(RR­R#RdReRfRk(R†R„RZ((s#.\\ServerPython\webbottle\bottle.pyR(òs cCstd|jƒ‚dS(Ns%s is read-only.(RmR.(R†R„R((s#.\\ServerPython\webbottle\bottle.pyR-ûscCstd|jƒ‚dS(Ns%s is read-only.(RmR.(R†R„((s#.\\ServerPython\webbottle\bottle.pyR)þsccsWxP|jD]E}|d dkr2t|dƒVq
||jkr
t|ƒVq
q
WdS(NiR+(RR<R¬(R†R„((s#.\\ServerPython\webbottle\bottle.pyR—    s
cCsg|D] }|^qS(N((R†RH((s#.\\ServerPython\webbottle\bottle.pyRØ    scCst|jƒƒS(N(R¡RØ(R†((s#.\\ServerPython\webbottle\bottle.pyR*     scCs|j|ƒ|jkS(N(R­R(R†R„((s#.\\ServerPython\webbottle\bottle.pyRR    s(s CONTENT_TYPEsCONTENT_LENGTHN(R‰R“R”R¬R‡R­R1R®R(R-R)R—RØR*RR(((s#.\\ServerPython\webbottle\bottle.pyR´Ös
                                     R0cBsÈeZdZdZd„Zed„Zd    „Zd
d „Zd „Z    d „Z
d„Z d„Z d„Z d„Zd„Zd„Zdd„Zd„Zd„Zeeed„Zd„Zd„ZRS(s" A dict-like configuration storage with additional support for
        namespaces, validators, meta-data, overlays and more.
 
        This dict-like class is heavily optimized for read access. All read-only
        methods as well as item access should be as fast as the built-in dict.
    t_metat_change_listenert    _overlayst _virtual_keyst_sourcet __weakref__cCs4i|_g|_g|_d|_tƒ|_dS(N(R¯R°R±R1R³RR²(R†((s#.\\ServerPython\webbottle\bottle.pyR‡    s
                csOt|ƒ‰‡fd†tˆƒDƒ}|r>|j|ƒn |j|ƒ|S(s9Load values from a Python module.
 
           Example modue ``config.py``::
 
                DEBUG = True
                SQLITE = {
                    "db": ":memory:"
                }
 
 
           >>> c = ConfigDict()
           >>> c.load_module('config')
           {DEBUG: True, 'SQLITE.DB': 'memory'}
           >>> c.load_module("config", False)
           {'DEBUG': True, 'SQLITE': {'DB': 'memory'}}
 
           :param squash: If true (default), dictionary values are assumed to
                          represent namespaces (see :meth:`load_dict`).
        cs.i|]$}|jƒrtˆ|ƒ|“qS((tisupperR‹(RåR„(t
config_obj(s#.\\ServerPython\webbottle\bottle.pys
<dictcomp><    s    (RztdirRR9(R†R®tsquashRŒ((R¶s#.\\ServerPython\webbottle\bottle.pyRš'    s   cKs¿|jdtƒtr/|jdtjƒƒntj|}|j|ƒxm|jƒD]_}xV|j|ƒD]E}|j    ||ƒ}|dkr£|d|}n|||j
ƒ<qnWqXW|S(s³ Load values from an ``*.ini`` style config file.
 
            A configuration file consists of sections, each led by a
            ``[section]`` header, followed by key/value entries separated by
            either ``=`` or ``:``. Section names and keys are case-insensitive.
            Leading and trailing whitespace is removed from keys and values.
            Values can be omitted, in which case the key/value delimiter may
            also be left out. Values can also span multiple lines, as long as
            they are indented deeper than the first line of the value. Commands
            are prefixed by ``#`` or ``;`` and may only appear on their own on
            an otherwise empty line.
 
            Both section and key names may contain dots (``.``) as namespace
            separators. The actual configuration parameter name is constructed
            by joining section name and key name together and converting to
            lower case.
 
            The special sections ``bottle`` and ``ROOT`` refer to the root
            namespace and the ``DEFAULT`` section defines default values for all
            other sections.
 
            With Python 3, extended string interpolation is enabled.
 
            :param filename: The path of a config file, or a list of paths.
            :param options: All keyword parameters are passed to the underlying
                :class:`python:configparser.ConfigParser` constructor call.
 
        tallow_no_valuet interpolationtbottletROOTR’(R»R¼( RÎRËR#t configparsertExtendedInterpolationt ConfigParserR–tsectionsRcRïRÔ(R†RüRcRªtsectionR„R((s#.\\ServerPython\webbottle\bottle.pyt load_configE    s      RccCsxˆ|jƒD]z\}}t|tƒrq|d|jdƒ}t|tƒrd|j|d|ƒq‡|||<q tdt|ƒƒ‚q W|S(s Load values from a dictionary structure. Nesting can be used to
            represent namespaces.
 
            >>> c = ConfigDict()
            >>> c.load_dict({'some': {'namespace': {'key': 'value'} } })
            {'some.namespace.key': 'value'}
        R’t    namespacesKey has type %r (not a string)(R2RdRyRsR€RRmR(R†tsourceRÃR„Rtnskey((s#.\\ServerPython\webbottle\bottle.pyRp    s cOs{d}|rCt|dtƒrC|djdƒd}|d}nx1t||ŽjƒD]\}}||||<qYWdS(sø If the first parameter is a string, all keys are prefixed with this
            namespace. Apart from that it works just as the usual dict.update().
 
            >>> c = ConfigDict()
            >>> c.update('some.namespace', key='value')
        RciR’iN(RdRyRsR€R2(R†R]RrR¿R„R((s#.\\ServerPython\webbottle\bottle.pyR9ƒ    s  "cCs!||kr|||<n||S(N((R†R„R((s#.\\ServerPython\webbottle\bottle.pyRΑ    s  cCsÄt|tƒs(tdt|ƒƒ‚n|jj|ƒ|j|dd„ƒ|ƒ}||krv|||krvdS|j||ƒtj    |||ƒx$|j
ƒD]}|j ||ƒq¦WdS(NsKey has type %r (not a string)R$cSs|S(N((RH((s#.\\ServerPython\webbottle\bottle.pyRIœ    s( RdRyRmRR²tdiscardtmeta_gett
_on_changeR€R-t_iter_overlayst _set_virtual(R†R„Rtoverlay((s#.\\ServerPython\webbottle\bottle.pyR-–    scCsÇ||krt|ƒ‚n||jkr=td|ƒ‚n|jr||jkrtj||ƒ|j||j|ƒnD|j|dƒtj||ƒx!|jƒD]}|j    |ƒq¬WdS(Ns"Virtual keys cannot be deleted: %s(
RòR²R³R€R)RÊRÈR1RÉt_delete_virtual(R†R„RË((s#.\\ServerPython\webbottle\bottle.pyR)¦    s cCsœ||kr||jkrdS|jj|ƒ||kr^|||k    r^|j||ƒntj|||ƒx$|jƒD]}|j||ƒq~WdS(sa Recursively set or update virtual keys. Do nothing if non-virtual
            value is present. N(R²RäRÈR€R-RÉRÊ(R†R„RRË((s#.\\ServerPython\webbottle\bottle.pyRʶ    scCsz||jkrdS||kr2|j|dƒntj||ƒ|jj|ƒx!|jƒD]}|j|ƒq_WdS(sM Recursively delete virtual entry. Do nothing if key is not virtual.
        N(R²RÈR1R€R)RÆRÉRÌ(R†R„RË((s#.\\ServerPython\webbottle\bottle.pyRÌà   s cCs.x'|jD]}||||ƒr
tSq
WdS(N(R°RË(R†R„RR+((s#.\\ServerPython\webbottle\bottle.pyRÈР   scCs|jj|ƒ|S(N(R°R (R†R8((s#.\\ServerPython\webbottle\bottle.pyR6Õ    scCs|jj|iƒj||ƒS(s- Return the value of a meta field for a key. (R¯Rï(R†R„t    metafieldR    ((s#.\\ServerPython\webbottle\bottle.pyRÇÙ    scCs||jj|iƒ|<dS(s. Set the meta field for a key to a new value. N(R¯RÎ(R†R„RÍR((s#.\\ServerPython\webbottle\bottle.pyR1Ý    scCs|jj|iƒjƒS(s; Return an iterable of meta field names defined for a key. (R¯RïRØ(R†R„((s#.\\ServerPython\webbottle\bottle.pyt    meta_listá    scCsg|tk    r|j||ƒn|tk    rA|j|d|ƒn|tk    rc|j|d|ƒndS(sB (Unstable) Shortcut for plugins to define own config parameters. RR/N(t_UNSETRÎR1(R†R„R    RR/((s#.\\ServerPython\webbottle\bottle.pyR€å    s    ccs5x.|jD]#}|ƒ}|dk    r
|Vq
q
WdS(N(R±R1(R†trefRË((s#.\\ServerPython\webbottle\bottle.pyRÉî    s     cCsg|jD]}|ƒdk    r
|^q
|j(tƒ}|j|_||_|jjtj|ƒƒx"|D]}|j|||ƒqmW|S(sô (Unstable) Create a new overlay that acts like a chained map: Values
            missing in the overlay are copied from the source map. Both maps
            share the same meta entries.
 
            Entries that were copied from the source are called 'virtual'. You
            can not delete virtual keys, but overwrite them, which turns them
            into non-virtual entries. Setting keys on an overlay never affects
            its source, but may affect any number of child overlays.
 
            Other than collections.ChainMap or most other implementations, this
            approach does not resolve missing keys on demand, but instead
            actively copies all values from the source to the overlay and keeps
            track of virtual and non-virtual keys internally. This removes any
            lookup-overhead. Read-access is as fast as a build-in dict for both
            virtual and non-virtual keys.
 
            Changes are propagated recursively and depth-first. A failing
            on-change handler in an overlay stops the propagation of virtual
            values and may result in an partly updated tree. Take extra care
            here and make sure that on-change handlers never fail.
 
            Used by Route.config
        N(    R±R1R0R¯R³R tweakrefRÐRÊ(R†RÐRËR„((s#.\\ServerPython\webbottle\bottle.pyRô    s/          (s_metas_change_listeners    _overlayss _virtual_keyss_sources __weakref__N(R‰R“R”R3R‡RËRšRÂRR9RÎR-R)RÊRÌRÈR6R1RÇR1RÎRÏR€RÉR(((s#.\\ServerPython\webbottle\bottle.pyR0    s(    
    +                                                    tAppStackcBs8eZdZd„Zdd„ZeZed„ƒZRS(s> A stack-like list. Calling it returns the head of the stack. cCs|jS(s) Return the current default application. (R    (R†((s#.\\ServerPython\webbottle\bottle.pyRZ
scCs,t|tƒstƒ}n|j|ƒ|S(s1 Add a new :class:`Bottle` instance to the stack (RdR-R (R†R((s#.\\ServerPython\webbottle\bottle.pyR«!
s  cCs+y |dSWntk
r&|jƒSXdS(Niÿÿÿÿ(t
IndexErrorR«(R†((s#.\\ServerPython\webbottle\bottle.pyR    )
s  N(    R‰R“R”RZR1R«tnew_appR4R    (((s#.\\ServerPython\webbottle\bottle.pyRÒ
s
     R›cBseZdd„Zd„ZRS(ii@cCsS|||_|_x9dD]1}t||ƒrt||t||ƒƒqqWdS(NtfilenoRnR–t    readlinesttellRí(sfilenosclosesreads    readlinesstellsseek(R÷t buffer_sizeR[R™R‹(R†R÷RØRƒ((s#.\\ServerPython\webbottle\bottle.pyR‡2
s ccs?|j|j}}x%tr:||ƒ}|s2dS|VqWdS(N(RØR–RË(R†RèR–Rß((s#.\\ServerPython\webbottle\bottle.pyR—7
s      i(R‰R“R‡R—(((s#.\\ServerPython\webbottle\bottle.pyR›1
s RŸcBs,eZdZdd„Zd„Zd„ZRS(sŠ This only exists to be able to attach a .close method to iterators that
        do not support attribute assignment (most of itertools). cCs||_t|ƒ|_dS(N(titeratorRAtclose_callbacks(R†RÙRn((s#.\\ServerPython\webbottle\bottle.pyR‡C
s    cCs t|jƒS(N(RœRÙ(R†((s#.\\ServerPython\webbottle\bottle.pyR—G
scCsx|jD] }|ƒq
WdS(N(RÚ(R†R8((s#.\\ServerPython\webbottle\bottle.pyRnJ
sN(R‰R“R”R1R‡R—Rn(((s#.\\ServerPython\webbottle\bottle.pyRŸ?
s     R;cBsPeZdZdedd„Zd    d    ed„Zd„Zd„Z    dd„ZRS(
sf This class manages a list of search paths and helps to find and open
        application-bound resources (files).
 
        :param base: default value for :meth:`add_path` calls.
        :param opener: callable used to open resources.
        :param cachemode: controls which lookups are cached. One of 'all',
                         'found' or 'none'.
    s./tallcCs1||_||_||_g|_i|_dS(N(topenertbaset    cachemodeR®tcache(R†RÝRÜRÞ((s#.\\ServerPython\webbottle\bottle.pyR‡Y
s
                cCsûtjjtjj|p|jƒƒ}tjjtjj|tjj|ƒƒƒ}|tj7}||jkrƒ|jj|ƒn|r¬tjj|ƒ r¬tj    |ƒn|dkrË|jj |ƒn|jj ||ƒ|j jƒtjj|ƒS(s Add a new path to the list of search paths. Return False if the
            path does not exist.
 
            :param path: The new search path. Relative paths are turned into
                an absolute and normalized form. If the path looks like a file
                (not ending in `/`), the filename is stripped off.
            :param base: Path used to absolutize relative search paths.
                Defaults to :attr:`base` which defaults to ``os.getcwd()``.
            :param index: Position within the list of search paths. Defaults
                to last index (appends to the list).
 
            The `base` parameter makes it easy to reference files installed
            along with a python module or package::
 
                res.add_path('./resources/', __file__)
        N(tosR®tabspathtdirnameRÝRétsepRKtisdirtmakedirsR1R RIRßtcleartexists(R†R®RÝR¡tcreate((s#.\\ServerPython\webbottle\bottle.pytadd_pathc
s'-   ccs•|j}x„|r|jƒ}tjj|ƒs7q nxStj|ƒD]B}tjj||ƒ}tjj|ƒr„|j|ƒqG|VqGWq WdS(s: Iterate over all existing files in all registered paths. N(R®RñRàRätlistdirRéR (R†tsearchR®R=tfull((s#.\\ServerPython\webbottle\bottle.pyR—‚
s
     cCs ||jkstr•x[|jD]P}tjj||ƒ}tjj|ƒr|jdkrk||j|<n|SqW|jdkr•d|j|<q•n|j|S(sú Search for a resource and return an absolute file path, or `None`.
 
            The :attr:`path` list is searched in order. The first match is
            returend. Symlinks are followed. The result is cached to speed up
            future lookups. RÛtfound(sallsfoundN(RßRtR®RàRétisfileRÞR1(R†R=R®tfpath((s#.\\ServerPython\webbottle\bottle.pytlookup
strcOsA|j|ƒ}|s(td|ƒ‚n|j|d|||ŽS(s= Find a resource and return a file object, or raise IOError. sResource %r not found.RÛ(RðtIOErrorRÜ(R†R=RÛRRDtfname((s#.\\ServerPython\webbottle\bottle.pytopenž
sN(
R‰R“R”RôR‡R1R•RéR—Rð(((s#.\\ServerPython\webbottle\bottle.pyR;O
s 
         RÎcBsneZd d„ZedƒZeddeddƒZd d„Ze    d„ƒZ
d d
„Z e dd „Z RS(cCs=||_||_||_|r-t|ƒntƒ|_dS(s Wrapper for file uploads. N(RýR=t raw_filenameRPR¨(R†tfileobjR=RüR¨((s#.\\ServerPython\webbottle\bottle.pyR‡¦
s            s Content-TypesContent-LengthR?R    iÿÿÿÿcCs|jj||ƒS(s9 Return the value of a header within the mulripart part. (R¨Rï(R†R=R    ((s#.\\ServerPython\webbottle\bottle.pyRµ´
scCsÂ|j}t|tƒs-|jddƒ}ntd|ƒ}|jddƒjdƒ}tjj|j    dtjj
ƒƒ}t j dd|ƒj ƒ}t j dd    |ƒj d
ƒ}|d  pÁd S( sÑ Name of the file on the client file system, but normalized to ensure
            file system compatibility. An empty filename is returned as 'empty'.
 
            Only ASCII letters, digits, dashes, underscores and dots are
            allowed in the final filename. Accents are removed, if possible.
            Whitespace is replaced by a single dash. Leading or tailing dots
            or dashes are removed. The filename is limited to 255 characters.
        RbR‹tNFKDtASCIIs\s[^a-zA-Z0-9-_.\s]Rcs[-\s]+R9s.-iÿR6(RõRdReRkR,RfRàR®tbasenameR;RãR¤R¥Rs(R†Ró((s#.\\ServerPython\webbottle\bottle.pyRü¸
s
    $iicCs`|jj|j|jjƒ}}}x#||ƒ}|s?Pn||ƒq)|jj|ƒdS(N(RýR–RGR×Rí(R†R÷t
chunk_sizeR–RGR¾tbuf((s#.\\ServerPython\webbottle\bottle.pyt
_copy_fileÌ
s&  cCs£t|tƒrtjj|ƒr<tjj||jƒ}n| rdtjj|ƒrdtdƒ‚nt    |dƒ}|j
||ƒWdQXn|j
||ƒdS(sÌ Save file to disk or copy its content to an open file(-like) object.
            If *destination* is a directory, :attr:`filename` is added to the
            path. Existing files are not overwritten by default (IOError).
 
            :param destination: File path, directory or file(-like) object.
            :param overwrite: If True, replace existing files. (default: False)
            :param chunk_size: Bytes to read at a time. (default: 64kb)
        s File exists.twbN( RdRyRàR®RäRéRüRçRòRôRü(R†t destinationt    overwriteRúR÷((s#.\\ServerPython\webbottle\bottle.pytsaveÔ
s    Nii(R‰R“R1R‡R>RùR¬RÛRµR–RüRüR•R(((s#.\\ServerPython\webbottle\bottle.pyRÎ¥
s   iôsUnknown Error.cCst||ƒ‚dS(s+ Aborts execution and causes a HTTP error. N(RÆ(R„R|((s#.\\ServerPython\webbottle\bottle.pytabortì
scCst|s*tjdƒdkr!dnd}ntjdtƒ}||_d|_|jdttj    |ƒƒ|‚dS(    sd Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version. tSERVER_PROTOCOLsHTTP/1.1i/i.RRctLocationN(
RWRïRR'RYRPRRRSRKRø(RøR„R‰((s#.\\ServerPython\webbottle\bottle.pytredirectñ
s$        iccsn|j|ƒxG|dkrV|jt||ƒƒ}|s>Pn|t|ƒ8}|VqW|rj|jƒndS(sq Yield chunks from a range in a file, optionally closing it at the end.
        No chunk is bigger than maxread. iN(RíR–RÜR¡Rn(R÷R¾RgRÞRnRß((s#.\\ServerPython\webbottle\bottle.pyt_file_iter_rangeý
s     sUTF-8c Csþtjjtjj|ƒdƒ}tjjtjj||jdƒƒƒ}tƒ}|j|ƒsptddƒStjj|ƒ s–tjj    |ƒ r£tddƒStj
|tj ƒsÅtddƒS|t kr&|rû|t k    rût j|ƒ\}}nt j|ƒ\}}|r&||d<q&n|rx|d     d
ksH|d krk|rkd |krk|d |7}n||d<n|r³tjj|t kr™|n|ƒ}d||d<ntj|ƒ}|j|d<}    tjj|jdt ƒ|d<tjjtjƒdt ƒ|d<tjj}
|d)krld|j|j|j|    |f}tjt|ƒƒj ƒ}n|r­||d<|
dƒ} | r­| |kr­t!dd|Sn|
dƒ} | rát"| j#dƒdjƒƒ} n| d)k    r| t$|jƒkrt!dd|Stj%dkr'dn t&|dƒ} d|d <|
d!ƒ}|rñt't(||    ƒƒ}|sztd"d#ƒS|d\}}d$||d%|    f|d&<t)||ƒ|d<| rÞt*| |||d't ƒ} nt!| dd(|St!| |S(*sŽ Open a file in a safe way and return an instance of :exc:`HTTPResponse`
        that can be sent back to the client.
 
        :param filename: Name or path of the file to send, relative to ``root``.
        :param root: Root path for file lookups. Should be an absolute directory
            path.
        :param mimetype: Provide the content-type header (default: guess from
            file extension)
        :param download: If True, ask the browser to open a `Save as...` dialog
            instead of opening the file with the associated program. You can
            specify a custom filename as a string. If not specified, the
            original filename is used (default: False).
        :param charset: The charset for files with a ``text/*`` mime-type.
            (default: UTF-8)
        :param etag: Provide a pre-computed ETag header. If set to ``False``,
            ETag handling is disabled. (default: auto-generate ETag header)
 
        While checking user input is always a good idea, this function provides
        additional protection against malicious ``filename`` parameters from
        breaking out of the ``root`` directory and leaking sensitive information
        to an attacker.
 
        Read-protected files or files outside of the ``root`` directory are
        answered with ``403 Access Denied``. Missing files result in a
        ``404 Not Found`` response. Conditional requests (``If-Modified-Since``,
        ``If-None-Match``) are answered with ``304 Not Modified`` whenever
        possible. ``HEAD`` and ``Range`` requests (used by download managers to
        check or continue partial downloads) are also handled automatically.
 
    Rcs/\i“sAccess denied.i”sFile does not exist.s/You do not have permission to access this file.sContent-Encodingistext/sapplication/javascriptR˜s ; charset=%ss Content-Typesattachment; filename="%s"sContent-DispositionsContent-Lengthtusegmts Last-ModifiedtDates%d:%d:%d:%d:%stETagtHTTP_IF_NONE_MATCHRPi0tHTTP_IF_MODIFIED_SINCERÓiRýtrbRgs Accept-Rangest
HTTP_RANGEi sRequested Range Not Satisfiablesbytes %d-%d/%dis Content-RangeRniÎN(+RàR®RéRáRsR€RRÆRçRîtaccesstR_OKRËt    mimetypest
guess_typeRùtstattst_sizetemailtutilst
formatdatetst_mtimeRkRWRRïR1tst_devtst_inoR5tsha1Rit    hexdigestRYR]R`R¬RÕRôR~tparse_range_headerR«R(RütroottmimetypetdownloadR˜tetagR¨RPtstatsRôtgetenvtchecktimsRRt range_headertrangesR¾R¼((s#.\\ServerPython\webbottle\bottle.pyt static_file sr$!*     &    $ "   
  "!$
  cCs&|rtjdƒnt|ƒadS(sS Change the debug level.
    There is only one debug level supported at the moment.R    N(Rvt simplefilterR2Rt(RÛ((s#.\\ServerPython\webbottle\bottle.pytdebugx scCsst|ttfƒr$|jƒ}n't|ttfƒrKtj|ƒ}nt|tƒsotj    d|ƒ}n|S(Ns%a, %d %b %Y %H:%M:%S GMT(
RdRiR't utctimetupleR¬R­RkRlRyRm(R((s#.\\ServerPython\webbottle\bottle.pyR^€ scCsey@tjj|ƒ}tj|d dƒ|dp6dtjSWntttt    fk
r`dSXdS(sD Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. iii    N(i( RRt parsedate_tzRktmktimettimezoneRmRÅRÓt OverflowErrorR1(R#tts((s#.\\ServerPython\webbottle\bottle.pyR]Š s
.cCs„ye|jddƒ\}}|jƒdkrdttjt|ƒƒƒjddƒ\}}||fSWnttfk
rdSXdS(s] Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or NoneiRR    N(    R`R1RÔRXRÁRÄRiRòRÅ(RæRÕRtusertpwd((s#.\\ServerPython\webbottle\bottle.pyR“ s-iccs,| s|d dkrdSg|djdƒD]$}d|kr/|jddƒ^q/}xÌ|D]Ä\}}y¤|s˜td|t|ƒƒ|}}nB|s´t|ƒ|}}n&t|ƒtt|ƒd|ƒ}}d|koü|koü|knr||fVnWq`tk
r#q`Xq`WdS(s~ Yield (start, end) ranges parsed from a HTTP Range header. Skip
        unsatisfiable ranges. The end index is non-inclusive.isbytes=NRR9ii(R`RÚR¬RÜRÅ(RætmaxlenRñR%RºR¼((s#.\\ServerPython\webbottle\bottle.pyRž s>#&' s.(?:(?:"((?:[^"\\]+|\\.)*)")|([^;,=]+))([;,=]?)c Csƒg}d|kr¦xj|jdƒD]}}|jdƒ}|j|djƒifƒxH|dD]<}|jddƒ\}}|jƒ|dd|jƒ<q_Wq"WnÙdd
i}}}xÂt|ƒD]´\}    }
} |
rè|
jƒn|    jddƒ}|dkr"i}|j||fƒnS|dkrP| dkrC|}qud    ||<n%|dkru|ru|||<d
}n| }qÇW|S( s‡ Parses a typical multi-valued and parametrised HTTP header (e.g. Accept headers) and returns a list of values
        and parameters. For non-standard or broken input, this implementation may return partial results.
    :param h: A header string (e.g. ``text/html,text/plain;q=0.9,*/*;q=0.8``)
    :return: List of (value, params) tuples. The second element is a (possibly empty) dict.
    t"RRÓiit=iÿÿÿÿs\"RcN(R`R RsR1t_hsplitR;( RXR¸RtpartsRƒR=tlopR„tattrstquotedtplainttok((s#.\\ServerPython\webbottle\bottle.pyt_parse_http_header´ s. )$        
    
cCs»g}x®|jddƒjdƒD]‘}|s4q"n|jddƒ}t|ƒdkrh|jdƒnt|djdd    ƒƒ}t|djdd    ƒƒ}|j||fƒq"W|S(
NRÓt&R3iiRcit+RL(R;R`R¡R t
urlunquote(tqsRñtpairtnvR„R((s#.\\ServerPython\webbottle\bottle.pyRËÕ s"cCs6td„t||ƒDƒƒ o5t|ƒt|ƒkS(ss Compares two strings in a cryptographically safe way:
        Runtime is not affected by length of common prefix. css-|]#\}}||kr!dndVqdS(iiN((RåRHty((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>ä s(tsumtzipR¡(R]RØ((s#.\\ServerPython\webbottle\bottle.pyRÀá s    cCs†tddddƒ|ptj}tjtj|dƒƒ}tjtjt    |ƒ|d|ƒj
ƒƒ}t    dƒ|t    dƒ|S(    s> Encode and sign a pickle-able object. Return a (byte) string ii s%cookie_encode() will be removed soon.sDo not use this API directly.iÿÿÿÿR¼R»R( R}R5R6RÁRÂRÃR-R½R¾RiR¿(RR„R¼RãRÆ((s#.\\ServerPython\webbottle\bottle.pyt cookie_encodeè s  -cCsµtddddƒt|ƒ}t|ƒr±|jtdƒdƒ\}}|pUtj}tjt|ƒ|d|ƒjƒ}t    |dt
j |ƒƒr±t j t
j|ƒƒSndS(    s? Verify and decode an encoded string. Return an object or None.ii s%cookie_decode() will be removed soon.sDo not use this API directly.RiR¼N(R}Ritcookie_is_encodedR`R5R6R½R¾R¿RÀRÁRÂRÃR.RÄR1(RR„R¼RÆRãthashed((s#.\\ServerPython\webbottle\bottle.pyt cookie_decodeò s   $cCs>tddddƒt|jtdƒƒo:tdƒ|kƒS(s9 Return True if the argument looks like a encoded cookie.ii s)cookie_is_encoded() will be removed soon.sDo not use this API directly.R»R(R}R2RRi(R((s#.\\ServerPython\webbottle\bottle.pyRF s cCs@|jddƒjddƒjddƒjddƒjd    d
ƒS( s; Escape HTML special characters ``&<>`` and quotes ``'"``. R<s&amp;t<s&lt;t>s&gt;R2s&quot;t's&#039;(R;(tstring((s#.\\ServerPython\webbottle\bottle.pyR§ s*cCs2dt|ƒjddƒjddƒjddƒS(s; Escape and quote a string to be used as an HTTP attribute.s"%s"s
s&#10;s s&#13;s    s&#9;(R§R;(RL((s#.\\ServerPython\webbottle\bottle.pyt
html_quote sccs§d|jjddƒjdƒ}t|ƒ}t|dƒt|dpKgƒ}|d|t|d| ƒ7}|Vx)|d|D]}|d|7}|Vq†WdS(s“ Return a generator for routes that match the signature (name, args)
    of the func parameter. This may yield more than one route if the function
    takes optional keyword arguments. The output is best described by example::
 
        a()         -> '/a'
        b(x, y)     -> '/b/<x>/<y>'
        c(x, y=5)   -> '/c/<x>' and '/c/<x>/<y>'
        d(x=5, y=6) -> '/d' and '/d/<x>' and '/d/<x>/<y>'
    RüRªiis/<%s>N(R‰R;RfR?R¡R7(R8R®RCtargctarg((s#.\\ServerPython\webbottle\bottle.pyR{ s
" $ ic    Cs…|dkr||fS|jdƒjdƒ}|jdƒjdƒ}|re|ddkreg}n|r„|ddkr„g}nd|ko¡t|ƒknrÇ|| }||}||}nld|koåt|ƒ knr ||}||}|| }n(|dkrdnd}td|ƒ‚ddj|ƒ}ddj|ƒ}|jdƒr{|r{|d7}n||fS(sS Shift path fragments from PATH_INFO to SCRIPT_NAME and vice versa.
 
        :return: The modified paths.
        :param script_name: The SCRIPT_NAME path.
        :param script_name: The PATH_INFO path.
        :param shift: The number of path fragments to shift. May be negative to
          change the shift direction. (default: 1)
    iRüRcRrRûs"Cannot shift. Nothing left from %s(RsR`R¡RIRéRb(    Rt    path_infoRtpathlistt
scriptlisttmovedR6tnew_script_namet new_path_info((s#.\\ServerPython\webbottle\bottle.pyRX' s.    
        "
 
 #
 
  tprivates Access deniedcs‡‡‡fd†}|S(se Callback decorator to require HTTP auth (basic).
        TODO: Add route(check_auth=...) parameter. cs+tjˆƒ‡‡‡‡fd†ƒ}|S(Ncsetjp d\}}|dks1ˆ||ƒ rXtdˆƒ}|jddˆƒ|Sˆ||ŽS(Ni‘sWWW-AuthenticatesBasic realm="%s"(NN(RWRR1RÆRQ(R]RrR/tpasswordRl(trealmR|R8R"(s#.\\ServerPython\webbottle\bottle.pyRpL s (Rmtwraps(R8Rp(RXR|R"(R8s#.\\ServerPython\webbottle\bottle.pyROJ s'    ((R"RXR|RO((R|RXR"s#.\\ServerPython\webbottle\bottle.pyt
auth_basicF s cs+tjttˆƒƒ‡fd†ƒ}|S(sA Return a callable that relays calls to the current default app. csttƒˆƒ||ŽS(N(R‹R (R]Rr(R=(s#.\\ServerPython\webbottle\bottle.pyRp` s(RmRYR‹R-(R=Rp((R=s#.\\ServerPython\webbottle\bottle.pytmake_default_app_wrapper] s'RaRïR}RRRƒRÑRiRNR@RpRxt ServerAdaptercBs/eZeZddd„Zd„Zd„ZRS(s    127.0.0.1icKs%||_||_t|ƒ|_dS(N(RcRR¬R(R†RRRc((s#.\\ServerPython\webbottle\bottle.pyR‡ s        cCsdS(N((R†thandler((s#.\\ServerPython\webbottle\bottle.pyRq„ scCsUdjg|jjƒD]"\}}d|t|ƒf^qƒ}d|jj|fS(Ns, s%s=%ss%s(%s)(RéRcR2RR.R‰(R†RFRGR((s#.\\ServerPython\webbottle\bottle.pyR,‡ s    8(R‰R“R•tquietR‡RqR,(((s#.\\ServerPython\webbottle\bottle.pyR\| s    t    CGIServercBseZeZd„ZRS(cs3ddlm}‡fd†}|ƒj|ƒdS(Niÿÿÿÿ(t
CGIHandlercs|jddƒˆ||ƒS(NRûRc(RÎ(RRV(R](s#.\\ServerPython\webbottle\bottle.pyt fixed_environ“ s(twsgiref.handlersR`Rq(R†R]R`Ra((R]s#.\\ServerPython\webbottle\bottle.pyRq s(R‰R“RËR^Rq(((s#.\\ServerPython\webbottle\bottle.pyR_ stFlupFCGIServercBseZd„ZRS(cCsNddl}|jjd|j|jfƒ|jjj||jjƒdS(Niÿÿÿÿt bindAddress(    tflup.server.fcgiRcRÎRRRtfcgit
WSGIServerRq(R†R]tflup((s#.\\ServerPython\webbottle\bottle.pyRq› s (R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyRcš st WSGIRefServercBseZd„ZRS(cs-ddlm}ddlm‰m}ddl‰dˆf‡‡fd†ƒY}ˆjjd|ƒ}ˆjjd|ƒ}dˆjkrÄt|d    ƒˆj    krÄd
|f‡fd †ƒY}qÄn|ˆjˆj
|||ƒˆ_ ˆj j ˆ_
yˆj j ƒWn!tk
r(ˆj jƒ‚nXdS( Niÿÿÿÿ(t make_server(tWSGIRequestHandlerRgt FixedHandlercs#eZd„Z‡‡fd†ZRS(cSs |jdS(Ni(tclient_address(R†((s#.\\ServerPython\webbottle\bottle.pytaddress_string¨ scsˆjsˆj||ŽSdS(N(R^t log_request(Rtkw(RkR†(s#.\\ServerPython\webbottle\bottle.pyRo« s    (R‰R“RnRo((RkR†(s#.\\ServerPython\webbottle\bottle.pyRl§ s    t handler_classt server_classR    taddress_familyt
server_clscseZˆjZRS((R‰R“tAF_INET6Rs((tsocket(s#.\\ServerPython\webbottle\bottle.pyRtµ s(twsgiref.simple_serverRjRkRgRvRcRïRR‹tAF_INETRtsrvt server_portt serve_foreverRŽt server_close(R†R RjRgRlt handler_clsRt((RvR†Rks#.\\ServerPython\webbottle\bottle.pyRq¢ s" "   (R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyRi¡ stCherryPyServercBseZd„ZRS(cCsétddddƒddlm}|j|jf|jd<||jd<|jjd    ƒ}|rn|jd    =n|jjd
ƒ}|r“|jd
=n|j|j}|r·||_n|rÉ||_    nz|j
ƒWd|j ƒXdS( Nii sOThe wsgi server part of cherrypy was split into a new project called 'cheroot'.s5Use the 'cheroot' server adapter instead of cherrypy.iÿÿÿÿ(t
wsgiservert    bind_addrtwsgi_apptcertfiletkeyfile( R}tcherrypyRRRRcRïtCherryPyWSGIServertssl_certificatetssl_private_keyRºtstop(R†R]RR‚RƒR((s#.\\ServerPython\webbottle\bottle.pyRqà s&      (R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyR~ st CherootServercBseZd„ZRS(cCsÞddlm}ddlm}|j|jf|jd<||jd<|jjddƒ}|jjddƒ}|jjddƒ}|j    |j}|r¾|r¾|j
|||ƒ|_ nz|j ƒWd|j ƒXdS(    Niÿÿÿÿ(R©(tbuiltinR€RR‚Rƒt    chainfile(tcherootR©t cheroot.sslRŠRRRcRñR1tServertBuiltinSSLAdaptert ssl_adapterRºRˆ(R†R]R©RŠR‚RƒR‹R((s#.\\ServerPython\webbottle\bottle.pyRqà s  (R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyR‰ß stWaitressServercBseZd„ZRS(c    Cs?ddlm}||d|jd|jd|j|jdS(Niÿÿÿÿ(tserveRRt_quiet(twaitressR’RRR^Rc(R†R]R’((s#.\\ServerPython\webbottle\bottle.pyRqó s(R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyR‘ò st PasteServercBseZd„ZRS(cCseddlm}ddlm}||d|j ƒ}|j|d|jdt|jƒ|j    dS(Niÿÿÿÿ(t
httpserver(t TransLoggertsetup_console_handlerRR(
tpasteR–tpaste.transloggerR—R^R’RR«RRc(R†R]R–R—((s#.\\ServerPython\webbottle\bottle.pyRqù s      (R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyR•ø stMeinheldServercBseZd„ZRS(cCs:ddlm}|j|j|jfƒ|j|ƒdS(Niÿÿÿÿ(R(tmeinheldRtlistenRRRq(R†R]R((s#.\\ServerPython\webbottle\bottle.pyRq s(R‰R“Rq(((s#.\\ServerPython\webbottle\bottle.pyR› st FapwsServercBseZdZd„ZRS(sA Extremely fast webserver using libev. See http://www.fapws.org/ csÖddlj}ddlm}m}|j}t|jdƒdkrVt|ƒ}n|j    |j
|ƒdt j kr™|j r™tdƒtdƒn|j|ƒ‡fd†}|jd    |fƒ|jƒdS(
Niÿÿÿÿ(RÝRiþÿÿÿgš™™™™™Ù?t BOTTLE_CHILDs3WARNING: Auto-reloading does not work with Fapws3.
s/         (Fapws3 breaks python thread support)
cst|d<ˆ||ƒS(Nswsgi.multiprocess(R•(RRV(R](s#.\\ServerPython\webbottle\bottle.pyR  s
Rc(t fapws._evwsgit_evwsgitfapwsRÝRRR­t SERVER_IDENTR«RºRRàRR^t_stderrtset_base_moduletwsgi_cbRq(R†R]tevwsgiRÝRRR ((R]s#.\\ServerPython\webbottle\bottle.pyRq s    
  (R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRž     st TornadoServercBseZdZd„ZRS(s< The super hyped asynchronous server by facebook. Untested. cCs~ddl}ddl}ddl}|jj|ƒ}|jj|ƒ}|jd|jd|j    ƒ|j
j j ƒj ƒdS(NiÿÿÿÿRtaddress(t tornado.wsgittornado.httpserverttornado.ioloopR©t WSGIContainerR–t
HTTPServerRRRtiolooptIOLooptinstanceRº(R†R]ttornadot    containerR((s#.\\ServerPython\webbottle\bottle.pyRq% s
$(R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyR¨" stAppEngineServercBseZdZeZd„ZRS(s  Adapter for Google App Engine. csttddddƒddlm‰tjjdƒ}|rct|dƒ rc‡‡fd    †|_nˆjˆƒdS(
Nii s"AppEngineServer no longer requireds4Configure your application directly in your app.yamliÿÿÿÿ(tutilR$tmaincs ˆjˆƒS(N(t run_wsgi_app((RµR](s#.\\ServerPython\webbottle\bottle.pyRI9 s(    R}tgoogle.appengine.ext.webappRµRERRïR[R¶R·(R†R]R((RµR]s#.\\ServerPython\webbottle\bottle.pyRq1 s (R‰R“R”RËR^Rq(((s#.\\ServerPython\webbottle\bottle.pyR´- st TwistedServercBseZdZd„ZRS(s  Untested. cCs³ddlm}m}ddlm}ddlm}|ƒ}|jƒ|jdd|j    ƒ|j
|j |||ƒƒ}|j |j |d|jƒ|js¯|jƒndS(Niÿÿÿÿ(RR©(t
ThreadPool(treactortaftertshutdownt    interface(t twisted.webRR©ttwisted.python.threadpoolRºttwisted.internetR»RºtaddSystemEventTriggerRˆtSitet WSGIResourcet    listenTCPRRtrunningRq(R†R]RR©RºR»t thread_pooltfactory((s#.\\ServerPython\webbottle\bottle.pyRq@ s    
    (R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyR¹= st DieselServercBseZdZd„ZRS(s  Untested. cCs3ddlm}||d|jƒ}|jƒdS(Niÿÿÿÿ(tWSGIApplicationR(tdiesel.protocols.wsgiRÊRRq(R†R]RÊR ((s#.\\ServerPython\webbottle\bottle.pyRqP s(R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRÉM st GeventServercBseZdZd„ZRS(s` Untested. Options:
 
        * See gevent.wsgi.WSGIServer() documentation for more options.
    csÎddlm}m}ttjƒ|jƒsCd}t|ƒ‚n|jr\d|jd<n|j    |j
f}|j |||j‰dt j krÀddl}|j|j‡fd†ƒnˆjƒdS(Niÿÿÿÿ(tpywsgiRws9Bottle requires gevent.monkey.patch_all() (before import)tlogRŸcs
ˆjƒS(N(Rˆ(RYR÷(R(s#.\\ServerPython\webbottle\bottle.pyRIg s(RRÍRwRdRvR³R^R1RcRRRgRàRtsignaltSIGINTR{(R†R]RÍRwRãR©RÏ((Rs#.\\ServerPython\webbottle\bottle.pyRq\ s     (R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRÌV stGunicornServercBseZdZd„ZRS(s? Untested. See http://gunicorn.org/configure.html for options. cssddlm}id|jt|jƒfd6‰ˆj|jƒd|f‡‡fd†ƒY}|ƒjƒdS(Niÿÿÿÿ(t Applications%s:%dRŒtGunicornApplicationcs&eZ‡fd†Z‡fd†ZRS(csˆS(N((R†RR"R(R(s#.\\ServerPython\webbottle\bottle.pytinitu scsˆS(N((R†(R](s#.\\ServerPython\webbottle\bottle.pyRzx s(R‰R“RÔRz((R]R(s#.\\ServerPython\webbottle\bottle.pyRÓt s(tgunicorn.app.baseRÒRR¬RR9RcRq(R†R]RÒRÓ((R]Rs#.\\ServerPython\webbottle\bottle.pyRqn s
#(R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRÑk stEventletServercBseZdZd„ZRS(sN Untested. Options:
 
        * `backlog` adjust the eventlet backlog parameter which is the maximum
          number of queued connections. Should be at least 1; the maximum
          value is system-dependent.
        * `family`: (default is 2) socket family, optional. See socket
          documentation for available families.
    c    Csìddlm}m}m}|jtƒs@d}t|ƒ‚ni}x<dD]4}y|jj|ƒ||<WqMt    k
r€qMXqMW|j
|j f}y'|j ||||d|j ƒWn'tk
rç|j ||ƒ|ƒnXdS(Niÿÿÿÿ(R©Rtpatchers7Bottle requires eventlet.monkey_patch() (before import)tbacklogtfamilyt
log_output(RØRÙ(RR©RR×tis_monkey_patchedRàR³RcRñRòRRRR^Rm(    R†R]R©RR×Rãt socket_argsROR©((s#.\\ServerPython\webbottle\bottle.pyRqˆ s    (R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRÖ~ st RocketServercBseZdZd„ZRS(s  Untested. cCsCddlm}||j|jfdi|d6ƒ}|jƒdS(Niÿÿÿÿ(tRocketR©R(trocketRÞRRRº(R†R]RÞR((s#.\\ServerPython\webbottle\bottle.pyRqŸ s%(R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRÝœ st BjoernServercBseZdZd„ZRS(s? Fast server written in C: https://github.com/jonashaag/bjoern cCs*ddlm}|||j|jƒdS(Niÿÿÿÿ(Rq(tbjoernRqRR(R†R]Rq((s#.\\ServerPython\webbottle\bottle.pyRq¨ s(R‰R“R”Rq(((s#.\\ServerPython\webbottle\bottle.pyRॠstAsyncioServerAdaptercBseZdZd„ZRS(s3 Extend ServerAdapter for adding custom event loop cCsdS(N((R†((s#.\\ServerPython\webbottle\bottle.pytget_event_loop® s(R‰R“R”Rã(((s#.\\ServerPython\webbottle\bottle.pyR⬠st AiohttpServercBs eZdZd„Zd„ZRS(sM Untested.
        aiohttp
        https://pypi.python.org/pypi/aiohttp/
    cCsddl}|jƒS(Niÿÿÿÿ(tasynciotnew_event_loop(R†Rå((s#.\\ServerPython\webbottle\bottle.pyRã· s csèddl}ddlm‰ˆjƒˆ_|jˆjƒ‡‡‡fd†}ˆjjˆjj|ˆjˆj    ƒƒdt
j kr²ddl }|j |j ‡fd†ƒnyˆjjƒWntk
rãˆjjƒnXdS(Niÿÿÿÿ(tWSGIServerHttpProtocolcsˆˆdtdˆj ƒS(Nt readpayloadR((RËR^((RçR†R](s#.\\ServerPython\webbottle\bottle.pyRIÁ sRŸcs ˆjjƒS(N(tloopRˆ(RYR÷(R†(s#.\\ServerPython\webbottle\bottle.pyRIË s(Råt aiohttp.wsgiRçRãRétset_event_looptrun_until_completet create_serverRRRàRRÏRÐt run_foreverRŽRˆ(R†R]Råtprotocol_factoryRÏ((R†RçR]s#.\\ServerPython\webbottle\bottle.pyRq» s    (R‰R“R”RãRq(((s#.\\ServerPython\webbottle\bottle.pyRä± s    tAiohttpUVLoopServercBseZdZd„ZRS(s7uvloop
       https://github.com/MagicStack/uvloop
    cCsddl}|jƒS(Niÿÿÿÿ(tuvloopRæ(R†Rñ((s#.\\ServerPython\webbottle\bottle.pyRãÖ s (R‰R“R”Rã(((s#.\\ServerPython\webbottle\bottle.pyRðÒ st
AutoServercBs/eZdZeeeeeegZ    d„Z
RS(s  Untested. cCsRxK|jD]@}y&||j|j|jj|ƒSWq
tk
rIq
Xq
WdS(N(tadaptersRRRcRqt ImportError(R†R]tsa((s#.\\ServerPython\webbottle\bottle.pyRqß s
& ( R‰R“R”R‘R•R¹R~R‰RiRóRq(((s#.\\ServerPython\webbottle\bottle.pyRòÚ s  RúRhR
R”R„RŒR™tfapws3R²tgaettwistedtdieselRœtgunicornRRRßRátaiohttpRñtautocKs¸d|kr|jddƒn    |df\}}|tjkrLt|ƒn|s]tj|S|jƒr}ttj||ƒS|jdƒd}tj|||<td||f|ƒS(sÿ Import a module or fetch an object from a module.
 
        * ``package.module`` returns `module` as a module object.
        * ``pack.mod:name`` returns the module variable `name` from `pack.mod`.
        * ``pack.mod:func()`` calls `pack.mod.func()` and returns the result.
 
        The last form accepts not only function calls, but any type of
        expression. Keyword arguments passed to this function are available as
        local variables. Example: ``import_string('re:compile(x)', x='[a-z]')``
    R    iR’is%s.%sN(R`R1RERR—tisalnumR‹teval(RÖRÃRt package_name((s#.\\ServerPython\webbottle\bottle.pyRzs 0   cCsXtta}tjƒ}z$t|ƒ}t|ƒr8|S|SWdtj|ƒ|aXdS(sÞ Load a bottle application from a module and make sure that the import
        does not affect the current default application, but returns a separate
        application object. See :func:`load` for the target parameter. N(RËtNORUNRªR«RzRlRK(RÖtnr_oldRòR((s#.\\ServerPython\webbottle\bottle.pytload_apps    s    127.0.0.1ic
 
Kstr
dS|rŠtjjdƒ rŠddl} d} z+ytjddddƒ\} } tj| ƒxátj    j
| ƒrIt j gt j }tjjƒ}d|d<| |d    <| j|d
|ƒ}x3|jƒdkrûtj| dƒtj|ƒqÉW|jƒd kritj    j
| ƒr0tj| ƒnt j|jƒƒqiqiWWntk
r^nXWdtj    j
| ƒr…tj| ƒnXdSy|dk    r¦t|ƒn|p²tƒ}t|tƒrÓt|ƒ}nt|ƒsòtd |ƒ‚nx?|pþgD]1}t|tƒr#t|ƒ}n|j|ƒqÿW|    rM|j j!|    ƒn|t"krkt"j|ƒ}nt|tƒr‰t|ƒ}nt|t#ƒr³|d |d||
}nt|t$ƒsÕtd|ƒ‚n|j%pá||_%|j%s1t&dt't(|ƒfƒt&d|j)|j*fƒt&dƒn|r”tjjd    ƒ} t+| |ƒ}||j,|ƒWdQX|j-dkr¡t jd ƒq¡n |j,|ƒWnrtk
rµnbt.t/fk
r΂nI|sÝ‚nt0|d|ƒsùt1ƒntj|ƒt jd ƒnXdS(s¼ Start a server instance. This method blocks until the server terminates.
 
        :param app: WSGI application or target string supported by
               :func:`load_app`. (default: :func:`default_app`)
        :param server: Server adapter to use. See :data:`server_names` keys
               for valid names or pass a :class:`ServerAdapter` subclass.
               (default: `wsgiref`)
        :param host: Server address to bind to. Pass ``0.0.0.0`` to listens on
               all interfaces including the external one. (default: 127.0.0.1)
        :param port: Server port to bind to. Values below 1024 require root
               privileges. (default: 8080)
        :param reloader: Start auto-reloading server? (default: False)
        :param interval: Auto-reloader interval in seconds (default: 1)
        :param quiet: Suppress output to stdout and stderr? (default: False)
        :param options: Options passed to the server adapter.
     NRŸiÿÿÿÿR¿sbottle.tsuffixs.lockttruetBOTTLE_LOCKFILER isApplication is not callable: %rRRs!Unknown or unsupported server: %rs,Bottle v%s server starting up (using %s)...
sListening on http://%s:%d/
sHit Ctrl-C to quit.
 
treloadR^(2RRàRRït
subprocessR1ttempfiletmkstempRnR®RçREt
executabletargvR'tPopentpolltutimeRktsleeptunlinktexitRŽt_debugRªRdRyRRlRÅRzR@RR9t server_namesRR\R^R¤t __version__RRRtFileCheckerThreadRqRPRRR‹R+(R RRRtintervaltreloaderR^RR(RRuRtlockfiletfdRRR¦Rtbgcheck((s#.\\ServerPython\webbottle\bottle.pyRq*s–  
 
          
 RcBs2eZdZd„Zd„Zd„Zd„ZRS(sx Interrupt main-thread as soon as a changed module file is detected,
        the lockfile gets deleted or gets too old. cCs9tjj|ƒt|_|||_|_d|_dS(N(    RvtThreadR‡RËtdaemonRRR1RP(R†RR((s#.\\ServerPython\webbottle\bottle.pyR‡˜s    cCs[tjj}d„}tƒ}xqttjjƒƒD]Z}t|ddƒ}|dd kri|d }n|r4||ƒr4||ƒ||<q4q4WxÂ|j    sV||j
ƒ sÔ||j
ƒt j ƒ|j dkrêd    |_    t jƒnxVt|jƒƒD]B\}}||ƒ s(||ƒ|krýd
|_    t jƒPqýqýWt j|j ƒq•WdS( NcSstj|ƒjS(N(RàRR(R¦((s#.\\ServerPython\webbottle\bottle.pyRI¡sRˆRciüÿÿÿs.pyos.pyciÿÿÿÿiRÑR(s.pyos.pyc(RàR®RçR€R~RERR¸R‹RPRRkRtthreadtinterrupt_mainR2R(R†RçtmtimeRÑRR®tlmtime((s#.\\ServerPython\webbottle\bottle.pyRqŸs(           &         
cCs|jƒdS(N(Rº(R†((s#.\\ServerPython\webbottle\bottle.pyR¬µscGs8|jsd|_n|jƒ|dk    o7t|tƒS(NR(RPRéR1RHRŽ(R†R­R!((s#.\\ServerPython\webbottle\bottle.pyR°¸s     
(R‰R“R”R‡RqR¬R°(((s#.\\ServerPython\webbottle\bottle.pyR”s
            t TemplateErrorcBseZRS((R‰R“(((s#.\\ServerPython\webbottle\bottle.pyR!Âst BaseTemplatecBsteZdZddddgZiZiZd d d dd„Zed d„ƒZ    ed„ƒZ
d    „Z d
„Z RS( s2 Base class and minimal API for template adapters R…thtmltthtmltstplRbcKs7||_t|dƒr$|jƒn||_t|dƒrE|jnd|_|ryg|D]}tjj|ƒ^q[ng|_    ||_
|j j ƒ|_ |j j |ƒ|j r|jr|j|j|j    ƒ|_|jstdt|ƒƒ‚qn|j r#|j r#tdƒ‚n|j|j dS(s= Create a new template.
        If the source parameter (str or buffer) is missing, the name argument
        is used to guess a template filename. Subclasses can assume that
        self.source and/or self.filename are set. Both are strings.
        The lookup, encoding and settings parameters are stored as instance
        variables.
        The lookup parameter stores a list containing directory paths.
        The encoding parameter should be used to decode byte strings or files.
        The settings parameter contains a dict for engine-specific settings.
        R–RüsTemplate %s not found.sNo template specified.N(R=R[R–RÄRüR1RàR®RáRðRPtsettingsR'R9RëR!RR(R†RÄR=RðRPR&RH((s#.\\ServerPython\webbottle\bottle.pyR‡Ìs    $!4        cCs|stddddƒ‚ntjj|ƒrHtddddƒ‚nx±|D]©}tjj|ƒtj}tjjtjj||ƒƒ}|j|ƒs¤qOntjj|ƒrº|Sx;|j    D]0}tjjd||fƒrÄd||fSqÄWqOWdS(    s{ Search name in all directories specified in lookup.
        First without, then with common extensions. Return first hit. ii sEmpty template lookup path.s!Configure a template lookup path.s'Use of absolute path for template name.sCRefer to templates with names or paths relative to the lookup path.s%s.%sN(
R}RàR®tisabsRáRãRéRRît
extensions(RR=RðtspathRótext((s#.\\ServerPython\webbottle\bottle.pyRëês   !cGs;|r,|jjƒ|_|d|j|<n |j|SdS(sB This reads or sets the global settings stored in class.settings. iN(R&R'(RR„R((s#.\\ServerPython\webbottle\bottle.pyt global_configþscKs
t‚dS(s™ Run preparations (parsing, caching, ...).
        It should be possible to call this again to refresh a template or to
        update settings.
        N(tNotImplementedError(R†Rc((s#.\\ServerPython\webbottle\bottle.pyRscOs
t‚dS(sF Render the template with the specified local variables and return
        a single byte or unicode string. If it is a byte string, the encoding
        must match self.encoding. This method must be thread-safe!
        Local variables may be provided in dictionaries (args)
        or directly, as keywords (kwargs).
        N(R,(R†RRD((s#.\\ServerPython\webbottle\bottle.pytrendersN( R‰R“R”R(R&R<R1R‡t classmethodRëR+RR-(((s#.\\ServerPython\webbottle\bottle.pyR"Æs         t MakoTemplatecBseZd„Zd„ZRS(cKs´ddlm}ddlm}|ji|jd6ƒ|jdttƒƒ|d|j    |}|j
r‰||j
d|||_ n'|d|j d    |j d|||_ dS(
Niÿÿÿÿ(tTemplate(tTemplateLookupR¦tformat_exceptionst directoriesRðturiRü(t mako.templateR0t mako.lookupR1R9RPRÎR2RtRðRÄR…R=Rü(R†RcR0R1Rð((s#.\\ServerPython\webbottle\bottle.pyRs        cOsJx|D]}|j|ƒqW|jjƒ}|j|ƒ|jj|S(N(R9R<R'R…R-(R†RRDtdictargt    _defaults((s#.\\ServerPython\webbottle\bottle.pyR-&s
  (R‰R“RR-(((s#.\\ServerPython\webbottle\bottle.pyR/s     tCheetahTemplatecBseZd„Zd„ZRS(cKs~ddlm}tjƒ|_i|j_|jjg|d<|jrb|d|j||_n|d|j||_dS(Niÿÿÿÿ(R0t
searchListRÄRý(    tCheetah.TemplateR0RvRwtcontexttvarsRÄR…Rü(R†RcR0((s#.\\ServerPython\webbottle\bottle.pyR/s     cOsjx|D]}|j|ƒqW|jjj|jƒ|jjj|ƒt|jƒ}|jjjƒ|S(N(R9R<R=R<R«R…Ræ(R†RRDR7R“((s#.\\ServerPython\webbottle\bottle.pyR-9s (R‰R“RR-(((s#.\\ServerPython\webbottle\bottle.pyR9.s    
tJinja2TemplatecBs,eZddid„Zd„Zd„ZRS(cKsÈddlm}m}|d||jƒ||_|rP|jjj|ƒn|rl|jjj|ƒn|rˆ|jjj|ƒn|j    r¬|jj
|j    ƒ|_ n|jj |j ƒ|_ dS(Niÿÿÿÿ(t EnvironmenttFunctionLoadertloader(tjinja2R?R@RAR R¶R9tteststglobalsRÄt from_stringR…t get_templateR=(R†R¶RCRDRDR?R@((s#.\\ServerPython\webbottle\bottle.pyRDs    cOsJx|D]}|j|ƒqW|jjƒ}|j|ƒ|jj|S(N(R9R<R'R…R-(R†RRDR7R8((s#.\\ServerPython\webbottle\bottle.pyR-Os
  cCsu||jkr|}n|j||jƒ}|s7dSt|dƒ)}|jƒj|jƒ|d„fSWdQXdS(NR cSstS(N(R•(((s#.\\ServerPython\webbottle\bottle.pyRI]s(RüRëRðRôR–RkRP(R†R=RóR÷((s#.\\ServerPython\webbottle\bottle.pyRAVs    N(R‰R“R1RR-RA(((s#.\\ServerPython\webbottle\bottle.pyR>Cs     tSimpleTemplatecBsbeZeedd„Zed„ƒZed„ƒZdd„Z    dd„Z
d„Z d„Z RS(c shi|_|j‰‡fd†|_‡‡fd†|_||_|rd|j|j|_|_ndS(Ncs t|ˆƒS(N(RX(RH(Rh(s#.\\ServerPython\webbottle\bottle.pyRIgscsˆt|ˆƒƒS(N(RX(RH(Rht escape_func(s#.\\ServerPython\webbottle\bottle.pyRIhs(RßRPt_strt_escapetsyntax(R†RHtnoescapeRKRr((RhRHs#.\\ServerPython\webbottle\bottle.pyRas            cCst|j|jpddƒS(Ns<string>Ra(RÐR„Rü(R†((s#.\\ServerPython\webbottle\bottle.pytcomscCs°|j}|s9t|jdƒ}|jƒ}WdQXnyt|ƒd}}Wn&tk
rxtddddƒ‚nXt|d|d|jƒ}|j    ƒ}|j
|_
|S(    NR Rbii sUnsupported template encodings.sUse utf-8 for templates.RPRK( RÄRôRüR–RXR¨R}t
StplParserRKt    translateRP(R†RÄR÷RPRR„((s#.\\ServerPython\webbottle\bottle.pyR„qs       cKs||f|d<dS(Nt_rebase((R†t_envRóRD((s#.\\ServerPython\webbottle\bottle.pyRP€scKsq|jƒ}|j|ƒ||jkrV|jd|d|jd|jƒ|j|<n|j|j|d|ƒS(NR=RðRKt_stdout(R'R9RßR.RðRKtexecute(R†RQRóRDR ((s#.\\ServerPython\webbottle\bottle.pyt_includeƒs
  .cBs|jjƒ}|j|ƒ|ji
|d6|jd6ej|j|ƒd6ej|j|ƒd6dd6|j    d6|j
d6|j d6|j d    6|j d
6ƒ|j|fdU|j dƒrþ|jdƒ\}}d j|ƒ|d <|2|j|||S|S( NRRt
_printlisttincludetrebaseRPRIRJRïRÎtdefinedRcRÝ(R<R'R9textendRmR7RTRPR1RIRJRïRÎRRRMRñRé(R†RRRDR tsubtpltrargs((s#.\\ServerPython\webbottle\bottle.pyRSŠs(     
 
 
 
 
cOsTi}g}x|D]}|j|ƒqW|j|ƒ|j||ƒdj|ƒS(sA Render the template using keyword arguments as local variables. Rc(R9RSRé(R†RRDR RFR7((s#.\\ServerPython\webbottle\bottle.pyR-¡s  N( R‰R“R§R•R1RR–RMR„RPRTRSR-(((s#.\\ServerPython\webbottle\bottle.pyRG`s           tStplSyntaxErrorcBseZRS((R‰R“(((s#.\\ServerPython\webbottle\bottle.pyR\¬sRNcBs¶eZdZiZdZZejddƒZed7ZdZdeZdZddd    „Z
d
„Z d „Z e e e ƒZd „Zd „Zd„Zed„ƒZdd„ZRS(s Parser for stpl templates. s4(?mx)(        # verbose and dot-matches-newline mode
        [urbURB]*
        (?:  ''(?!')
            |""(?!")
            |'{6}
            |"{6}
            |'(?:[^\\']|\\.)+?'
            |"(?:[^\\"]|\\.)+?"
            |'{3}(?:[^\\]|\\.|\n)+?'{3}
            |"{3}(?:[^\\]|\\.|\n)+?"{3}
        )
    )s|\nRcsâ
        # 2: Comments (until end of line, but not the newline itself)
        |(\#.*)
 
        # 3: Open and close (4) grouping tokens
        |([\[\{\(])
        |([\]\}\)])
 
        # 5,6: Keywords that start or continue a python block (only start of line)
        |^([\ \t]*(?:if|for|while|with|try|def|class)\b)
        |^([\ \t]*(?:elif|else|except|finally)\b)
 
        # 7: Our special 'end' keyword (but only if it stands alone)
        |((?:^|;)[\ \t]*end[\ \t]*(?=(?:%(block_close)s[\ \t]*)?\r?$|;|\#))
 
        # 8: A customizable end-of-code-block template token (only end of line)
        |(%(block_close)s[\ \t]*(?=\r?$))
 
        # 9: And finally, a single newline. The 10th token is 'everything else'
        |(\r?\n)
    s4(?m)^[ \t]*(\\?)((%(line_start)s)|(%(block_start)s))s4%%(inline_start)s((?:%s|[^'"\n]+?)*?)%%(inline_end)ss <% %> % {{ }}RbcCsvt||ƒ||_|_|j|p.|jƒgg|_|_d\|_|_d\|_    |_
d|_ dS(Nii(ii(ii( RXRÄRPt
set_syntaxtdefault_syntaxt code_buffert text_buffertlinenoR¾tindentt
indent_modt paren_depth(R†RÄRKRP((s#.\\ServerPython\webbottle\bottle.pyR‡äs cCs|jS(s= Tokens as a space separated string (default: <% %> % {{ }}) (t_syntax(R†((s#.\\ServerPython\webbottle\bottle.pyt
get_syntaxìscCsÎ||_|jƒ|_||jkr«d}ttj|jƒ}tt|jƒ|ƒƒ}|j    |j
|j f}g|D]}tj ||ƒ^q|}||j|<n|j|\|_ |_|_dS(Ns:block_start block_close line_start inline_start inline_end(ReR`t_tokenst    _re_cacheR%R¤RÍR€RDt    _re_splitt_re_tokt_re_inlRÐtre_splittre_toktre_inl(R†RKR«tetokenst pattern_varstpatternsR¦((s#.\\ServerPython\webbottle\bottle.pyR]ðs    &cCsˆ|jrtdƒ‚nx9trS|jj|jd|jƒ}|rO|j|j|jƒ!}|jj|ƒ|j    ƒ|_|j
dƒr |j|jj dƒ\}}}|jj|j|jƒ|jdƒ!|j
dƒ||ƒ|jt ||ƒ7_qn|j ƒ|j|j|j|jdt|j
dƒƒƒ7_qPqW|jj|j|jƒ|j ƒdj|jƒS(    NsParser is a one time instance.tposis
it    multilineiRc(R¾R³RËRlRëRÄRºR`R R¼R¢RáR¡t
flush_textt    read_codeR2RéR_(R†R£R|tlineRãR!((s#.\\ServerPython\webbottle\bottle.pyROþs*        "    5
 
c    CsOd\}}d}x6trJ|jj|d|ƒ}|sm|||7}t|ƒ}|j|jƒ|ƒPn||||jƒ!7}|jƒ}|jƒ\    }}}    }
} } } }}|j    dkrè| sÒ| rè|| pÞ| 7}qn|rû||7}q|r5|}|rG|jƒj
|j dƒrGt }qGq|    rW|j    d7_    ||    7}q|
r‹|j    dkr~|j    d8_    n||
7}q| r³| d}|_ |jd7_q| rÌ| d}|_ q| rä|jd8_q|r|rùt }qG||7}q|j|jƒ|ƒ|jd7_d\}}|_ |sPqqW|S(NRciRriiÿÿÿÿ(RcRc(RcRci(RËRmRëR¡t
write_codeRsRºR¼R»RdRbRgR•RcRbRa(R†tpysourceRst    code_linetcommentR¾R£RIt_comt_pot_pct_blk1t_blk2t_endt_cendt_nl((s#.\\ServerPython\webbottle\bottle.pyRusZ       ' "        c    CsÔdj|jƒ}|j2|s#dSgddd|j}}}x²|jj|ƒD]ž}|||jƒ!|jƒ}}|r¬|j|jtt    |j
t ƒƒƒƒn|j dƒrÎ|dc|7<n|j|j |jdƒjƒƒƒqUW|t|ƒkr”||}|j
t ƒ}|dj dƒrJ|dd     |d<n(|dj d
ƒrr|dd  |d<n|j|jtt    |ƒƒƒnd d j|ƒ}|j|jdƒd7_|j|ƒdS(NRcis\
s  s
iÿÿÿÿis\\
iýÿÿÿs\\
iüÿÿÿs_printlist((%s,))s, (RéR`RbRnR¹RºR¼R R%Rt
splitlinesRËRbtprocess_inlineR¢RsR¡RatcountRw(    R†R|R5RrtnlR£R¿tlinesR„((s#.\\ServerPython\webbottle\bottle.pyRtGs. +)
"cCs$|ddkrd|dSd|S(NiR»s_str(%s)is _escape(%s)((tchunk((s#.\\ServerPython\webbottle\bottle.pyR„\s cCs@d|j|j}||jƒ|d7}|jj|ƒdS(Ns  s
(RbRcRfR_R (R†RvRzR„((s#.\\ServerPython\webbottle\bottle.pyRwasN(R‰R“R”RhRjRkR;RiR^R1R‡RfR]R4RKRORuRtR7R„Rw(((s#.\\ServerPython\webbottle\bottle.pyRN±s$
 
                 2    c
Ose|r|dnd}x|dD]}|j|ƒq!W|jdtƒ}|jdtƒ}t|ƒ|f}|tks€tr6|jdiƒ}t||ƒrÈ|t|<|r3t|j    |q3q6d|ksød|ksød|ksød    |kr|d
|d ||t|<q6|d |d ||t|<nt|sTt
d d|ƒnt|j |ƒS(sê
    Get a rendered template as a string iterator.
    You can use a name, a filename or a template string as first parameter.
    Template rendering arguments can be passed as dictionaries
    or directly (as keyword arguments).
    iittemplate_adapterttemplate_lookupR…s
t{t%t$RÄRðR=iôsTemplate (%s) not foundN( R1R9RñRGt TEMPLATE_PATHtidt    TEMPLATESRtRdRRR-(RRDR…R7tadapterRðttplidR&((s#.\\ServerPython\webbottle\bottle.pyR‡gs$
0
R‰c s‡‡fd†}|S(sÉ Decorator: renders a template for a handler.
        The handler can control its behavior like that:
 
          - return a dict of template vars to fill out the template
          - return something other than a dict and the view decorator will not
            process the template, but return the handler result as is.
            This includes returning a HTTPResponse(dict) to get,
            for instance, JSON with autojson or other castfilters.
    cs(tjˆƒ‡‡‡fd†ƒ}|S(Ncsgˆ||Ž}t|ttfƒrJˆjƒ}|j|ƒtˆ|S|dkrctˆˆƒS|S(N(RdR€t    DictMixinR'R9R‡R1(RRDtresultttplvars(R<R8ttpl_name(s#.\\ServerPython\webbottle\bottle.pyRp•s     (RmRY(R8Rp(R–R<(R8s#.\\ServerPython\webbottle\bottle.pyRO“s$ ((R–R<RO((R–R<s#.\\ServerPython\webbottle\bottle.pyR†ˆs s./s./views/s I'm a teapoti¢sPrecondition Requiredi¬sToo Many Requestsi­sRequest Header Fields Too Largei¯sUnavailable For Legal ReasonsiÃsNetwork Authentication Requirediÿccs+|]!\}}|d||ffVqdS(s%d %sN((RåRFRG((s#.\\ServerPython\webbottle\bottle.pys    <genexpr>ºss#
%%try:
    %%from %s import DEBUG, request
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error: {{e.status}}</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans-serif;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error: {{e.status}}</h1>
            <p>Sorry, the requested URL <tt>{{repr(request.url)}}</tt>
               caused an error:</p>
            <pre>{{e.body}}</pre>
            %%if DEBUG and e.exception:
              <h2>Exception:</h2>
              %%try:
                %%exc = repr(e.exception)
              %%except:
                %%exc = '<unprintable %%s object>' %% type(e.exception).__name__
              %%end
              <pre>{{exc}}</pre>
            %%end
            %%if DEBUG and e.traceback:
              <h2>Traceback:</h2>
              <pre>{{e.traceback}}</pre>
            %%end
        </body>
    </html>
%%except ImportError:
    <b>ImportError:</b> Could not generate the error page. Please add bottle to
    the import path.
%%end
s
bottle.exts.exts    bottle_%sc sxt|ƒ\}‰‡fd†}|jrHtdtƒtjdƒn|js^|dƒntjjddƒtj    j
dtj    dƒ|j p—dd    }}d
|kræ|j d ƒ|j d
ƒkræ|j d
d ƒ\}}n|jd ƒ}tƒ}xÛ|jp gD]Ê}yT|jdƒrZt|dƒ }|jt|jƒƒƒWdQXn |j|ƒWqtjk
rŠ}||ƒqtk
r¨|d|ƒqtttfk
r×}    |d||    fƒqXqWxL|jpëgD];}
d|
kr|j|
jdd ƒfƒqìt ||
<qìWt!|jd|dt"|ƒd|j#d|j$d|j%d|j&d|ƒdS(Ncs)ˆjƒtd|ƒtjdƒdS(Ns
Error: %s
i(t
print_helpR¤RER(tcli_msg(R(s#.\\ServerPython\webbottle\bottle.pyt
_cli_errorÿs
s
Bottle %s
is%No application entry point specified.R’R»R$t    localhostiR    t]is[]s.jsonR sUnable to read config file %rs"Unable to parse config file %r: %sR3RRRRRR(R('RtversionRRRRERR R®RIRRÎRŒtrfindR“RsR0RªRbRôRRÖR–RÂR½tErrorRòR¨RmRÅR>R9R`RËRqR¬RRRR(( R RR™RRRtcfileR÷t parse_errorRÑtcval((Rs#.\\ServerPython\webbottle\bottle.pyt_mainüsL         *    "                     (üR”REt
__author__Rt __license__RR#R‰R RÁRút email.utilsRRmR½RŽRZRRàR¤RRvRkRvRÑR5ttypesR%R'R&RiR(R)R¯R*R+t unicodedataR,tujsonR-RR.RWRôRÙtinspectR/R?R@t version_infoRxR#RFRGRJRRR¤Ròt http.clienttclientthttplibt_threadRt urllib.parseRKRLR RMRNR
ROR>R7t http.cookiesRRRSRTt collectionsRUR“RÃtioRVR½R«RyReRÖRlR%R_R^turlparseturllibtCookietcPickleR`R¿RÐRiRXRâRnR}RAR1R‚R–R˜R‘RšR›RœRRžRŸR§R¨R R-R²R<R=R>RARxRyRzR&tResponseRYRÆR~RARBR‡R›R¹RPR´RÏR€R0R~RÒR›RŸR;RÎRR1RR•RRËR&R(R^R]RRtfindallR4R;RËRÀRERHRFR§RMR{RXRZR[RaRïR}RRRƒRÑRiRNR@RpRøR\R_RcRiR~R‰R‘R•R›RžR¨R´R¹RÉRÌRÑRÖRÝRàRâRäRðRòRRzRRRqRRR!R"R/R9R>RGR\RNR‡t mako_templatetcheetah_templatetjinja2_templateR†t    mako_viewt cheetah_viewt jinja2_viewRŽRRtRt    responsesR't
HTTP_CODESR2RMRˆRWRRwtappsR RªRR*R¢(((s#.\\ServerPython\webbottle\bottle.pyt<module>sô 
         À    "                           
    
                    Íoÿÿÿà       ÿ        
 +#g.&;    ÿVG  i     
                 !         
                     
 
 !
         ! 
         a.RL¶              
 
 
 
 
 
    )
             6