(self, scheme_file, color_filter=None)
Initialize.
Initialize.
Initialize .
def __init__(self, scheme_file, color_filter=None):
        """Initialize."""
        if color_filter is None:
            color_filter = self.filter
        self.color_scheme = scheme_file.replace('\\', '/')
        self.scheme_file = path.basename(self.color_scheme)

        if NEW_SCHEMES and scheme_file.endswith(('.sublime-color-scheme', '.hidden-color-scheme')):
            self.legacy = False
            self.scheme_obj = {
                'variables': {},
                GLOBAL_OPTIONS: {},
                'rules': []
            }
        else:
            try:
                content = sublime.load_binary_resource(sublime_format_path(self.color_scheme))
            except IOError:
                # Fallback if file was created manually and not yet found in resources
                with open(packages_path(self.color_scheme), 'rb') as f:
                    content = f.read()
            self.legacy = True
            self.convert_format(readPlistFromBytes(XML_COMMENT_RE.sub(b'', content)))
        self.overrides = []
        if NEW_SCHEMES:
            self.merge_overrides()
        self.scheme_file = scheme_file
        self.matched = {}
        self.variables = {}
        self.parse_scheme()
        self.scheme_obj = color_filter(self.scheme_obj)
        self.setup_matcher()
def __init__ ( self , scheme_file , color_filter = None ) : if color_filter is None : color_filter = self . filter self . color_scheme = scheme_file . replace ( '\\' , '/' ) self . scheme_file = path . basename ( self . color_scheme ) if NEW_SCHEMES and scheme_file . endswith ( ( '.sublime-color-scheme' , '.hidden-color-scheme' ) ) : self . legacy = False self . scheme_obj = { 'variables' : { } , GLOBAL_OPTIONS : { } , 'rules' : [ ] } else : try : content = sublime . load_binary_resource ( sublime_format_path ( self . color_scheme ) ) except IOError : # Fallback if file was created manually and not yet found in resources with open ( packages_path ( self . color_scheme ) , 'rb' ) as f : content = f . read ( ) self . legacy = True self . convert_format ( readPlistFromBytes ( XML_COMMENT_RE . sub ( b'' , content ) ) ) self . overrides = [ ] if NEW_SCHEMES : self . merge_overrides ( ) self . scheme_file = scheme_file self . matched = { } self . variables = { } self . parse_scheme ( ) self . scheme_obj = color_filter ( self . scheme_obj ) self . setup_matcher ( )