<commit_before># this script is executed by mmlaunch to enable the mmobj plugin

import addon_utils
import bpy
import sys

# note, the UI checks for this string because we can't return error codes (see below)
SUCCESS="MMINFO: Plugin enabled"

outHandle = None

def wline(line):
    if outHandle != None:
        print(line, end="\n", file=outHandle)
    else:
        print(line)

def install_mmobj():
    enabled,_ = addon_utils.check('io_scene_mmobj')
    if not enabled:
        addon_utils.enable('io_scene_mmobj', True)
        enabled,_ = addon_utils.check('io_scene_mmobj')
        if enabled:
            bpy.ops.wm.save_userpref()<commit_msg>Fix(install.py): use new syntax to enable addon<commit_after># this script is executed by mmlaunch to enable the mmobj plugin

import addon_utils
import bpy
import sys

# note, the UI checks for this string because we can't return error codes (see below)
SUCCESS="MMINFO: Plugin enabled"

outHandle = None

def wline(line):
    if outHandle != None:
        print(line, end="\n", file=outHandle)
    else:
        print(line)

def install_mmobj():
    enabled,_ = addon_utils.check('io_scene_mmobj')
    if not enabled:
        try:
            # this interface changed in 2.77+, try old way first
            addon_utils.enable('io_scene_mmobj', True)
        except TypeError:
            addon_utils.enable('io_scene_mmobj', default_set=True, persistent=True)
        enabled,_ = addon_utils.check('io_scene_mmobj')
        if enabled:
            bpy.ops.wm.save_userpref()
{'fraction_non_alphanumeric': 0.09358638743455497, 'fraction_numerical': 0.001963350785340314, 'mean_word_length': 3.223756906077348, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1649070', 'n_tokens_mistral': 483, 'n_tokens_neox': 473, 'n_words': 144}