Recent revs have created new or renamed methods that search for data in 
various places.  All these methods are in the ssm.Paths outline. Afaik, all 
code in the StyleSheetManager now use these methods.  This is my attempt to 
herd cats.

Here are the actual methods.  At present the "theme" keyword argument is 
always None.  Eventually it will be the name of the desired theme.

def compute_icon_directories(self, theme=None):
    '''
    Return a list of directories that could contain theme-related icons.
    All directories in this list do in fact exist.
    '''
    join = g.os_path_finalize_join
    home = g.app.homeLeoDir
    leo = join(g.app.loadDir, '..')
    if theme:
        table = [
            join(home, 'themes', theme, 'Icons'),
            join(home, 'themes', theme),
            join(home, '.leo', 'themes', theme, 'Icons'),
            join(home, '.leo', 'themes', theme),
            #
            join(leo, 'themes', theme, 'Icons'),
            join(leo, 'themes', theme),
            join(leo, 'themes', 'Icons'),
            join(leo, 'themes'),
            join(leo, 'Icons', theme),
            join(leo, 'Icons')
        ]
    else:
        table = [
            join(leo, 'themes', 'Icons'),
            join(leo, 'themes'),
            join(leo, 'Icons'),
        ]
    return [g.os_path_normslashes(z) for z in table if g.os_path_exists(z)]

def compute_theme_directories(self, theme=None):
    '''
    Return a list of directories that could contain theme .leo files.
    All directories in this list do in fact exist.
    '''
    join = g.os_path_finalize_join
    home = g.app.homeLeoDir
    leo = join(g.app.loadDir, '..')
    if theme:
        table = [
            join(home, 'themes', theme),
            join(home, '.leo', 'themes', theme),
            # 
            join(leo, 'themes', theme),
            join(leo, 'themes'),
        ]
    else:
        table = [join(leo, 'themes')]
    return [g.os_path_normslashes(z) for z in table if g.os_path_exists(z)]

Feel free to suggest changes to these lists.  Order matters. The first 
found directory in these lists wins.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to