Esempio n. 1
0
def inspect(obj, instances, classes_to_ignore, path):
    """
    Inspect interface and generate stub. Writes its logs to freeoriond.log.

    :param obj: main interface module (freeOrionAIInterface for AI)
    :param instances:  list of instances, required to get more detailed information about them
    :param classes_to_ignore: classes that should not to be reported when check for missed instances done.
                              this argument required because some classes present in interface
                              but have no methods, to get their instances.
    :param path: relative path from python folder
    """
    debug("\n\nStart generating skeleton for %s\n\n" % obj.__name__)
    python_folder_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
    result_folder = os.path.join(python_folder_path, path)
    result_path = os.path.join(result_folder, '%s.pyi' % obj.__name__)
    make_stub(_inspect(obj, instances), result_path, classes_to_ignore)
    debug("Skeleton written to %s" % result_path)
def inspect(obj, instances, classes_to_ignore, path):
    """
    Inspect interface and generate stub. Writes its logs to freeoriond.log.

    :param obj: main interface module (freeOrionAIInterface for AI)
    :param instances:  list of instances, required to get more detailed information about them
    :param classes_to_ignore: classes that should not to be reported when check for missed instances done.
                              this argument required because some classes present in interface
                              but have no methods, to get their instances.
    :param path: relative path from python folder
    """
    debug("\n\nStart generating skeleton for %s\n\n" % obj.__name__)
    python_folder_path = os.path.normpath(
        os.path.join(os.path.dirname(__file__), '..'))
    result_folder = os.path.join(python_folder_path, path)
    result_path = os.path.join(result_folder, '%s.pyi' % obj.__name__)
    make_stub(_inspect(obj, instances), result_path, classes_to_ignore)
    debug("Skeleton written to %s" % result_path)
Esempio n. 3
0
def inspect(obj, *instances):
    print "Start generating skeleton for %s" % obj.__name__
    folder_name = os.path.join(os.path.dirname(__file__), 'result')
    result_path = os.path.join(folder_name, '%s.py' % obj.__name__)
    make_stub(_inspect(obj, *instances), result_path)
    print "Skeleton written to %s" % result_path
def inspect(obj, *instances):
    print "Start generating skeleton for %s" % obj.__name__
    folder_name = os.path.join(os.path.dirname(__file__), 'result')
    result_path = os.path.join(folder_name, '%s.py' % obj.__name__)
    make_stub(_inspect(obj, *instances), result_path)
    print "Skeleton written to %s" % result_path
Esempio n. 5
0
def inspect(obj, *instances):
    folder_name = os.path.join(os.path.dirname(__file__), 'result')
    result_path = os.path.join(folder_name, '%s.py' % obj.__name__)
    make_stub(_inspect(obj, *instances), result_path)
Esempio n. 6
0
def inspect(obj, *instances):
    folder_name = os.path.join(os.path.dirname(__file__), 'result')
    result_path = os.path.join(folder_name, '%s.py' % obj.__name__)
    make_stub(_inspect(obj, *instances), result_path)