;ò ÎÂ>c@sqddd!ZdklZdklZdkZdklZdklZdklZd k l Z l Z l Z l Z d k lZlZlZd k lZlZd klZlZd klZlZlZlZdklZlZlZdkl Z dk!l!Z!dk"l#Z#dk$l%Z%deee#fd„ƒYZ&ei'e&ƒde&fd„ƒYZ(ei'e(ƒdS(s$Revision: 1.35 $i iþÿÿÿ(s Persistent(sHTMLFileN(sIISet(s Squishfile(sImplicit(stimes localtimesstrftimesgmtime(sstripssplitsjoin(slowersatoi(squotesunquote(sCRLFstagRegexs doAddPostingsgetitem(sModeratePostingss AddPostingssView(s html2safehtml(sDateTime(s Traversable(sClassSecurityInfosPostingcBs˜tZdZeƒZeidƒdZdZdZdZ gZ e de ƒƒZ eiedƒee dƒoe idƒne Ze Zeid ƒd „Zeid ƒd „Zeied ƒd„Zeiedƒd„Zeidƒd„ZeiedƒeZeidƒdd„Zeidƒd„Zeiedƒdd„Z e Z!Z"eiedƒd„Z#eiedƒe$d„Z%eied ƒd!„Z&eied"ƒd#„Z'eied$ƒd%„Z(eied&ƒd'„Z)eied(ƒd)„Z*eid*ƒd+„Z+eied,ƒd-„Z,eied.ƒd/„Z-eie.d0ƒd1„Z/eied2ƒd3„Z0eied4ƒd5„Z1eid6ƒd7„Z2eid8ƒd9„Z3eie.d:ƒd;„Z4eie.d<ƒd=e$e$d>„Z5d?„Z6eied@ƒe$e$e$d=dddA„Z7eiedBƒdC„Z8eiedDƒdE„Z9eidFƒdG„Z:RS(HsSquishdot PostingsallowsPostingsmisc_/Squishdot/posting_imgisHTMLseditPostingFormsmanage_editForms_setNames__init__cCs^t|ƒ|_tƒ|_||_||_||_||_d|_ d|_ ||_ dS(Ni( sstrsidsselfsIISetsidssthreadscreatedsmodifiedslevelsrevsubs reply_cntsreviewed(sselfsidsthreadslevelsreviewed((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys__init__9s       sindexcCs>|i|t|iƒdƒƒ|io|iiƒndS(Ns/(sselfscatalog_objectsjoinsgetPhysicalPathsthreads aq_parentsindex(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysindexEs s getFieldscCs |iSdS(s-Return a list of fields that this posting hasN(sselfs_fields(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys getFieldsNss getThreadcCs|i|SdS(s;A better abstaction rather than accessing the list directlyN(sselfsthreadsindex(sselfsindex((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys getThreadSss__len__cCsdSdS(Ni((sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys__len__Xss __getitem__ssetItemicCsHt|d|ƒ}|ii|ƒ||i|<|o|iƒndS(Nsaq_base( sgetattrsobjsbobjsselfsidssinsertsidsdatasindex(sselfsidsobjsindexsbobj((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pyssetItem^s  s textToSearchcCs<d}x+|iD] }|tid|ƒd}qW|SdS(Nss (stextsselfsbodyslinestagRegexssub(sselfstextsline((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys textToSearchks  s date_posteds%A %B %d, @%I:%M%pcCs t|iƒ}t||ƒSdS(N(s localtimesselfscreatedsltimesstrftimesfmstr(sselfsfmstrsltime((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys date_postedtssdatecCst|iƒSdS(s1return the date of creation for indexing purposesN(sDateTimesselfscreated(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysdate}ssbody_lencCs½d}|i o d}n%x!|iD]}|t|ƒ}q%W|tjoP|djodSn|djo|d}t|ƒdSqœt|ƒdSn|djo|Sn ||SdS(NisiÈis Kbs bytesi(stlensselfsbodyslineslensdivisorsNonesstr(sselfsdivisorstlensline((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysbody_len‚s         s postingValuescCs|i|iƒSdS(N(sselfsdata_mapsids(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys postingValuesšsstpIdcCs |iSdS(N(sselfsid(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pystpIdŸsstpURLcCs |iSdS(N(sselfsid(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pystpURL£ssthiscCs|SdS(N(sself(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysthis§ss has_itemscCst|iƒSdS(N(slensselfsids(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys has_itemsªsssub_idscCsGt|i|iƒx)|i|iƒD]}|i|ƒ}q&W|SdS(N(smapsidssinsertsselfsdata_mapsitemssub_ids(sselfsidssitem((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pyssub_ids®s s desc_itemscCsfg}t|i|iƒ}td„|ƒ}x.|D]&}|i |ƒ|i |i ƒƒq4W|SdS(NcCs|iS(N(spsreviewed(sp((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys¹s( sitemssmapsselfs __getitem__sidsspostingssfiltersreviewedsitemsappendsextends desc_items(sselfsitemssreviewedsitemspostings((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys desc_itemsµs s attachmentcCs"|i}|o|fptSdS(N(sselfsfilesNone(sselfsfile((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys attachmentÀs s suggest_titlecCs3|i}t|d ƒdjo|pd|SdS(Nisre:sRe: %s(sselfstitlestslower(sselfst((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys suggest_titleÆs s thread_pathcCs ttd„|iƒdƒSdS(NcCsd|S(Ns/%s(sx(sx((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysÍss(sjoinsmapsselfsthread(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys thread_pathÌss index_htmlcCs|i||ƒSdS(s2 squishdot article main page (the read more page) N(sselfs posting_htmlsREQUEST(sselfsREQUEST((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys index_htmlÐssdoNotifycCs2|io|io|i||i|ƒndS(N(sselfsnotifysemails sendEmailsmsgsREQUEST(sselfsmsgsREQUEST((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysdoNotifyÕss cancelNotifyc Cs8d|_|i|d|ddddd|iƒƒSdS( s' cancels email notification of replies ssREQUESTstitlesCancelled Notificationsmessages9You will no longer be notified of replies to this messagesactionN(sselfsnotifys showMessagesREQUESTs absolute_url(sselfsREQUEST((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys cancelNotifyÛs  s dummyPostingcCs tdgddƒi|ƒSdS(s7 returns a dummy posting for the previewPosting method iiN(sComments__of__sself(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys dummyPostingäss addPostingsc Cs)t||||dddddtƒSdS(s add a Comment s moderateds mod_commentsmessagesYour reply has been postedsklassN(s doAddPostingsselfsfilesREQUESTsRESPONSEsComment(sselfsfilesREQUESTsRESPONSE((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys addPostingés cCs"|io|i||ƒndS(N(sselfs mod_comments set_reviewedsreviewed(sselfsreviewed((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys_processReviewedðs seditc Csû|id|ƒ\} } | tj o/|i|d| ddd| d|iiƒSnxh|iƒD]Z} | i | dƒ} | dd gjot t id | ƒd ƒ} nt|| | ƒqaW| d |_| d |_t|d ƒo|i}|p|o@yt||iiiƒƒWntj onXd|_n|o/t|ƒ}t||iƒ|ƒ||_n|i|ƒ|i dƒ} | tj ot | i!ƒƒ|_"nt#ƒ|_$|o|i%ƒn|o|i'|iiƒndS(s edit replies srawsvaluesstitles Data Missingsmessagesactionssbodyssummarys snotifysencodingsfilenamesdateN((sselfsvalidatePostingsREQUESTs processedsmessagesNones showErrors HTTP_REFERERs getFieldssfieldsgetsvaluessplitsCRLFssubssetattrsnotifysencodingshasattrsnew_attachmentsfilenames have_new_filesdelete_attachmentsdelattrsaq_basesfiles file_namesAttributeErrors Squishfiles_processReviewedsreviewedsdatesintstimeTimescreatedstimesmodifiedsindexsRESPONSEsredirect(sselfsREQUESTsRESPONSEsdelete_attachmentsnew_attachmentsreviewedsindexs have_new_filesfilesmessagesfieldsdatesvalues processed((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pyseditõsD          sshowBodycCs|i|i|iƒSdS(N(sselfsrendersbodysencoding(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysshowBody-ss plain_textcCsA|idjo|it|idƒƒSnt|idƒSdS(NsHTMLs s (sselfsencodings html2textsjoinsbody(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys plain_text2ssgetIdcCs |iSdS(N(sselfsid(sself((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysgetId9s(;s__name__s __module__s__doc__sClassSecurityInfossecurityssetDefaultAccesss meta_typesiconsrootsencodings_fieldssHTMLFilesglobalssmanage_editFormsdeclareProtectedsModeratePostingsshasattrs_setNamesmanages manage_mainsdeclarePrivates__init__sindexsViews getFieldss getThreads declarePublics__len__sgetitems __getitem__ssetItems textToSearchs date_posteds date_createds time_createdsdatesNonesbody_lens postingValuesstpIdstpURLsthiss has_itemsssub_idss desc_itemss attachments AddPostingss suggest_titles thread_paths index_htmlsdoNotifys cancelNotifys dummyPostings addPostings_processReviewedseditsshowBodys plain_textsgetId(((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysPostings˜                                   7   sCommentcBs,tZdZdZdZddddgZRS(s Kindof small, isn't it ;-)sCommentsmisc_/Squishdot/comment_imgstitlesauthorsbodysemail(s__name__s __module__s__doc__s meta_typesicons_fields(((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pysComment?s ()s __version__sGlobalss PersistentsHTMLFilesBTrees.IIBTreesIISets Squishfiles AcquisitionsImplicitstimes localtimesstrftimesgmtimesstringsstripssplitsjoinslowersatoisurllibsquotesunquotesUtilitysCRLFstagRegexs doAddPostingsgetitemsSquishPermissionssModeratePostingss AddPostingssViews stripograms html2safehtmlsDateTimesOFS.Traversables Traversables AccessControlsClassSecurityInfosPostingsInitializeClasssComment(sunquotes html2safehtmlsDateTimesstrips SquishfilesModeratePostingssPostingsIISets AddPostingsssplits __version__stagRegexs doAddPostings localtimesquotesClassSecurityInfosgmtimes Persistents TraversablesatoisCRLFsViewsCommentslowersjoinsHTMLFilesImplicitsGlobalssgetitemstimesstrftime((s:/mnt/gmirror/ports/www/squishdot/work/Squishdot/Posting.pys? s*           ÿ