HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/libreoffice/program/wizards/common/FileAccess.pyc
�
�\Ofc@s6ddlZddlmZdefd��YZdS(i����N(tsept
FileAccesscBsFeZd�Zed��Zed��Zed��Zed��Zedd��Z	ed��Z
ed��Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zed��Zedd��Zed��Zed��Zed��Zed��ZRS(cCs(|jd�|_|jd�|_dS(Ns$com.sun.star.ucb.FileContentProviders!com.sun.star.ucb.SimpleFileAccess(tcreateInstancetfilenameConvertert
xInterface(tselftxmsf((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyt__init__$scCs|jd�r|d S|SdS(Nt/i����(tendswith(Rt_sPath((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytdeleteLastSlashfromUrl+scCsdyAd}|jd�}tt||��}|j|�}|SWntk
r_tj�dSXdS(Ntscom.sun.star.util.PathSettings(RtstrtgetattrRt	Exceptiont	tracebackt	print_exc(RtxMSFtsPathtxSimpleFileAccesst
ResultPathR((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyt
getOfficePath<s

cCs\t}y|jd�}d}d	}|jd�}	|j|d�}
|j|d�}|j|d�}t|d�s�||}nt|d�s�||}n||
f}|j�dkr�|
}t}n:x7|D]/}
|
|}|	j|�r�|
}t}Pq�q�W|j|�}Wn!tk
r?t	j
�d}nX|sXt|d��n|S(
Nscom.sun.star.util.PathSettingsRs!com.sun.star.ucb.SimpleFileAccesst	_writablet	_internalt_usert__dict__tuser((tFalseRtgetPropertyValuethasattrtlowertTruetexistsRRRRtNoValidPathException(RRRtsTypet
sSearchDirtbexiststxPathInterfaceRt	ReadPathst
xUcbInterfacetTemplate_writabletTemplate_internalt
Template_usertittmpPath((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetOfficePath2UsF		





	




cCsst}d}y,|jd�}||}|j|�}Wntk
rVtj�dSX|sot|d��n|S(NRs!com.sun.star.ucb.SimpleFileAccess(RRR!RRRR"(RRt_sFirstPatht_sSecondPathR%t
ReturnPathR(((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytcombinePaths�s	


cCs|g}yT|jd�}|jd�}|j|t�}|dksQ|dkrZd}n
|d7}i}	x�|D]�}
|j|
�}|dks�|j|�rq|j|
t��|dkr�|j}n(|j|kr�||j}n	|j}|
|	|<qqqqWt	|	j
��}
g}x|
D]}
|j|	|
�q$W|j|
�|j|�Wntk
rwt
j�nX|S(Ns(com.sun.star.document.DocumentPropertiess!com.sun.star.ucb.SimpleFileAccessRt-(RtgetFolderContentsRtNonetgetFilenamet
startswithtloadFromMediumttupletTitletsortedtkeystappendRRR(RRt
FilterNamet
FolderNametresDicttlocLayoutFilest
xDocInterfaceRtnameListt
locLayoutDictR,tfileNamettitletkeysListt
valuesList((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetFolderTitles�s<			

	


cCsK|jd�s|d7}n|jd�r=|jd�}n||}|S(NRi(tendsWitht
startsWitht	substring(RR
t_sPath2tsNewPath((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytaddPath�s

cCs]d}y5|jd�}g}|j||�|j�}Wntk
rXtj�nX|S(NRs(com.sun.star.document.DocumentProperties(RR8tgetTitleRRR(RRt_sFiletsTitleRBtnoArgs((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyRP�s	
cCs?d}|dk	r+|dk	r+d|}n|jj||�S(NRR(R5RtgetSystemPathFromFileURL(Rt	parentURLtchildURLtstring((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetPath�s

	cCs=y|jj||�tSWntk
r8tj�nXtS(N(RtcopyR RRRR(Rtsourcettarget((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyRY�s
cCs6y|jj|�SWntk
r1tj�nX|S(N(RR!RRR(Rtfilenametdefault((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyR!�s

cCs6y|jj|�SWntk
r1tj�nXtS(N(RtisFolderRRRR(RR\((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytisDirectory�s

cCs6y|jj|�SWntk
r1tj�nXdS(N(RtgetDateTimeModifiedRRRR5(Rturl((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetLastModified�s

cCs:y|jj|�tSWntk
r5tj�nXtS(N(RtkillR RRRR(RR\((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytdelete�s
cCs<y|jj||�SWntk
r4tj�nXdgS(NR(RR4RRR(RtfoldertincludeFolders((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyt	listFiless

cCs:y|jj|�tSWntk
r5tj�nXtS(N(RtcreateFolderR RRRR(Rts((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytmkdirs
cCs0|j||d�}|j|�r(|SdSdS(NR(t
getNewFileRjR5(Rt	parentDirtnameRi((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytcreateNewDirscCs7y|jj|�SWntk
r2tj�dSXdS(Ni����(RtgetSizeRRR(RRa((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyRo s


cCsdd}d}xQtr_|j|||�}|j||�}|j|t�sRPn|d7}qW|S(NiRi(R R\tgetURLR!(RRlRmt	extensionR,RaR\((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyRk's	cCsAt|�dkr/|ddkr/||}n|d|}|S(NiR(tlen(RRUt	childPathtpath((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyRp2s"
cCs|j|t�S(N(R6t
FileSeparator(RRt((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetPathFilename=sRcCs|j|�dS(Ni����(tsplit(RRtt
pathSeparator((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyR6AscCs2x|ddkr |d }qW||jd� S(Ni����R(trfind(RRa((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetParentDirIscCsLd}|}|jd�s$d}n|jd�r@|d}n|||S(NRRi(R	R7(Rt	urlFolderturlFilenametstringFoldertstringFileName((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytconnectURLsOs	
cCs]|jd�}|dkrdSx7trX||d}|jd�}|dkr"Pq"q"W|S(Nt.i����Ri(tfindR (RR\tp((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pytgetExtension[s	cCs:||dkrdn	t|�|dkr1dnd|S(NiRR�(R
(RRmtextR,((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyR\hsN(t__name__t
__module__RtclassmethodRRR.R2R5RIRORPRXRYR!R_RbRdRgRjRnRoRkRpRvR6RzRR�R\(((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyR"s8	++							
					
(RtosRRutobjectR(((s;/usr/lib64/libreoffice/program/wizards/common/FileAccess.pyt<module>s