예제 #1
0
def lastSnapshotPath(args):
    """
    Command for printing the path of the very last snapshot in
    current profile.

    Args:
        args (argparse.Namespace):
                        previously parsed arguments

    Raises:
        SystemExit:     0
    """
    force_stdout = setQuiet(args)
    cfg = getConfig(args)
    _mount(cfg)
    sid = snapshots.lastSnapshot(cfg)
    if sid:
        if args.quiet:
            msg = '{}'
        else:
            msg = 'SnapshotPath: {}'
        print(msg.format(sid.path()), file=force_stdout)
    else:
        logger.error("There are no snapshots in '%s'" % cfg.profileName())
    if not args.keep_mount:
        _umount(cfg)
    sys.exit(RETURN_OK)
예제 #2
0
def lastSnapshotPath(args):
    """
    Command for printing the path of the very last snapshot in
    current profile.

    Args:
        args (argparse.Namespace):
                        previously parsed arguments

    Raises:
        SystemExit:     0
    """
    force_stdout = setQuiet(args)
    cfg = getConfig(args)
    _mount(cfg)
    sid = snapshots.lastSnapshot(cfg)
    if sid:
        if args.quiet:
            msg = '{}'
        else:
            msg = 'SnapshotPath: {}'
        print(msg.format(sid.path()), file=force_stdout)
    else:
        logger.error("There are no snapshots in '%s'" % cfg.profileName())
    if not args.keep_mount:
        _umount(cfg)
    sys.exit(RETURN_OK)
예제 #3
0
def lastSnapshot(args):
    """
    Command for printing the very last snapshot in current profile.

    args:   argparse.ArgumentParser instance
    """
    force_stdout = setQuiet(args)
    cfg = getConfig(args)
    _mount(cfg)
    sid = snapshots.lastSnapshot(cfg)
    if sid:
        print('SnapshotID: %s' % sid, file=force_stdout)
    else:
        logger.error("There are no snapshots in '%s'" % cfg.get_profile_name())
    _umount(cfg)
    sys.exit(RETURN_OK)
예제 #4
0
def lastSnapshot(args):
    """
    Command for printing the very last snapshot in current profile.

    args:   argparse.ArgumentParser instance
    """
    force_stdout = setQuiet(args)
    cfg = getConfig(args)
    _mount(cfg)
    sid = snapshots.lastSnapshot(cfg)
    if sid:
        print('SnapshotID: %s' % sid, file=force_stdout)
    else:
        logger.error("There are no snapshots in '%s'" % cfg.get_profile_name())
    _umount(cfg)
    sys.exit(RETURN_OK)
예제 #5
0
    global qapp
    qapp = qttools.createQApplication(cfg.APP_NAME)
    translator = qttools.translator()
    qapp.installTranslator(translator)

    #########################
    ### Snapshot Log View ###
    #########################

    cmd = ['../backintime/common/backintime', '--config', cfgFile, 'backup']
    proc = subprocess.Popen(cmd)
    proc.communicate()

    mainWindow = app.MainWindow(cfg, appInstance, qapp)
    log = LogViewDialog(mainWindow, snapshots.lastSnapshot(cfg))
    setScreenshotTimer(log, '_images/snapshot_log_view.png')

    #####################
    ### Last Log View ###
    #####################

    log = LogViewDialog(mainWindow)
    setScreenshotTimer(log, '_images/last_log_view.png')

    sn.remove(snapshots.lastSnapshot(cfg))

    #############################
    ### create fake snapshots ###
    #############################
예제 #6
0
 def test_lastSnapshots(self):
     self.assertIsNone(snapshots.lastSnapshot(self.cfg))
예제 #7
0
 def test_lastSnapshot(self):
     self.assertEqual(snapshots.lastSnapshot(self.cfg),
                      '20151219-040324-123')
예제 #8
0
 def test_lastSnapshots(self):
     self.assertIsNone(snapshots.lastSnapshot(self.cfg))
예제 #9
0
 def test_lastSnapshot(self):
     self.assertEqual(snapshots.lastSnapshot(self.cfg),
                      '20151219-040324-123')
예제 #10
0
    global qapp
    qapp = qttools.createQApplication(cfg.APP_NAME)
    translator = qttools.translator()
    qapp.installTranslator(translator)

    #########################
    ### Snapshot Log View ###
    #########################

    cmd = ['../backintime/common/backintime', '--config', cfgFile, 'backup']
    proc = subprocess.Popen(cmd)
    proc.communicate()

    mainWindow = app.MainWindow(cfg, appInstance, qapp)
    log = LogViewDialog(mainWindow, snapshots.lastSnapshot(cfg))
    setScreenshotTimer(log, '_images/snapshot_log_view.png')

    #####################
    ### Last Log View ###
    #####################

    log = LogViewDialog(mainWindow)
    setScreenshotTimer(log, '_images/last_log_view.png')

    sn.remove(snapshots.lastSnapshot(cfg))

    #############################
    ### create fake snapshots ###
    #############################