コード例 #1
0
ファイル: base.py プロジェクト: akissa/sachannelupdate
def cleanup(dest, tardir, counterfile):
    """Remove existing rules"""
    thefiles = Queue()
    # dest directory files
    queue_files(dest, thefiles)
    # tar directory files
    queue_files(tardir, thefiles)
    while not thefiles.empty():
        d_file = thefiles.get()
        info("Deleting file: %s" % d_file)
        os.unlink(d_file)
    if os.path.exists(counterfile):
        info("Deleting the counter file %s" % counterfile)
        os.unlink(counterfile)
コード例 #2
0
ファイル: base.py プロジェクト: w3bservice/sachannelupdate
def cleanup(dest, tardir, counterfile):
    """Remove existing rules"""
    thefiles = Queue()
    # dest directory files
    queue_files(dest, thefiles)
    # tar directory files
    queue_files(tardir, thefiles)
    while not thefiles.empty():
        d_file = thefiles.get()
        info("Deleting file: %s" % d_file)
        os.unlink(d_file)
    if os.path.exists(counterfile):
        info("Deleting the counter file %s" % counterfile)
        os.unlink(counterfile)
コード例 #3
0
 def test_info(self, mock_print):
     msg = "This is a sample msg"
     info(msg)
     mock_print.assert_called_once_with(msg, file=sys.stdout)
コード例 #4
0
 def test_info(self, mock_print):
     msg = "This is a sample msg"
     info(msg)
     mock_print.assert_called_once_with(msg, file=sys.stdout)