~usb-creator-hackers/usb-creator/trunk

« back to all changes in this revision

Viewing changes to usbcreator/misc.py

  • Committer: Dmitrijs Ledkovs
  • Date: 2013-01-28 12:45:42 UTC
  • mfrom: (406.1.2 nexus7)
  • Revision ID: dmitrijs.ledkovs@canonical.com-20130128124542-2y05i9bb622d3uob
Support flashing devices using fastboot (e.g. Nexus7).

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
MAX_LOG_SIZE = 1024 * 1024 * 1
36
36
MAX_LOG_BACKUP = 0
37
37
 
 
38
EULA_STAMP = '.ubuntu-nexus7-installer.notice-accepted'
 
39
 
38
40
if sys.platform != 'win32':
39
41
    # TODO xnox 20121109 should not hard-code timeouts, instead should
40
42
    # do async dbus calls with a qt or glib main loop running.
78
80
        log.addHandler(handler)
79
81
    log.setLevel(logging.DEBUG)
80
82
 
 
83
def check_eula(save=False):
 
84
    eula_stamp = os.path.expanduser('~/' + EULA_STAMP)
 
85
    if save:
 
86
        with open(eula_stamp, 'w') as f:
 
87
            pass
 
88
    return os.path.isfile(eula_stamp)
 
89
    
81
90
def format_size(size):
82
91
    """Format a partition size."""
83
92
    # Taken from ubiquity's ubiquity/misc.py