\e?dZddlZddlZddlZddlZej dZGddZGddZe dk(rd Z ee Z e e yy) z;deb822 parser with support for comment headers and footers.NTceZdZUdZej eefed<eeefed<eed<eed<de jedffdZ ded efd Z ded d fd Z ded ed d fdZd efdZe j"ded ed zfdZe j"deded eezfdZddeded zd ed zezfdZeded efdZd efdZy )SectionzcA single deb822 section, possibly with comments. This represents a single deb822 section. tags _case_mappingheaderfootersectionct|trutj|j|_|jDcic]}|j |c}|_|j|_|j|_yddg}d}d}|jdD]3}|jdr|dd}||xx|dzz cc<*d}||dzz }5tjtj||_|jDcic]}|j |c}|_|\|_|_ycc}wcc}w)NF #T) isinstancer collections OrderedDictrcasefoldrrr split startswithapt_pkg TagSection)selfr kcomments in_sectiontrimmed_sectionlines 4/usr/lib/python3/dist-packages/aptsources/_deb822.py__init__zSection.__init__s" gw '#// =DI;?99!Ea!**,/!ED !..DK!..DK 8 MM$' +Ds#ABx$t 3$J td{ *O + ++G,>,>,OP 7;yyA!ajjlAoA#+  T[+"F(Bs EEkeyreturncp|j|jj|j|S)zGet the value of a field.rrgetrrr s r __getitem__zSection.__getitem__7s*yy++// DEENcn|j|jj|j|=y)zDelete a fieldNr#r%s r __delitem__zSection.__delitem__;s' IId((,,S\\^SA Br'valc|j|jvr||j|j<||j|j|j<y)zSet the value of a field.N)rrr)rr r*s r __setitem__zSection.__setitem__?sK <<>!3!3 314D  s||~ .8; $$$S\\^45r'c,t|jSN)boolrrs r__bool__zSection.__bool__EsDIIr'cyr.r%s rr$z Section.getH r'defaultcyr.r3rr r5s rr$z Section.getLr4r'c0 ||S#t$r|cYSwxYwr.)KeyErrorr7s rr$z Section.getPs% 9  N s  contentc\|r)djd|jDdzSdS)Nr c3&K|] }d|z yw)rNr3).0rs r z*Section.__comment_lines..YsBTcDjBsr )join splitlines)r:s r__comment_lineszSection.__comment_linesVs8 IIBW-?-?-AB BT I  r'c|j|jdjd|jj Dz|j|j zS)z+Canonical string rendering of this section.r c32K|]\}}|d|dyw)z: r Nr3)r=rvs rr>z"Section.__str__..bs B12aSmB)_Section__comment_linesrr?ritemsr r0s r__str__zSection.__str__^sU   -ggB 0ABB C""4;;/ 0 r'r.)__name__ __module__ __qualname____doc__rrstr__annotations__dicttypingUnionrr&r)r,r/r1overloadr$r staticmethodrFrHr3r'rrrsP  ! !#s( ++S>! K K, S)^ <,4FsFsFCsCtC4 $$WW%56   MM !1 2 r'r!c,t|jSr.)iterrXr0s r__iter__z File.__iter__|sDMM""r'cFdjd|jDS)Nr c32K|]}t|ywr.)rM)r=ss rr>zFile.__str__..s7AQ7rE)r?rXr0s rrHz File.__str__syy7777r'N) rIrJrKrLio TextIOBaserrPIteratorrr]rMrHr3r'rrUrUgs83R]]3 #&//'2#88r'rU__main__zV# Header # More header K1: V1 # Inline K2: V2 # not a comment # Footer # More footer ) rLrrarPrTypeVarrrrUrIstr`printr3r'rrhsfB FNN3R R j888 z B  A !Hr'