Ñò {bVMc @sdZddkZddkZddkZddkZddklZddklZeƒadgZ d„Z d„Z e e d„Z d „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Zd„Zeid„ZdS(s§ Planet Configuration This module encapsulates all planet configuration. This is not a generic configuration parser, it knows everything about configuring a planet - from the structure of the ini file, to knowledge of data types, even down to what are the defaults. Usage: import config config.load('config.ini') # administrative / structural information print config.template_files() print config.subscriptions() # planet wide configuration print config.name() print config.link() # per template configuration print config.days_per_page('atom.xml.tmpl') print config.encoding('index.html.tmpl') Todo: * error handling (example: no planet section) iÿÿÿÿN(t ConfigParser(turljointfiltersc sjddk‰d„‰d„‰‡‡fd†}d‡‡fd†}d‡‡‡fd †}‡‡fd †}‡‡fd †}|d d ƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|ddƒ|d dƒ|d!d"ƒ|d#dƒ|d$dƒ|d%d&ƒ|d'dƒ|d(d)ƒ|d*d+ƒ|d,ƒ|d-ƒ|d.d/ƒ|d0ƒ|d1d2ƒ|d3dƒ|d4d5ƒ|d6dƒ|d7d8ƒ|d9d8ƒ|d:dƒ|d;dƒ|d<dƒ|d=dƒ|d9dƒ|d>d?ƒ|d@dƒ|dAdƒ|dBdƒdS(Cs"define the struture of an ini fileiÿÿÿÿNcSs{|o$ti||ƒoti||ƒStid|ƒo5|djotid|dtƒStid|ƒS|SdS(NtPlanett log_formattraw(tparsert has_optiontgettTrue(tsectiontoptiontdefault((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR*s c Ss¸g}tidƒ}xœ|iƒD]Ž}|i|ƒ}|oe|iƒ\}}}xZtƒD]>}t|ƒi|dƒ} | o|i || |ƒq]q]Wq"|i |ƒq"W|S(Ns^(.*)#{(\w+)}(.*)$( tretcompiletsplittmatchtgroupst subscriptionst feed_optionsRtNonetappend( tlisttoutputtwildtfileRtpretvartposttsubtvalue((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytexpand5s  !cs0tˆˆ|‡‡fd†ƒtiˆƒdS(Ncsˆdˆ|ƒS(N(R(R (tnameR(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytFs(tsetattrtplanet_predefined_optionsR(R R (Rtconfig(R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyt define_planetEsics0tˆˆ‡‡‡fd†ƒtiˆƒdS(NcstˆdˆˆƒƒS(N(tintR((R R R(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!Ks(R"R#R(R R (RR$(R R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytdefine_planet_intJstcs3tˆˆ‡‡‡‡fd†ƒtiˆƒdS(NcsˆˆdˆˆƒƒS(N(R((R R RR(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!Ps(R"R#R(R R (RR$R(R R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytdefine_planet_listOs"cs#tˆˆ|‡‡fd†ƒdS(Ncsˆ|ˆ|ƒS(((R R (R R(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!Us(R"(R R (RR$(R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyt define_tmplTscs#tˆˆ|‡‡fd†ƒdS(Ncstˆ|ˆ|ƒƒS((R&(R R (R R(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!Zs(R"(R R (RR$(R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytdefine_tmpl_intYsR sUnconfigured Planettlinktcache_directorytcachet log_leveltWARNINGRs"%(levelname)s:%(name)s:%(message)st date_formats%B %d, %Y %I:%M %ptnew_date_formats %B %d, %Yt generatortVenust generator_uris#http://intertwingly.net/code/venus/t owner_namesAnonymous Cowardt owner_emailt output_themet output_dirRtspider_threadstpubsubhubbub_hubtpubsubhubbub_feedssatom.xml rss10.xml rss20.xmltnew_feed_itemst feed_timeoutitcache_keep_entriesi ttemplate_filestbill_of_materialsttemplate_directoriest.tfilter_directoriestdjango_autoescapetont days_per_pagetitems_per_pagei<tactivity_thresholdtencodingsutf-8t content_typetignore_in_feedt name_typet title_typet summary_typet future_datestkeeptxml_basetfiltertexclude(R$R(R%R'R)R*R+((RR$Rs:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyt__init__%s\                                       cs¿tƒati|ƒddk}ddk}ddkl‰l‰l‰|i}|p"|i |i ƒ|i ƒƒ}n|i ƒ}|o=x:dt iitiddƒfD]}t ii||ƒ}t ii|dƒ}t ii|ƒo¿|iƒ}||jo|i|ƒnt|dƒp |g}nxD|D]<} t ii| ƒ|jo|it ii| ƒƒqCqCWtƒati|ƒ|iƒ} |g} |iƒD]-} | |jo| t ii|| ƒq¹q¹~ 7}|iƒ} tid d dƒti|ƒx2|iƒD]$}|| jo| i|ƒq)q)Wtid d d i| ƒƒtid d d i|ƒƒtid d d i| |iƒƒƒPq²q²W|id|ƒn|iƒ}t iitiddƒ}||jo:t ii|ƒo'tid dd i||gƒƒn|iƒ}|omt ii|iƒƒpt i|iƒƒn‡‡‡‡fd†}x"|D]‰tˆt|ƒqWndS(s$ initialize and load a configurationiÿÿÿÿN(topmltfoaft csv_configR(itthemess config.iniRRR@RAt RBsUnable to find theme %sRRDc s7tˆƒidƒdjoˆi||ƒnÞtˆƒidƒdjoˆi||ƒn®tˆƒidƒdjoˆi||ƒn~tˆƒidƒdjo|i|ƒnQddkl}ddk}|i|i|i tˆƒ|i ƒdd ƒƒƒ|i ƒgˆggjo t ‚ndS( NRViRWtcsvR$iÿÿÿÿ(tshelltmodeRS( RKtfindt opml2configt foaf2configt csv2configtreadfptplanetR\tStringIOtruntgetvaluetsectionst Exception(tdatat cached_configR\Rd(RWRVRXR(s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyt data2configÉs "(RRtreadR$RcRVRWRXtloggert getLoggerR/RR8tostpathtjointsystexistsRBRthasattrtdirnameRAR@tsetterrorRDt reading_liststcache_lists_directorytmakedirstdownloadReadingList(t config_filesR$RctlogtthemeRpt theme_dirt theme_filetdirst config_filetbomt_[1]tdirR@Rt filter_dirRxRk((RXRWRVRs:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytload‰sj   " #   !    A        ' cCsddkl}ddk}yIddk}ddk}ddkl} | |iƒ|ƒ} h} x-|i|ƒD]} |i || ƒ| | tiddƒotiddƒStiitƒdƒSdS(NRRytlists(RRRRoRpRqR-(((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRyKscCs©tiddƒotiddƒStƒowxttƒD]e}tiitii|ƒƒd}|i dƒdjp|i dƒdjot tƒ|ƒSq8WndS(NRtfeeditatomtrss( RRRR,R@RoRptsplitexttbasenameR^R(t template_fileR ((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRµQs  ",cCsxtiddƒotiddƒStƒotƒidƒdjodStƒotƒidƒdjodSdS(NRtfeedtypeR¶iR·(RRRRµR^(((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR»Zs ##cCstdd„tiƒƒS(s list the feed subscriptions RScSs(|djo|tƒtƒtƒjS(R(R@RRx(Rµ((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!ds (t __builtins__RRg(((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRbs cCsÉg}x¼tiƒD]®}ti|dƒo•ti|dƒ}|idƒdjpX|idƒdjpB|idƒdjp,|idƒdjp|idƒdjo|i|ƒqÁqqW|S(s% list of lists of feed subscriptions RKRViRWR[R$RC(RRgRRR^R(tresultR ttype((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRxhs ,,cCs÷g}tiddƒo |tiddƒiƒ7}nt|ƒo$|idtit|ƒƒƒnt|ƒo$|idtit|ƒƒƒnxU|o |gpt ƒD]9}ti|dƒo |ti|dƒiƒ7}q¶q¶W|S(NRRsregexp_sifter.py?require=sregexp_sifter.py?exclude=( RRRRRSRturllibtquoteRTR@(R R((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRts     $cCsttd„tidƒƒƒS(s" dictionary of planet wide optionscSs"|tid|d|djƒfS(RRR(RR(topt((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!…sR(tdicttmapRR’(((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytplanet_optionsƒs c sŸddk}tg}tƒiƒD]*\}}|tjo|||fq#q#~ƒ}tiˆƒo2|itt‡fd†ti ˆƒƒƒƒn|S(s$ dictionary of feed specific optionsiÿÿÿÿNcs|tiˆ|ƒfS((RR(RÁ(R (s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR!s( R$RÂRÄR”R#Rt has_sectiontupdateRÃR’(R R$R„RªRR’((R s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyR‰s #*cCs t|ƒS(s( dictionary of template specific options(R(R ((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyttemplate_options“scCs t|ƒS(s& dictionary of filter specific options(R(R ((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pytfilter_options—scCsti|ƒGHdS(s write out an updated template N(RRŸ(R((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyRŸ›s(t__doc__RoRrR R¿RturlparseRRR#RUR‡R R{R¯R°R²RyRµR»RRxRRRÄRRÇRÈtstdoutRŸ(((s:/home/sa3ruby/intertwingly.net/code/venus/planet/config.pyts,0   d UX