当前位置: 首页>>代码示例>>Python>>正文


Python GPS.get_tmp_dir方法代码示例

本文整理汇总了Python中GPS.get_tmp_dir方法的典型用法代码示例。如果您正苦于以下问题:Python GPS.get_tmp_dir方法的具体用法?Python GPS.get_tmp_dir怎么用?Python GPS.get_tmp_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GPS的用法示例。


在下文中一共展示了GPS.get_tmp_dir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: show_gnatdg

# 需要导入模块: import GPS [as 别名]
# 或者: from GPS import get_tmp_dir [as 别名]
def show_gnatdg(for_subprogram=False, in_external_editor=False):
    """Show the .dg file of the current file"""
    GPS.MDI.save_all(False)
    context = GPS.current_context()
    local_file = context.file().path
    file = context.file().name("Build_Server")
    line = context.location().line()

    try:
        if context.project():
            l = context.project().object_dirs(False)
            prj = ' -P """' + \
                GPS.Project.root().file().name("Build_Server") + '"""'
        else:
            l = GPS.Project.root().object_dirs(False)
            prj = " -a"
    except Exception:
        GPS.Console("Messages").write(
            "Could not obtain project information for this file")
        return

    if l:
        objdir = l[0]
    else:
        objdir = GPS.get_tmp_dir()
        GPS.Console("Messages").write(
            "Could not find an object directory for %s, reverting to %s" %
            (file, objdir))

    dg = os.path.join(objdir, os.path.basename(local_file)) + '.dg'

    if distutils.dep_util.newer(local_file, dg):
        cmd = 'gprbuild -q %s -f -c -u -gnatcdx -gnatws -gnatGL """%s"""' % (
            prj, file)

        GPS.Console("Messages").write("Generating " + dg + "...\n")
        proc = GPS.Process(cmd, on_exit=on_exit, remote_server="Build_Server")
        proc.source_filename = local_file
        proc.dg = dg
        proc.line = line
        proc.for_subprogram = for_subprogram
        proc.in_external_editor = in_external_editor
    else:
        edit_dg(dg, local_file, line, for_subprogram, in_external_editor)
开发者ID:MichelKramer31,项目名称:gps,代码行数:46,代码来源:expanded_code.py

示例2: show_gnatdg

# 需要导入模块: import GPS [as 别名]
# 或者: from GPS import get_tmp_dir [as 别名]
def show_gnatdg(for_subprogram = False, in_external_editor = False):
  """Show the .dg file of the current file"""
  GPS.MDI.save_all (False)
  context = GPS.current_context()
  local_file = context.file().name()
  file = context.file().name("Build_Server")
  line = context.location().line()

  if context.project():
    l = context.project().object_dirs (False)
    prj = " -P" + GPS.Project.root().file().name("Build_Server")
  else:
    l = GPS.Project.root().object_dirs (False)
    prj = " -a"

  if l:
    objdir = l[0]
  else:
    objdir = GPS.get_tmp_dir()
    GPS.Console ("Messages").write (
       "Could not find an object directory for %s, reverting to %s" %
         (file, objdir))

  dg = os.path.join (objdir, os.path.basename (local_file)) + '.dg'

  if distutils.dep_util.newer (local_file, dg):
    gnatmake = GPS.Project.root().get_attribute_as_string ("compiler_command",
                 package="ide", index="ada")
    cmd = gnatmake + " -q" + prj + \
          " -f -c -u -gnatcdx -gnatws -gnatGL " + file
    GPS.Console ("Messages").write ("Generating " + dg + "...\n")
    proc = GPS.Process (cmd, on_exit=on_exit, remote_server="Build_Server")
    proc.source_filename = local_file
    proc.dg = dg
    proc.line = line
    proc.for_subprogram = for_subprogram
    proc.in_external_editor = in_external_editor
  else:
    edit_dg (dg, local_file, line, for_subprogram, in_external_editor)
开发者ID:flyx,项目名称:gps-osx,代码行数:41,代码来源:expanded_code.py


注:本文中的GPS.get_tmp_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。