mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
Compress data files with bzip2
This commit is contained in:
@@ -16,6 +16,7 @@ import subprocess
|
|||||||
import httplib, urllib
|
import httplib, urllib
|
||||||
import socket
|
import socket
|
||||||
import glob
|
import glob
|
||||||
|
import bz2
|
||||||
|
|
||||||
SCRIPT_NAME = os.path.basename(sys.argv[0])
|
SCRIPT_NAME = os.path.basename(sys.argv[0])
|
||||||
|
|
||||||
@@ -75,9 +76,9 @@ class TimedFile(object):
|
|||||||
'''File wrapper that records write times in separate file.'''
|
'''File wrapper that records write times in separate file.'''
|
||||||
|
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
mode = 'wb'
|
mode = 'w'
|
||||||
self.data_file = open(filename, mode)
|
self.data_file = bz2.BZ2File(filename, mode)
|
||||||
self.time_file = open(filename + '.time', mode)
|
self.time_file = bz2.BZ2File(filename + '.time', mode)
|
||||||
self.old_time = time.time()
|
self.old_time = time.time()
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
|
|||||||
Reference in New Issue
Block a user