KDE 5.0 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KBackup Namespace Reference

from PyKDE5.kcoreaddons.KBackup import *

Detailed Description


Functions

bool backupFile (QString filename, QString backupDir=QString())
bool numberedBackupFile (QString filename, QString backupDir=QString(), QString backupExtension=QString.fromLatin1("~"), long maxBackups=10)
bool rcsBackupFile (QString filename, QString backupDir=QString(), QString backupMessage=QString())
bool simpleBackupFile (QString filename, QString backupDir=QString(), QString backupExtension=QLatin1String("~"))

Function Documentation

bool backupFile ( QString  filename,
QString  backupDir=QString()
)

Function to create a backup file before saving.

If empty (the default), the backup will be in the same directory as filename. The backup type (simple, rcs, or numbered), extension string, and maximum number of backup files are read from the user's global configuration. Use simpleBackupFile() or numberedBackupFile() to force one of these specific backup styles. You can use this method even if you don't use KSaveFile.

Parameters:
filename  the file to backup
backupDir  optional directory where to save the backup file in.

Returns:
true if successful, or false if an error has occurred.

bool numberedBackupFile ( QString  filename,
QString  backupDir=QString(),
QString  backupExtension=QString.fromLatin1("~"),
long  maxBackups=10
)

Function to create a backup file for a given filename.

This function creates a series of numbered backup files from the given filename.

The backup file names will be of the form: <name>.<number><extension> for instance <pre> chat.3.log </pre>

The new backup file will be have the backup number 1. Each existing backup file will have its number incremented by 1. Any backup files with numbers greater than the maximum number permitted (@p maxBackups) will be removed. You can use this method even if you don't use KSaveFile.

Parameters:
filename  the file to backup
backupDir  optional directory where to save the backup file in. If empty (the default), the backup will be in the same directory as filename.
backupExtension  the extension to append to filename, which is "~" by default. Do not use an extension containing digits.
maxBackups  the maximum number of backup files permitted. For best performance a small number (10) is recommended.

Returns:
true if successful, or false if an error has occurred.

bool rcsBackupFile ( QString  filename,
QString  backupDir=QString(),
QString  backupMessage=QString()
)

Function to create an rcs backup file for a given filename.

This function creates a rcs-formatted backup file from the given filename.

The backup file names will be of the form: <name>,v for instance <pre> photo.jpg,v </pre>

The new backup file will be in RCS format. Each existing backup file will be committed as a new revision. You can use this method even if you don't use KSaveFile.

Parameters:
filename  the file to backup
backupDir  optional directory where to save the backup file in. If empty (the default), the backup will be in the same directory as filename.
backupMessage  is the RCS commit message for this revision.

Returns:
true if successful, or false if an error has occurred.

bool simpleBackupFile ( QString  filename,
QString  backupDir=QString(),
QString  backupExtension=QLatin1String("~")
)

Function to create a backup file for a given filename.

This function creates a backup file from the given filename. You can use this method even if you don't use KSaveFile.

Parameters:
filename  the file to backup
backupDir  optional directory where to save the backup file in. If empty (the default), the backup will be in the same directory as filename.
backupExtension  the extension to append to filename, "~" by default.

Returns:
true if successful, or false if an error has occurred.

  • Full Index

Modules

  • karchive
  • kcoreaddons
  • kguiaddons
  • kitemmodels
  • kitemviews
  • kplotting
  • kwidgetsaddons
  • solid
  • sonnet
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal