ó J¡Vc @sLdZdZdZdZddlZddlZddlZddlTddlm Z m Z m Z ddl m Z d ejfd „ƒYZe jeeeeeeefeefƒZeje jƒejd eƒ\ZZZZZZ ed kr"e j!ƒ re"j#d eƒeZnn'e j$ƒ rIe"j#deƒeZneekr´ed krñe"j%dƒyddl&Tddl'm(Z(Wn+e)k r¹e"j#dƒe*j+dƒnXeZ,eZ-e.e*j/ƒZ,e ekr1e0j1dddƒZ e j2ƒdkr.e3e4j5ƒƒZ e"j6de ƒnne j2ƒdkrdZ7y.e j8dƒ\Z9Z:dj;e9e7gƒZ Wn,e<k r¥e Z9dj;e e7gƒZ nXe"j6de ƒe=eƒZ>de9Z?e"j6de?ƒe>j@e?eAjBƒZCeCr e,jDe>ƒndZ ne dkr.e"j6dƒnde"j6de ƒeEjFeEe ƒƒe eA_5y e5jGe5jHe5jIe ƒƒWne5jJk r‘nXe(ƒZ-e-jKƒe,jLe-ƒye"j6dƒe,jMƒWneNk rànXe*j+d ƒnÀy$dd!lOm.Z.dd"lPmQZQWn+e)k rBe"j#d#ƒe*j+dƒnXe"j%d$ƒe.e*j/ƒZ,eQeƒZReRjKƒye"j6dƒe,jSƒWneNk r°e*j+d ƒnXn”ydd%lTmTZTWn+e)k rõe"j#d&ƒe*j+dƒnXeƒZUyeUjVƒWneNk r-e"j#d'ƒnXe"jWd(ƒe"jWd)ƒdS(*s6.0sFax Address Bookshp-fabs$A simple fax address book for HPLIP.iÿÿÿÿN(t*(tutilsttuitmodule(tinputtConsolecBs7eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z eed „Zeed „Zd„ZeZd„Zd„Zd„ZeZd„ZeZd„ZeZd„ZeZd„Zd„ZeZ d„Z!e!Z"d„Z#e#Z$d„Z%d„Z&RS(cCs>tjj|ƒd|_tjƒ|_tjdƒ|_ dS(NsBType 'help' for a list of commands. Type 'exit' or 'quit' to quit.s hp-fab > ( tcmdtCmdt__init__tintrotfaxtFaxAddressBooktdbtlogtboldtprompt(tself((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyR.s cCs |jGHdS(s/Print a list of commands that have been enteredN(t_hist(Rtargs((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_hist5scCsdS(sExits from the consoleiÿÿÿÿ((RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_exit9scCsdS(sExits from the consoleiÿÿÿÿ((RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_quit=scCs |j|ƒS(s$Exit on system end of file character(R(RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_EOFBscCstjj||ƒdS(sÃGet help on commands 'help' or '?' with no arguments prints a list of commands for which help is available 'help ' or '? ' gives help on N(RRtdo_help(RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyRFscCs<tjj|ƒg|_i|_i|_|jdƒdS(sInitialization before prompting user for commands. Despite the claims in the Cmd documentaion, Cmd.preloop() is not a stub. tN(RRtpreloopRt_localst_globalstdo_list(R((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyROs    cCstjj|ƒdGHdS(sƒTake care of any unfinished business. Despite the claims in the Cmd documentaion, Cmd.postloop() is not a stub. s Exiting...N(RRtpostloop(R((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyRZscCs|j|jƒg7_|S(sá This method is called after the line has been input but before it has been interpreted. If you want to modifdy the input line before execution (for example, variable substitution) do it here. (Rtstrip(Rtline((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytprecmdascCs|S(s™If you want to stop the console, return something that evaluates to true. If you want to do some post command processing, do it here. ((RtstopR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytpostcmdiscCsdS(sDo nothing on empty input lineN((R((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt emptylineoscCstjdƒdS(Ns2Unrecognized command. Use 'help' to list commands.(R terror(RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdefaultsscCsg|süxZtrø|r3ttjdƒƒjƒ}nttjdƒƒjƒ}|jƒdkrrtjdƒGHdS|s•|r‚dStjdƒq n|rÉ|jj |ƒdk rôtjdƒq qôn+|jj |ƒdkrôtjdƒq nPq Wng|jƒ}|r:|jj |ƒdk rctjdƒdSn)|jj |ƒdkrctjdƒdS|S( Ns?Enter the name to add to the group (=done*, c=cancel) ? sEnter name (c=cancel) ? tctCanceledRsName must not be blank.s4Name already exists. Please choose a different name.s.Name not found. Please enter a different name.( tTrueRR RRtlowertredR$R tgettNone(RRt fail_if_matchtalt_texttnickname((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt get_nicknamevs<        cCs[|jjƒ}|sx?tr|rBttjdƒƒjƒ}nttjdƒƒjƒ}|jƒdkrtjdƒGHdS|s¤|r‘dStj dƒqn|dkr¹dGHdS|rá||krtj d ƒqqn||krtj d ƒqnPqWnO|jƒ}|r:||krWtj d ƒdSn||krWtj d ƒdS|S( Ns4Enter the group to join (=done*, c=cancel) ? sEnter the group (c=cancel) ? R&R'Rs!The group name must not be blank.tAlls<Cannot specify group 'All'. Please choose a different group.s6Group already exists. Please choose a different group.s0Group not found. Please enter a different group.( R tget_all_groupsR(RR RRR)R*R$(RRR-R.t all_groupst groupname((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt get_groupname¦sD             cCs}|r_|jƒjƒd}|jdƒr<|jdƒdS|jdƒr_|jdƒdSn|jdƒ|jdƒdS(sl List names and/or groups. list [names|groups|all|] dir [names|groups|all|] itnamRNtgro(Rtsplitt startswithtdo_namest do_groups(RRtscope((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyRÛs   cCsÏ|jjƒ}tj|ƒtjdƒGHt|ƒdkrÁtjƒ}d|_x`t |j ƒƒD]L\}}|j dƒsd|j ||d|d d j |d ƒfƒqdqdW|jƒnd GHdGHd S(s+ List names. names s Names: itNames Fax NumbertNotessMember of Group(s)t__R tnotess, tgroupss(None)N(R=s Fax NumberR>sMember of Group(s)((R tget_all_recordsR tdebugRtlenRt FormattertheadertlisttitemsR9taddtjointoutput(RRt all_entriestftnamete((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyR:òs   5 cCsÁ|jjƒ}tj|ƒtjdƒGHt|ƒr³tjƒ}d|_xX|D]P}|j |dj g|jj |ƒD]}|j dƒsz|^qzƒfƒqRW|j ƒndGHd GHdS( s- List groups. groups s Groups: tGrouptMemberss, R?s(None)N(RPRQ((R R2R RCRRDRRERFRIRJt group_membersR9RK(RRR3RMtgrouptx((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyR; s     N cCsE|j|dtƒ}|sdS|jj|ƒ}tj|ƒtjd|ƒGHd}d}d}|d}xÁtr/ttjd|ƒƒj ƒ}|j ƒdkr¸tj dƒGHdS| rÙ| rÙtj d ƒqon|sè|}nt} x1|D])} | d krõtj d ƒt} PqõqõW| roPqoqoW|d } ttjd | ƒƒj ƒ} | j ƒdkr}tj dƒGHdS| sŒ| } n|drždGHng} xq|dD]e}|dkrÇq¯nt jd|ddƒ\} }| sþtj dƒGHdS|r¯| j|ƒq¯q¯WdGHxítr |jddtdtƒ}|j ƒdkretj dƒGHdS|soPn|jjƒ}||krÙtjdƒt jdddƒ\} }| sÊtj dƒGHdS|sÙq qÙn||dkrütj dƒq n| j|ƒq W|jj|||||| | ƒ|j|ƒdGHdS(sI Edit an name. edit [name] modify [name] R-Ns! Edit/modify information for %s: RR s&Fax Number (='%s', c=cancel) ? R&R'sFax number must not be empty.s0123456789-(+) *#sOInvalid characters in fax number. Fax number may only contain '0123456789-(+) 'R@s!Notes (='%s', c=cancel) ? RAs Leave or Stay in a Group: R1sStay in group %s t choice_prompts*(y=yes* (stay), n=no (leave), c=cancel) ? s Join New Group(s): R.sGroup not found.sIs this a new groups!(y=yes* (new), n=no, c=cancel) ? sTGroup already specified. Choose a different group name or press to continue.((R0tFalseR R+R RCRR(RRR)R*R$Rt enter_yes_notappendR5R2twarntsettdo_show(RRR/ROtlastnamet firstnamettitlet save_faxnumtfaxnumtokR&t save_notesR@t new_groupstgtanst add_groupR3((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_edit!s’                   " c Cs9|j|dtƒ}|sdS|jj|ƒ}g}dGHxp|D]h}|jdƒsCtjd|ddƒ\}}nqC|s•tjdƒGHdS|rC|j |ƒqCqCWd GHxft r|j d dtd t ƒ}|j ƒd krütjdƒGHdS|j ƒs Pn|j |ƒq·W|jj ||ƒd GHdS(sQ Edit a group. editgrp [group] modifygrp [group] R-Ns Existing Names in Group: R?sShould '%s' stay in this group RUs*(y=yes* (stay), n=no (leave), c=cancel) ? R's Add New Names to Group: RR.R&((R5RVR RRR9RRWR R*RXR(R0R)t update_groups( RRRSt old_entriest new_entriesRORaReR/((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt do_editgrp®s6   cCs¤|j|dtƒ}|sdStjd|ƒGHd}d}d}x¦trëttjdƒƒjƒ}|jƒdkr‹tjdƒGHdS|s¤tjdƒqFnt}x1|D])}|d kr±tjd ƒt }Pq±q±W|rFPqFqFWttjd ƒƒjƒ} | jƒjƒdkr1tjdƒGHdSg} |j j ƒ} xtrcttjd ƒƒjƒ} | jƒdkrŽtjdƒGHdS| s˜Pn| d kr¸tjdƒGHqIn| | kr4tj dƒxKtrttjdƒƒjƒjƒ} | dkrtjdƒqÔnPqÔW| dkr4qIq4n| | krStjdƒqIn| j | ƒqIW| j d ƒ|j j|||||| | ƒ|j|ƒdS(sD Add an name. add [name] new [name] R-Ns Enter information for %s: RsFax Number (c=cancel) ? R&R'sFax number must not be empty.s0123456789-(+) *#sQInvalid characters in fax number. Fax number may only contain '0123456789-(+) *#'sNotes (c=cancel) ? s,Member of group (=done*, c=cancel) ? R1sCannot specify 'All'.sGroup not found.s%Is this a new group (y=yes*, n=no) ? tntys1Please enter 'y', 'n' or press for 'yes'.sTGroup already specified. Choose a different group name or press to continue.(RRlRm(R0R(R RRRR)R*R$RVR R2RYRXRZR[(RRR/R^R]R\R`RaR&R@RAR3Rft user_input((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_addàsp          !       "cCsª|j|dtƒ}|sdSg}xftr|jddtdtƒ}|jƒdkrmtjdƒGHdS|jƒs}Pn|j|ƒq(W|jj ||ƒdGHdS(sL Add a group. addgrp [group] newgrp [group] R-NRR.R&R'(( R5R(R0RVR)R R*RXR Rh(RRRStentriesR/((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt do_addgrpJs  cCsÊ|jjƒ}tj|ƒtjdƒGHt|ƒdkrÁtjƒ}d |_x`t |j ƒƒD]L\}}|j dƒsd|j ||d|d d j |d ƒfƒqdqdW|jƒndGHd S(s2 View all name data. view s View all Data: iR=tFaxR>sMember of Group(s)R?R R@s, RAN(sNameRrsNotessMember of Group(s)((R RBR RCRRDRRERFRGRHR9RIRJRK(RRRLRMRNRO((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_viewgs   5 cCsÐ|j|dtƒ}|sdS|jj|ƒ}|rºtjƒ}d|_|jd|fƒ|jd|dfƒ|jd|d fƒ|jd d j|d ƒfƒ|j ƒn t j d ƒdGHdS(sW Show a name (all details). show [name] details [name] R-NtKeytValuesName:s Fax Number:R sNotes:R@sMember of Group(s):s, RAs:Name not found. Use the 'names' command to view all names.(RtRu(( R0RVR R+RRERFRIRJRKR R$(RRRNRORM((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyR[s     cCs8|j|dtƒ}|sdS|jj|ƒdGHdS(sE Remove a name. rm [name] del [name] R-N((R0RVR tdelete(RRR/((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_rms cCs8|j|dtƒ}|sdS|jj|ƒdGHdS(sN Remove a group. rmgrp [group] delgrp [group] R-N((R5RVR t delete_group(RRRS((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_rmgrp¬s cCstjttƒdS(s About fab.N(Rt log_titlet __title__t __version__(RR((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytdo_about¼scCsÀ|jƒjƒ}|s)tjdƒdS|d}t|ƒdkrX|djƒ}nd}|dkrtjd |ƒdStjj|ƒs¦tjd |ƒdS|dkr4tjj |ƒdjƒ}|d krãd}q4|d krød}q4t |d ƒj dƒjƒ}d|kr+d}q4d}n|dkrdd|GH|j j |ƒ\}}n0|dkr”d|GH|j j|ƒ\}}n|sªtj|ƒn |jdƒdGHdS(s] Import LDIF import [type] [type] = vcf|ldif|auto s+You must specify a filename to import from.NiitautotldiftvcftvcardsInvalid type: %ssFile %s not found.s.vcfs.ldiftris begin:vcardsImporting from LDIF file %s...sImporting from VCF file %s...R(R~RR€R(RR€((RR8R R$RDR)tostpathtexiststsplitexttopentreadR t import_ldift import_vcardR(RRtfilenamettyptexttheadRat error_str((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyt do_importÀsD                ('t__name__t __module__RRRRRRRRR R"R#R%R(RVR0R5Rtdo_dirR:R;Rgt do_modifyRkt do_modifygrpRotdo_newRqt do_newgrpRsR[t do_detailsRwtdo_delRyt do_delgrpR}R(((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pyR,sF          05    Š / g      thandle_device_printertqt3sU%s GUI mode requires GUI support (try running with --qt4). Entering interactive mode.sU%s GUI mode requires GUI support (try running with --qt3). Entering interactive mode.s hp-fab(qt3)(tFaxAddrBookForms,Unable to load Qt3 support. Is it installed?ituitloctsystemsUsing system locale: %sR&tutf8t.s&Trying to load .qm file for %s locale.s hplip_%s.qmsName of .qm file: %ssUsing default 'C' localesUsing locale: %ssStarting GUI loop...i(t QApplication(t FABWindows,Unable to load Qt4 support. Is it installed?s hp-fab(qt4)(R s1Fax address book disabled - Python 2.3+ required.s User exit.RsDone.(XR|R{t__mod__t__doc__RtgetoptRƒtbase.gtbaseRRRtbase.sixext.movesRRRtModuleR,tGUI_MODEtINTERACTIVE_MODEtUI_TOOLKIT_QT3tUI_TOOLKIT_QT4tmodtsetUsagetUSAGE_FLAG_NONEt parseStdOptsRVtoptst device_urit printer_nametmodet ui_toolkitRŸtcanEnterGUIModeR R$tcanEnterGUIMode4t set_moduletqttui.faxaddrbookformRt ImportErrortsystexittapptaddrbookR£targvt user_confR+R)tstrt QTextCodectlocaleRCROR8tlRTRJt ValueErrort QTranslatorttranstqm_filetloadtproptlocalization_dirtloadedtinstallTranslatortQLocalet setDefaultt setlocaletLC_ALLt normalizetErrortshowt setMainWidgett exec_looptKeyboardInterruptt PyQt4.QtGuit ui4.fabwindowR¤tfabtexec_R tconsoletcmdlooptinfo(((sS/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/fab.pytsÌ    ÿÿÐ $