设置Ant项目名称而不更改构建文件(Setting Ant project name without changing build file)
我们有一个Java应用程序和一个支持Ant build.xml文件,团队使用Eclipse IDE。 我(和其他人)有几次检查相同的应用程序,通常是不同的分支。 在Eclipse“Ant”视图中,我获得了Ant项目的列表,但它们都具有相同的名称 - 来自Ant构建文件的“project”元素。
我非常希望能够在不更改build.xml的情况下重命名这些,因为这样做会迫使我必须提交或回滚更改,并且会对构建文件的任何“真正”更改感到困惑。
实际上,我必须在Ant视图中单击项目名称,以便在运行任何目标之前检查我是否在正确的项目名称中,并且存在持续的风险,我将针对错误的项目运行目标。
理想情况下,我希望能够在Eclipse中以可视方式注释Ant项目,或者从Eclipse项目变量或设置中覆盖Ant项目名称。
当然这是一个相当普遍的问题,任何想法?
谢谢,斯蒂芬。
We have a Java application and a supporting Ant build.xml file, and the team use the Eclipse IDE. I (and others) have the same application checked out several times, usually different branches. In the Eclipse "Ant" view, I get a list of the Ant projects, but they all have the same name - coming from the 'project' element of the Ant buildfile.
I would dearly love to be able to rename these without having to change build.xml, because doing so will force me to have to commit or rollback the change, and will get confused with any "real" changes to the buildfile.
As it is, I have to click on the project name in the Ant view to check I'm in the right one before I run any target, and there's a continuing risk I'll run a target against the wrong project.
Ideally, I'd like either to be able to visually annotate the Ant projects in Eclipse OR to override the Ant project name from an Eclipse project variable or setting.
Surely this is a quite common issue, any ideas?
Thanks, Stephen.
原文:https://stackoverflow.com/questions/3227793
最满意答案
Python 3中的
print()
打印换行符,除非你不告诉它。 传入end=''
告诉它不要打印该换行符:def row_top(): print("|--|--|--|--|--|--|--|--|") def cell_left(): print("| ", end='') def cell_data(isQ): if isQ: print("X", end='') else: print(" ", end='') def row(c): row_top() row_data(c) print("|")
print()
in Python 3 prints newlines unless you tell it not to. Pass inend=''
to tell it not to print that newline:def row_top(): print("|--|--|--|--|--|--|--|--|") def cell_left(): print("| ", end='') def cell_data(isQ): if isQ: print("X", end='') else: print(" ", end='') def row(c): row_top() row_data(c) print("|")
相关问答
更多-
你在这里链接的TAAG应用程序的作者。 TAAG中的大多数字体都是FIGlet字体(figlet.org)。 FIGlet是一个命令行的Linux应用程序,但FIGlet驱动程序已用多种语言编写。 我在这里发布了我在JavaScript中编写的驱动程序: https://github.com/patorjk/figlet.js 尽管这需要移植到Python才能工作。 我搜索了FIGlet Python库,发现这个: https://github.com/pwaller/pyfiglet 我不确定它的工作效果 ...
-
您发布的ascii-art 在每个换行符之前都有一个尾随反斜杠。 如果除了换行符之外没有任何内容后面的反斜杠被视为行继续符 。 注意: In [118]: x = 'foo \ ...: bar \ ...: baz' In [119]: x Out[119]: 'foo bar baz' 在上面的例子中, 在尾部反斜杠之后没有任何内容,因此python认为它是一个没有任何换行符的单个字符串。 即使您有字符串的多行引用,也会给出相同的处理。 您需要在反斜杠后添加一个空格 ,并使您的字 ...
-
你可以使用re.split 。 >>> import re >>> re.split('\W+', 'Words, words, words.') ['Words', 'words', 'words', ''] 调整模式以仅包含要保留的字符。 另请参阅: 在python中剥离不可打印字符的字符串 示例(w /长减号): >>> # \xe2\x80\x93 represents a long dash (or long minus) >>> s = 'hello – world' >>> s 'hello ...
-
无法打印到同一行(Having trouble printing to same line)[2022-11-08]
使用String或StringBuilder存储每行并最后打印所有字符串。 逻辑 import java.util.Scanner; public class Tester { public static void main(String[] args){ Scanner input = new Scanner(System.in); String any = input.nextLine(); String[] sArray = any.split(""); String ... -
打印完整的ASCII艺术(Print full ascii art)[2020-10-15]
encode需要一个字符串并将其编码为字节。 这不是你想要的。 你想直接打印字符串: print("""\ ._ o o \_`-)|_ ,"" \ ," ## | ಠ ಠ. ... -
Python 3中的print()打印换行符,除非你不告诉它。 传入end=''告诉它不要打印该换行符: def row_top(): print("|--|--|--|--|--|--|--|--|") def cell_left(): print("| ", end='') def cell_data(isQ): if isQ: print("X", end='') else: print(" ", end='') def row ...
-
因为它无法正确猜测编码并假设它是“ascii”。 当输出不是TTY时,编码为UTF-8。 Because it can't guess the encoding properly and assumes that it's "ascii". Encode to UTF-8 when the output is not a TTY.
-
在R中包含ASCII艺术(Including ASCII art in R)[2021-11-23]
不幸的是,R只能通过使用单引号或双引号来表示文字字符串,这使得表示ascii艺术变得尴尬; 但是,您可以执行以下操作来获取您的艺术作品的文本表示,可以使用R的cat函数输出。 1)首先将您的艺术品放入文本文件中: # ascii_art.txt is our text file with the ascii art # For test purposes we use the output of say("Hello") from cowsay package # and put that in asci ... -
Python - 在同一行上打印(Python - Printing on Same Line)[2023-01-15]
这些列的末尾有一个换行符,所以如果你想在没有它们的情况下打印它们,你必须使用.strip()它们: print Second_row_first_column.strip() + Second_row_second_column.strip() 如果要在两列之间留出空格,请用逗号替换加号。 The columns have a newline at the end, so if you want to print it without them, you have to .strip() them: pr ... -
您可以将每行添加到行列表( list.append ),然后在打印之前反转该列表( list[::-1] ): lines = [] stopword = "" while True: line = input() if line.strip() == stopword: break lines.append(line) # Add to the list of lines for line in lines[::-1]: # [::-1] inverts the l ...