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oZpd@jqeoe=gƒZ,Wn,erk r¼e,Zod@jqe,e=gƒZ,nXe4jmdAe,ƒeseƒZtdBeoZue4jmdCeuƒetjveuewjxƒZyeyr ebjzetƒnd>Z,ne,d>krEe4jmdDƒnde4jmdEe,ƒe{j|e{e,ƒƒe,ew_ly elj}elj~elje,ƒƒWnelj<k r¨nXye_j€dFge(e)ƒZWn+e<k ròe4j5dGƒej6dƒnXebj‚eƒejƒƒebj„ƒe4j9dHƒe4j9dIƒdS(Js3.3s hp-unloadsPhoto Card Access Utilitys¹Access inserted photo cards on supported HPLIP printers. This provides an alternative for older devices that do not support USB mass storage or for access to photo cards over a network.iÿÿÿÿN(t*(tdevicetutilsttuitmodule(tcupstConsolecBseZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zed„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!dd „Z"d!„Z#d"„Z$d#„Z%d$„Z&d%„Z'd&„Z(d'„Z)d(„Z*d)„Z+RS(*cCsztjj|ƒd|_||_|jjƒ}|d|_|jrWtjdƒntj d|jj ƒƒ|_ dS(Ns8Type 'help' for a list of commands. Type 'exit' to quit.isPhoto card is write protected.s pcard: %s > ( tcmdtCmdt__init__tintrotpctinfot write_protecttlogtwarningtboldtpwdtprompt(tselfR t disk_info((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyR ;s    cCs |jGHdS(s/Print a list of commands that have been enteredN(t_hist(Rtargs((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_histFscCsdS(sExits from the consoleiÿÿÿÿ((RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_exitJscCsdS(sExits from the consoleiÿÿÿÿ((RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_quitNscCs |j|ƒS(s$Exit on system end of file character(R(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_EOFSscCstjj||ƒ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((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyRWscCs/tjj|ƒg|_i|_i|_dS(sInitialization before prompting user for commands. Despite the claims in the Cmd documentaion, Cmd.preloop() is not a stub. N(RRtpreloopRt_localst_globals(R((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyR`s  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((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyRiscCs|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((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytprecmdpscCs|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!((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytpostcmdxscCsdS(sDo nothing on empty input lineN((R((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyt emptyline~scCstjdƒGHdS(Ns9ERROR: Unrecognized command. Use 'help' to list commands.(RR(RR!((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdefault‚scCstjdƒdS(s List local directory contents.sls -lN(tostsystem(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_ldir…scCstjdƒdS(s List local directory contents.sls -lN(R'R((RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_lls‰scCs |j|ƒS(sSynonym for the ls command.(tdo_ls(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_dirscCs—|jƒjƒ}|jjt|ƒ}d}tjidd6dd6idd6dd6tjjd6idd6dd6fƒ}dGHtj |j dƒƒGHd}xd|jj ƒD]S}|ddkrâ|j |dddfƒGHq®|j |ddddfƒGHq®Wxg|jj ƒD]V}|j |dtj |dƒ|jj|dƒfƒGH|d7}||d7}qWtj d|tj |tƒfƒGHdS(s#List photo card directory contents.iitwidthitmargini t alignmentitNametSizetTypet.s..tt directoryt/is % d files, %sN((R0R1R2(R3s..(R tlowerR tlstTrueRt TextFormattertRIGHTRRtcomposetcurrent_directoriest current_filest format_bytest classify_file(RRtfilest total_sizet formattert num_filestdtf((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyR+‘s&#8 cCsU|jjƒ}|jƒjƒdkr9tj|ƒ}ntj|ƒ}d|GHdS(sgDisplay free space on photo card. Options: -h Display in human readable format s-hsFreespace = %s BytesN(R tdfR R7RR?tcommafy(RRt freespacetfs((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_df±s cCs•|jƒjƒ}|jj|ƒ}t|ƒdkr>dGHnS|jj|||j|jƒ\}}tj dt j |ƒ||d|fƒGHdS(s Copy files from photo card to current local directory. Usage: cp FILENAME(S)|GLOB PATTERN(S) Example: Copy all JPEG and GIF files and a file named thumbs.db from photo card to local directory: cp *.jpg *.gif thumbs.db isERROR: File(s) not found.s$ %s transfered in %d sec (%d KB/sec)iN( R R7R t match_filestlent cp_multipletcp_status_callbacktrm_status_callbackRRRR?(RRtremove_after_copyt matched_filesttotaltdelta((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_cpÀs 'c Cs+|jƒjƒjƒ}t}d|krP|jjrGtjdƒdSt}n|jj ƒ}dGHt |ƒdkr"d|kr±d}x'|D]}t |t |dƒƒ}qWt j i|dd6dd6id d6dd6t j jd 6id d6dd6fƒ}dGHtj|jdƒƒGHd}xZ|D]R}|jd|dt j|dƒd|d|dffƒGH||d7}q.Wtjdt |ƒt j|tƒfƒGHq'tjdt |ƒƒGH|jj||j|j|ƒ\}}} tjdt j|ƒ||d|fƒGHndGHdS(sþUnload all image files from photocard to current local directory. Note: Subdirectories on photo card are not preserved Options: -x Don't remove files after copy -p Print unload list but do not copy or remove filess-xs.Photo card is write protected. -x not allowed.Nis-piR-R.i R/R0R1R2s%sis%s/%sisFound %d files to unload, %ssUnloading %d files...s" %s unloaded in %d sec (%d KB/sec)is&No image, audio, or video files found.(((sNamesSizesType(R7R tsplittFalseR R RterrorR9tget_unload_listRMtmaxRR:R;RR<R?tunloadRORP( RRt dont_removet unload_listtmax_lentuRCRSRTt was_cancelled((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyt do_unloadÓs:       >-*/cCsE|dkr&dGHtjd|ƒGHnd||tj|ƒfGHdS(Nis Copying %s...s Copied %s to %s (%s)...((RRRR?(Rtsrcttrgtsize((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyRO s cCs d|GHdS(NsRemoving %s...((RRb((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyRPscCs|jjrtjdƒdS|jƒjƒ}|jj|ƒ}t|ƒdkr[dGHn$x!|D]}|jj|t ƒqbW|jj ƒdS(sRemove files from photo card.s.Photo card is write protected. rm not allowed.NisERROR: File(s) not found.( R R RRXR R7RLRMtrmRWR8(RRRRRF((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_rms   cCs1|jjrtjdƒdS|j|tƒdS(sMove files off photocards.Photo card is write protected. mv not allowed.N(R R RRXRUR9(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_mv's  cCstjƒGHdS(s.Print name of local current/working directory.N(R'tgetcwd(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_lpwd.scCsHytj|jƒƒWntk r8tjdƒGHnXtjƒGHdS(s'Change current local working directory.sERROR: Directory not found.N(R'tchdirR tOSErrorRRRh(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_lcd2s  cCs|jjƒGHdS(sOPrint name of photo card current/working directory Usage: >pwdN(R R(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_pwd:scCsñ|jƒjƒ}|dkrF|jjƒdkrÎ|jjƒqÎnˆ|dkrUny|dkrt|jjdƒnZ|jj|ƒ}t|ƒdkr dGHn.t|ƒdkrºdGHn|jj|dƒtj d|jjƒƒ|_ d S( sªChange current working directory on photo card. Note: You may only specify one directory level at a time. Usage: cd s..R6R3isDirectory not foundis'Pattern matches more than one directorys pcard: %s > N( R7R R Rtcduptcdt match_dirsRMRRR(RRt matched_dirs((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_cd@s   cCs|jdƒdS(sChange to parent directory.s..N(Rr(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_cdupascCs-|jƒjƒ}|dkr1|jjtƒnø|dkrP|jjtƒnÙ|jjƒr$|jjƒ}t|j ƒƒ}|j ƒd GHx!|D]}d|||fGHq–Wt j dt jt|ƒdƒt jtjdƒfƒGHt j dt jt|ƒƒt jtjƒfƒGHndGHdS( sœDisplay current cache entries, or turn cache on/off. Usage: Display: cache Turn on: cache on Turn off: cache off tontoffssector %d (%d hits)s"Total cache usage: %s (%s maximum)isTotal cache sectors: %s of %ss Cache is off.N((R R7R t cache_controlR9RWt cache_statet cache_infotlisttkeystsortRRRR?RMt photocardt MAX_CACHERH(RRRxttts((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_cacheis    ;6cCs}|jƒjƒ}t}yt|ƒ}Wntk rAdGHdSX|jj|ƒdkrbdGHnt|jj|ƒƒGHdS(sIDisplay sector data. Usage: sector s$Sector must be specified as a numberNis Cached sector( R R7RWtintt ValueErrorR t cache_checktreprtsector(RRtcachedR…((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyt do_sector‡s cCs%|jjƒ}dGH|j|ƒdS(s"Display photo card directory tree.N((R ttreet print_tree(RRRˆ((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_treešsicCskxd|D]\}t||ƒtiƒkrdjd|d|dgƒGH|j|||dƒqqWdS(NR4t iR6i(ttypetjoinR‰(RRˆtlevelRE((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyR‰ s cCs|jjƒdS(sReset the cache.N(R t cache_reset(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_reset§scCsädGHd|jjjGHd|jjjGHd|jjƒGH|jjƒ}d|dGHd|dGHd|d GHd |d GHd |d GHd|dGHd|dGHd|dGHd|dGHdtjt|jj ƒƒƒGHdS(sPrint info about photocard.sDevice URI = %ss Model = %ssWorking dir = %ss OEM ID = %sisBytes/sector = %disSectors/cluster = %disReserved sectors = %disRoot entries = %disSectors/FAT = %disVolume label = %sisSystem ID = %sisWrite protected = %disCached sectors = %sN(( R Rt device_uritmodel_uiRR RRHRMRx(RRR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_card¬s         cCsÒ|jƒjƒ}|jj|ƒ}t|ƒdkr¯|jj|ƒjdƒd}|dkr§tjƒ\}}|jj ||ƒt j d|ƒt j |ƒqÎdGHnt|ƒdkrÉdGHndGHd S( sMDisplay an image with ImageMagick. Usage: display iR6itimages display %ssFile is not an image.sFile not found.s5Only one file at a time may be specified for display.N( R R7R RLRMR@RVRtmake_temp_filetcpR'R(tremove(RRRRttyptfdt temp_name((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyt do_display¿s cCs|j|ƒdS(s Synonym for the display command.N(R›(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_showÙsc Cs–|jƒjƒ}|jj|ƒ}t|ƒdkrs|jj|ƒjdƒ\}}|dkrk|dkrk|jj|ƒ}tj j|ƒ\}}tj j |ƒ\}} d|kr t j ƒ\} } t | dƒj|dƒtjd| ƒtj| ƒqpd |krct j ƒ\} } t | dƒj|d ƒtjd| ƒtj| ƒqpd GHq’d GHnt|ƒd krd GHndGHdS(s½Display an embedded thumbnail image with ImageMagick. Note: Only works with JPEG/JFIF images with embedded JPEG/TIFF thumbnails Usage: thumbnail iR6R”tjpegttifft JPEGThumbnailtwbs display %st TIFFThumbnailsNo thumbnail found.s"Incorrect file type for thumbnail.isFile not found.s?Only one file at a time may be specified for thumbnail display.N(RRž(R R7R RLRMR@RVtget_exifR'tpathtsplitextRR•topentwriteR(R—( RRRRR˜tsubtypt exif_infotdir_namet file_namet photo_namet photo_extt temp_file_fdttemp_file_name((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyt do_thumbnailÝs.!  cCs|j|ƒdS(s"Synonym for the thumbnail command.N(R¯(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_thumbsc CsT|jƒjƒ}|jj|ƒ}t|ƒdkr1|jj|ƒjdƒ\}}|dkr)|dkr)|jj|ƒ}tj idd6dd 6idd6dd 6fƒ}dGHt j |j dƒƒGHt |jƒƒ}|jƒxA|D]1}|dkrñ|j |d||fƒGHqñqñWqPdGHnt|ƒdkrKdGHndGHdS(sCDisplay EXIF info for file. Usage: exif iR6R”RRži(R-iR.tTagtValueRŸR¡tFilenames%ss"Incorrect file type for thumbnail.isFile not found.s?Only one file at a time may be specified for thumbnail display.N(sjpegstiff((R±R²(s JPEGThumbnails TIFFThumbnailR³(R R7R RLRMR@RVR¢RR:RRR<RyRzR{( RRRRR˜R§R¨RCteete((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_exif s(!   &cCs|j|ƒdS(sSynonym for the exif command.N(R¶(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_info2scCstjttƒdS(N(Rt log_titlet __title__t __version__(RR((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytdo_about6s(,t__name__t __module__R RRRRRRRR"R$R%R&R)R*R,R+RKRWRURaRORPRfRgRiRlRmRrRsR€R‡RŠR‰RR“R›RœR¯R°R¶R·R»(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyR9sR               6        !          )  ( cCsE|dkr&dGHtjd|ƒGHnd||tj|ƒfGHdS(Nis Copying %s...s Copied %s to %s (%s)...((RRRR?(RbRcRd((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pytstatus_callback:s t extra_optionssOutput directory:sV-o or --output= (Defaults to current directory)(Only used for non-GUI modes)toptiont see_also_lists hp-toolboxtosoutput=(R|s-os--outputtqt4sA%s does not support Qt4. Please use Qt3 or run in -i or -n modes.itfilters pcard-typesUsing device : %s s%Unable to start photocard session: %sskUnable to mount photo card on device. Check that device is powered on and photo card is correctly inserted.s Photocard on device %s mounteds4DO NOT REMOVE PHOTO CARD UNTIL YOU EXIT THIS PROGRAMs%ERROR: Output directory %s not found.sAborted.sAn error occured: %ssOutput directory is %siiR-R.i R/R0R1R2s%ss%s/%sisFound %d files to unload, %s sUnloading files... s" %s unloaded in %d sec (%d KB/sec)is User exit(t unloadforms,Unable to load Qt3 support. Is it installed?slastWindowClosed()squit()tuitlocR(sUsing system locale: %stctutf8R3s&Trying to load .qm file for %s locale.s hplip_%s.qmsName of .qm file: %ssUsing default 'C' localesUsing locale: %sRsEUnable to connect to HPLIP I/O. Please (re)start HPLIP and try again.R4sDone.(…Rºt__mod__R¹t__doc__tsysR'tos.pathtgetopttreRttimetfnmatchtstringtoperatortreadlinet ImportErrortbase.gtbaseRRRRtprntRRRR¾tModuletNonetGUI_MODEtINTERACTIVE_MODEtNON_INTERACTIVE_MODEtUI_TOOLKIT_QT3RWR9tmodtsetUsagetUSAGE_FLAG_DEVICE_ARGSt parseStdOptstoptsR‘t printer_nametmodet ui_toolkitRÇtpcardR|Rht output_dirRÂtatcanEnterGUIModeRRXtexitt getDeviceUriteqR t PhotoCardR tErrorRµtmsgt set_callbacktupdate_spinnertmounttumountRR£trealpathtnormpatht expanduserRjRktconsoletcmdlooptKeyboardInterruptt ExceptionRYR]RMR^R_RZR:R;RCR<RSR?R[RTR`tqtRÆRÅt QApplicationtargvtapptQObjecttconnecttSIGNALtSLOTt user_conftgetR7tstrt QTextCodectlocaletdebugRVtltxRR‚t QTranslatorttranstqm_filetloadtproptlocalization_dirtloadedtinstallTranslatortQLocalet setDefaultt setlocaletLC_ALLt normalizet UnloadFormtwt setMainWidgettshowt exec_loop(((sV/builds/ul11u3sru-gate/components/hplip/build/prototype/i386/usr/share/hplip/unload.pyts2            " ÿÿ   '             *        >*!3    "