/usr/lib/rads/venv/lib/python3.13/site-packages/restic/__pycache__
NameSizeModeActions
base.cpython-313.pyc306980644editdlrm
data.cpython-313.pyc222580644editdlrm
exc.cpython-313.pyc79170644editdlrm
__init__.cpython-313.pyc8450644editdlrm
Edit: /usr/lib/rads/venv/lib/python3.13/site-packages/restic/__pycache__/data.cpython-313.pyc (22258B)
jOBSrSSKJrJrJrJr SSKrSSKJr SSK r SSK J r SSK Jr SSKJr SSKJr SS KJrJr SS KJr \(aS S KJr "S S\5r"SS\5r\"SS9"SS55r"SS5rS\S\4Sjr"SS5r \"SS9"SS55r!"SS\!5r""S S!\!5r#"S"S#5r$"S$S%\$5r%"S&S'\$5r&\S(r'\(\'\\)\\)\44r*\(\'\\)\$\)\%44r+g))zRestic dataclasses)LiteralUnion TypedDict TYPE_CHECKINGN)unquote)PurePath) Generator)datetime) dataclass)CompletedProcessrun)Proc)Resticcf\rSrSr%Sr\\S'\\S'\S\S'\ \S'\\S'\ \\4\S 'S r g ) SQLBackupGroupDictz+Return format of SQLBackupGroup.serialize()timeusermysqlpgsqltypefailoverfindbsN) __name__ __module__ __qualname____firstlineno____doc__int__annotations__strrbooldict__static_attributes__r>/usr/lib/rads/venv/lib/python3.13/site-packages/restic/data.pyrrs35 I I " ##N H c3hr)rcR\rSrSr%Sr\\S'\\S'\\S'\ S\S'\\S'S r g ) BackupDictz#Return format of Backup.serialize()rsnapr)homedirdirspkgacctrrrN) rrr r!r"r&r$r%r#rr(rr)r*r,r,s%-N I I . // Ir)r,T)initcF\rSrSr%SrSr\\S'\\S'\\S'\\S'Srg ) ResticRepo'zDataclass holding restic/S3 keys and bucket name Args: bucket(str): bucket name restic_pass(str): restic password access_key(str): S3 access key secret_key(str): S3 access key resticbucket restic_pass access_key secret_keyrN)rrr r!r"r%r$r(rr)r*r4r4's#J KOOr)r4c \rSrSrSrSrSSS\4SjrSrS\\ -S \ \ S 4S jr S\\ -S \ \ S S S 44S jrS S SS.S\ \\ -S -S\ \\ -S -S\\ -S S4SjjrS\\ -S S4SjrSSS.S\S\4SjjrSrg )Snapshot:ajRepresents a restic snapshot Attributes: restic (Restic): restic instance this snapshot was found in id (str): short snapshot ID tags (list[str]): tags supplied when the snapshot was created datetime (datetime.datetime): backup creation time timestamp (int): backup creation time paths (list[str]): top level paths the snapshot contains r6rdatac^Xl[US5UlURS/5Vs/sHn[ U[ 5PM snUl[R"US5Ul[URR55Ul [US5Ul gs snf)Nidtagsrpaths) r6r%r@get _tag_quote url_unquoterAr fromisoformatr# timestamplistrB)selfr6r>xs r*__init__Snapshot.__init__Hs d4j/040D 0D1Jq+ &0D  #+"8"8f"F T]]4467 $T'] 3  sB*c"SURS3$)Nz Snapshot<>)r@rIs r*__repr__Snapshot.__repr__Ts477)1%%r)pathreturnSnapFileSnapDirc4URRXS9$)aHReturns a list of files/dirs in this snapshot Args: path (str | PurePath): full path inside the snapshot to list the contents of Raises: ValueError: requested path was not a full path ResticError: Any error listing snapshot contents from restic Returns: list[SnapFile | SnapDir]: files or directories r.rR)r6listdirrIrRs r*rYSnapshot.listdirW {{"""88r)Nc4URRXS9$)aOIterates files/dirs in this snapshot Args: path (str | PurePath): full path inside the snapshot to list the contents of Raises: ValueError: requested path was not a full path ResticError: Any error listing snapshot contents from restic Yields: Generator[SnapFile | SnapDir, None, None]: files or directories rX)r6scandirrZs r*r^Snapshot.scandirir\r)/includesexcludestargetrbrcrd ResticCmdc6URRXX#S9$)aeCalls a ResticCmd to restore from this snapshot Args: includes (list[str | PurePath], optional): --include paths excludes (list[str | PurePath], optional): --exclude paths target (str | PurePath): base directory prefix to restore to. Defaults to '/', which restores to the original path Returns: ResticCmd: restic command executor ra)r6restore)rIrbrcrds r*rgSnapshot.restore{s%${{"" h#  r)filenamec8URRX5$)zCrafts a ResticCmd to dump a file from this snapshot Args: filename (str | PurePath): filename to retrieve Returns: ResticCmd: restic command executor )r6dump)rIris r*rk Snapshot.dumps{{//r)FTpruneno_limrnrocJURRURXS9$)aCRun restic forget on this snapshot Args: prune (bool): whether to automatically run prune if at least one snapshot was removed. Defaults to False no_lim (bool): do not CPU limit the command as it runs regardless of the lim arg in Restic Raises: ResticError: if the restic forget command fails rm)r6forgetr@)rIrnros r*rqSnapshot.forgets"{{!!$''!FFr))r r@rBr6rArG)rrr r!r"r'rKrPr%rrHrrYr r^rgrkr&rqr(rr)r*r<r<:s J 4( 4$ 4&9(N9 e)* +9$9(N9 5./t; <9*1504!$  sX~&- sX~&-  h    , 0S8^ 0 0',D Gt GT G Gr)r<tagrScVSUSS;aURSSS9up#USU"U53$U$)N:r)maxsplit)split)rsfuncprefixsuffixs r*rDrDs> c!Bi334<.)) Jr)c.\rSrSrSrSrSSjrS\4Sjr\R\RSSSSSS .S \ S-S \ S-S \ S-S \S-S\ S\ \ -S-S\ S\4SjjrSr\R\RSSS.S \ S-S \ S-S \ S-S\ S\4 SjjrSrg)rezReturn type of Restic's build() function. Can be cast to a str() to get a shell-escaped representation of the command. Attributes: .cmd (list[str]): Popen arguments r6cXlX lgNcmdr6)rIrr6s r*rKResticCmd.__init__s  r)rScB[R"UR5$r)shlexjoinrrOs r*__str__ResticCmd.__str__szz$((##r)NF)stdoutstderrstdininputchecktimeoutrorrrrrrroc JURSURRUUUSUS.5 UcX8S'OXHS'U(dURRc[ UR 40UD6$[ R"UR 4SURR0UD6$)aExecute the restic command and return a CompletedProcess Args: stdout (int | None): stdout redirection. Defaults to DEVNULL stderr (int | None): stderr redirection. Defaults to PIPE (because ResticError will need this if you raise it using the result) stdin (int | None): stdin redirection. Defaults to None input (bytes | str | None): text to send to stdin. Do not use the stdin= kwarg if you use input= timeout (int | float | None): optional command timeout check (bool): if set True, raise CalledProcessError on non-zero exit codes. Defaults to False no_lim (bool): do not CPU limit the command as it runs regardless of the lim arg in Restic Raises: CalledProcessError: program exited with a non-zero exit code and check=True was specified TimeoutExpired: program took too long to execute and timeout= was specified Returns: CompletedProcess: process results UTF-8F)encodingenvrrrshellrrrlim)updater6rrs_runrrr ) rIrrrrrrrokwargss r*r ResticCmd.runsH  #{{  "   =#7O#7O T[[__,,V, ,xx@dkkoo@@@r)c[RRURR5 [R "UR SUR 5 g)zWruns os.execv with the given restic args/env, replacing the current process with resticrN)osenvironrr6rexecvrrOs r*rResticCmd.execvs8 $++//* !dhh'r))rrrroc URSURRUUUSS.5 U(dURRc[ UR 4SS0UD6$[ UR 4SURR0UD6$)aStart and return the command Args: stdout (int | None): stdout redirection. Defaults to DEVNULL stderr (int | None): stderr redirection. Defaults to PIPE (because ResticError will need this if you raise it using the result) stdin (int | None): stdin redirection. Defaults to None no_lim (bool): do not CPU limit the command as it runs regardless of the lim arg in Restic Returns: cproc.Proc: Running process rF)rrrrrrNr)rr6rrrr)rIrrrrors r*procResticCmd.procs{,  #{{      T[[__,5d5f5 5DHH<$++//>'* *~~h''r)cUR$r)rRrOs r*rSnapPath.__str__Es yyr)r) rrr r!r"r<r$r%r#rrr(rr)r*rr+sZ#J   I I I H H *t(3( r)rc&\rSrSrSrSrSSjrSrg)rUiIaA remote file in a restic snapshot Attributes: snapshot (Snapshot): snapshot instance this file was found in restic (Restic): restic instance this file was found in name (str): base filename type (str): "file" path (str): full path uid (int): original UID of the file when backed up gid (int): original GID of the file when backed up mode (int | None): original file mode when backed up permissions (str | None): original file permissions when backed up r6c^URRURURS9$zaCrafts a ResticCmd to dump this file's contents Returns: ResticCmd: restic command executor )r.ri)r6rkrrRrOs r*rk SnapFile.dumpZs& {{T]]TYYGGr)rN)rSre)rrr r!r"rkr(rr)r*rUrUIs JHr)rUcV\rSrSrSrSrS\\S4SjrS\\SSS44Sjr S r g) rVica A remote directory in a restic snapshot Attributes: snapshot (Snapshot): snapshot instance this directory was found in restic (Restic): restic instance this directory was found in name (str): base directory name type (str): "dir" path (str): full path uid (int): original UID of the directory when backed up gid (int): original GID of the directory when backed up mode (int): original directory mode when backed up permissions (str | None): original directory permissions when backed up r6rSrTc^URRURURS9$)zList files/dirs found in this path Raises: ResticError: Any error listing snapshot contents from restic Returns: list[SnapFile | SnapDir]: files or directories rX)r6rYrrRrOs r*rYSnapDir.listdirt&{{"" DII"FFr)Nc^URRURURS9$)zIterates over files/dirs found in this path Raises: ResticError: Any error listing snapshot contents from restic Yields: Generator[SnapFile | SnapDir, None, None]: files or directories rX)r6r^rrRrOs r*r^SnapDir.scandirrr)r) rrr r!r"rHrrYr r^r(rr)r*rVrVcsG J Ge$9:; G G5)>#?t#KL Gr)rVcf\rSrSrSrSrS\4SjrS\4Sjr\S\S\ S\ 4S j5r S\ 4S jr S r g ) BackupiaObject representing a restic snapshot formatted in a way specific to backups3.x's backup-runner. Args: snap (Snapshot): snapshot from Restic.snapshots() Raises: KeyError: snapshot did not have required tags (created manually?) ValueError: __new__() tried to return a sql subclass, but its start: timestamp tag was invalid Returns: (Backup, SQLBackupGroup, SQLBackupItem): depending on the type of backups 3.x snapshot Attributes: snap (Snapshot): snapshot object failover (bool): whether this is a failover copy user (str): cPanel username or root type (str): mysql or pgsql time (int): creation timestamp r6r.c[RUS5S;aBSUR;a[R [ 5$[R [ 5$[R U5$)Nrrfinished)r get_labelrArrSQLBackupGroup SQLBackupItem)rr.s r*rBackup.__new__sQ   D& )-? ?TYY&~~n55>>-0 0~~c""r)cXlSUR;UlURUS5UlURUS5UlUR S;a![ URUS55UlgURUlg)Nrrrrstart) r.rArrrrr#rrG)rIr.s r*rKBackup.__init__sj "dii/ NN40 NN40 99* *DNN49:DIDIr)rrScUS3nURH0nURU5(dMURSS5Ss $ [U5e)zSearch for the value of a tag if read in the format 'name:value' Args: snap (Snapshot): snapshot object name (str): name to search for Raises: KeyError: if the label was not found Returns: str: the value portion of the 'name:value' tag rur)rA startswithrxKeyError)r.rrzrss r*rBackup.get_labelsN699C~~f%%yya(++tnr)cURRURURURUR S.nU$)z9Used internally by Restic.get_backups() if serialize=True)r.rrrr)r.r@rrrr)rIrets r* serializeBackup.serializes9IILLIIIIII   r))rr.rrrN)rrr r!r"r<rrK staticmethodr%rr'rr(rr)r*rrs[.J#8#'X'& 4 r)rcL^\rSrSrSrSrS\4U4SjjrS\4U4SjjrSr U=r $) riauHolds a group of SQL snapshots created by imh-backup-client, representing one sql backup run. Backups 3.x stores each database in its own snapshot, then artificially groups them together as one. Attributes: snap (Snapshot): snapshot object for the snapshot signifying the backup's completion. This snapshot contains no SQL data. See the ``.dbs`` attribute instead for that failover (bool): whether this is a failover copy user (str): cPanel username or root type (str): mysql or pgsql time (int): creation timestamp dbs (dict[str, SQLBackupItem]): database names mapped to SQLBackupItems r6r.c2>[TU]U5 0Ulgr)superrKrrIr. __class__s r*rKSQLBackupGroup.__init__s -/r)rSc>[TU]5nURS5US'URR 5VVs0sHup#X#R5_M snnUS'U$s snnf)5Used internally by Restic.get_backups(serialize=True)r.rr)rrpopritems)rIrkvrs r*rSQLBackupGroup.serializes\g!WWV_E 3788>>3CD3C41a&3CDE  EsA&)r) rrr r!r"r<rKrrr( __classcell__rs@r*rrs- J0X0-r)rcT^\rSrSrSrSrS\4U4SjjrS\4SjrS\ 4Sjr S r U=r $) ria&Represents one SQL snapshot in a ``SQLBackupGroup``. Attributes: snap (Snapshot): snapshot object failover (bool): whether this is a failover copy user (str): cPanel username or root type (str): mysql or pgsql time (int): creation timestamp dbname (str): database name r6r.cZ>[TU]U5 [RUS5Ulg)Ndbname)rrKrrrrs r*rKSQLBackupItem.__init__s$ &&tX6 r)rScrURRRURURS9$r)r.r6rkrrOs r*rkSQLBackupItem.dumps, yy$$$))dkk$JJr)c.URR$)r)r.r@rOs r*rSQLBackupItem.serializesyy||r))r) rrr r!r"r<rKrerkr'rr(rrs@r*rrs: J7X7KiK4r)r)rrr/r0r1),r"typingrrrrr urllib.parserrErpathlibrcollections.abcr r dataclassesr subprocessr r rcprocrrrr,r4r<r%rDrerrUrVrrr BakTypeStrr'rHUserBackupDicts UserBackupsrr)r*rsL;; / %!5 $nGnGbC#v=v=r :HxH4%Gh%GPHHVV<F>C D d:&-?(@@AA:uT&\43G%GHHI r)