# Path: FrMaya/core/system.py
# def __get_environ_path(environ_key):
# def get_menubar_path():
# def get_control_curve_path():
# def maya_version_as_float():
# def install(source_path, package_title = '', local_install = False):
# def uninstall(installed_title):
# def get_server_version():
# def download_latest_version(target_name = '', target_dir = None):
# def check_local_package(installed_title):


import os
import re
    import shiboken
    import shiboken2 as shiboken
from maya import mel as mel
from maya import OpenMayaUI as omui
from pymel import core as pm
from pymel.core import uitypes as pmui
from pymel.core import windows as pywin
from FrMaya.vendor.Qt import QtCore, QtCompat, QtWidgets
from FrMaya.core import system
                    postMenuCommandOnce = 1,
                    image = icon_file
                )
                # recursive buildSubMenu
                self.build_sub_menu(the_path, submenu)
            elif SEPARATOR in menu_name:
                pywin.menuItem(
                    label = menu_name.replace(SEPARATOR, ''),
                    p = parent,
                    divider = True,
                )
            # if file is python
            elif ext == '.py' or ext == '.mel':
                # command of menuitem
                command_script = 'execfile("{0}")'.format(the_path)
                if ext == '.mel':
                    command_script = 'import maya.mel as mel\nmel.eval( "source \\"{0}\\"" )'.format(the_path)

                # create menuitem
                pywin.menuItem(
                    label = menu_name,
                    p = parent,
                    tearOff = True,
                    command = command_script,
                    image = icon_file
                )


def build_menubar():
    """Build menubar function"""

# Path: FrMaya/core/system.py
# def __get_environ_path(environ_key):
# def get_menubar_path():
# def get_control_curve_path():
# def maya_version_as_float():
# def install(source_path, package_title = '', local_install = False):
# def uninstall(installed_title):
# def get_server_version():
# def download_latest_version(target_name = '', target_dir = None):
# def check_local_package(installed_title):


# Path: FrMaya/core/uimaya.py
import os
import re
    import shiboken
    import shiboken2 as shiboken
from maya import mel as mel
from maya import OpenMayaUI as omui
from pymel import core as pm
from pymel.core import uitypes as pmui
from pymel.core import windows as pywin
from FrMaya.vendor.Qt import QtCore, QtCompat, QtWidgets
from FrMaya.core import system

                    postMenuCommandOnce = 1,
                    image = icon_file
                )
                # recursive buildSubMenu
                self.build_sub_menu(the_path, submenu)
            elif SEPARATOR in menu_name:
                pywin.menuItem(
                    label = menu_name.replace(SEPARATOR, ''),
                    p = parent,
                    divider = True,
                )
            # if file is python
            elif ext == '.py' or ext == '.mel':
                # command of menuitem
                command_script = 'execfile("{0}")'.format(the_path)
                if ext == '.mel':
                    command_script = 'import maya.mel as mel\nmel.eval( "source \\"{0}\\"" )'.format(the_path)

                # create menuitem
                pywin.menuItem(
                    label = menu_name,
                    p = parent,
                    tearOff = True,
                    command = command_script,
                    image = icon_file
                )


def build_menubar():
    """Build menubar function"""

    menubar_path_list = system.get_menubar_path()