<commit_before>export default class GoogleDrive {
    constructor({
        pickerCallback,
        developerKey,
        clientId,
        appId
    } = {}) {
        console.log('GoogleDrive constructor');
        this.pickerCallback = pickerCallback;
        this.pickerApiLoaded = false;
        this.scope = ['https://www.googleapis.com/auth/drive.file'];
        this.developerKey = developerKey;
        this.clientId = clientId;
        this.appId = appId;
    }

    loadPicker() {
        // load the google API library
        $.ajax({
            method: "GET",
            url: "https://apis.google.com/js/api.js",
            dataType: "script",
            cache: true,
            context: this
        }).done(function() {
            this.loadGapi();
        }.bind(this));
    }

    loadGapi() {
        // load auth and picker libraries
        if (!frappe.boot.user.google_drive_token) {
            gapi.load('auth', function() {
                console.log('gapi.load("auth") callback');
                this.onAuthApiLoad();
            }.bind(this));
        }

        gapi.load('picker', function() {
            console.log('gapi.load("picker") callback');
            this.onPickerApiLoad();
        }.bind(this));<commit_msg>fix: scope for google picker<commit_after>export default class GoogleDrive {
    constructor({
        pickerCallback,
        developerKey,
        clientId,
        appId
    } = {}) {
        console.log('GoogleDrive constructor');
        this.pickerCallback = pickerCallback;
        this.pickerApiLoaded = false;
        this.scope = ['https://www.googleapis.com/auth/drive.readonly'];
        this.developerKey = developerKey;
        this.clientId = clientId;
        this.appId = appId;
    }

    loadPicker() {
        // load the google API library
        $.ajax({
            method: "GET",
            url: "https://apis.google.com/js/api.js",
            dataType: "script",
            cache: true,
            context: this
        }).done(function() {
            this.loadGapi();
        }.bind(this));
    }

    loadGapi() {
        // load auth and picker libraries
        if (!frappe.boot.user.google_drive_token) {
            gapi.load('auth', function() {
                console.log('gapi.load("auth") callback');
                this.onAuthApiLoad();
            }.bind(this));
        }

        gapi.load('picker', function() {
            console.log('gapi.load("picker") callback');
            this.onPickerApiLoad();
        }.bind(this));
{'fraction_non_alphanumeric': 0.13709996048992493, 'fraction_numerical': 0.0, 'mean_word_length': 1.7080213903743315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7477955', 'n_tokens_mistral': 716, 'n_tokens_neox': 692, 'n_words': 129}