本文整理汇总了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)
示例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)