如何在Eclipse中为所有文本编辑器更改字体大小?(How can I change font size in Eclipse for ALL text editors?)
我昨天不得不做演讲,作为演示的一部分,我使用Eclipse来显示一些代码。 我的许多同事在房间里看不到文本,并要求我增加所有文件的文本大小,而不仅仅是Java文件或XML文件。
但是从现有的选项来看,这并不是很明显的。 我在搜索输入中转到菜单窗口 → 首选项和键入的字体 。 这样会将选项过滤到常规 → 外观 → 颜色和字体 。 从这里,我可以看到一个选项来更改Java文件中的字体,但是我不知道如何更改全局字体。
我在Windows上使用Eclipse v4.3服务版本1(开普勒)。
这类似于Stack Overflow问题如何在Java文本编辑器中更改字体大小? 。
I had to do a presentation yesterday, and as part of the presentation, I used Eclipse to show some code. Many of my coworkers in the room could not read the text and asked me to increase the size of the text for ALL files, not just Java files or XML files.
But it wasn't immediately obvious from the available options how to do this. I went to menu Window → Preferences and typed font in the search input. This filtered the options to General → Appearance → Colors and Fonts. From here, I could see an option to change the font in Java files, but I didn't know how to change the font globally.
I'm using Eclipse v4.3 Service Release 1 (Kepler) on Windows.
This is similar to Stack Overflow question How can I change font size in Eclipse for Java text editors?.
原文:https://stackoverflow.com/questions/23272839
最满意答案
我搜索了cherrypy源代码,这是我发现的。 在
_cptree.py
模块中,您将找到Application
类。 下面是一个Tree
类,它有mount
方法,我们用它来绑定应用程序(例如cherrypy.tree.mount(Root(), "/", config=config)
)def mount(self, root, script_name="", config=None): ...
当您查看此方法时,您将看到下面的代码;
def mount(self, root, script_name="", config=None): ... if isinstance(root, Application): app = root if script_name != "" and script_name != app.script_name: raise ValueError( "Cannot specify a different script name and pass an " "Application instance to cherrypy.mount") script_name = app.script_name else: app = Application(root, script_name) # If mounted at "", add favicon.ico if (script_name == "" and root is not None and not hasattr(root, "favicon_ico")): favicon = os.path.join(os.getcwd(), os.path.dirname(__file__), "favicon.ico") root.favicon_ico = tools.staticfile.handler(favicon) if config: app.merge(config) self.apps[script_name] = app
因此,代码表明您传递给
mount
方法的每个对象(应用程序)都是Application
实例或包装在Application
实例中。 那么为什么会这样呢? 当您在Tree
类上面检查Application
类时,您将看到如下所示的__call__
方法;def __call__(self, environ, start_response): return self.wsgiapp(environ, start_response)
是的你现在看到它,它是
wsgi
接口。 因此,Application
是一个wsgi包装器,适用于您的应用程序。 当你查看cherrypy的源代码时,你可能会学到很多东西。 我希望这个答案可以帮到你。I searched the cherrypy source code and here is what I found. In
_cptree.py
module you will find theApplication
class. Below that, there is aTree
class which hasmount
method which we are used to binding applications with (e.g.cherrypy.tree.mount(Root(), "/", config=config)
)def mount(self, root, script_name="", config=None): ...
When you look inside this method you will see the code below;
def mount(self, root, script_name="", config=None): ... if isinstance(root, Application): app = root if script_name != "" and script_name != app.script_name: raise ValueError( "Cannot specify a different script name and pass an " "Application instance to cherrypy.mount") script_name = app.script_name else: app = Application(root, script_name) # If mounted at "", add favicon.ico if (script_name == "" and root is not None and not hasattr(root, "favicon_ico")): favicon = os.path.join(os.getcwd(), os.path.dirname(__file__), "favicon.ico") root.favicon_ico = tools.staticfile.handler(favicon) if config: app.merge(config) self.apps[script_name] = app
So, the code says that every object (application) you pass to the
mount
method is eitherApplication
instance or wrapped in anApplication
instance. So why is that so? When you checkApplication
class aboveTree
class, you will see a__call__
method like below;def __call__(self, environ, start_response): return self.wsgiapp(environ, start_response)
Yes you see it now, it is
wsgi
interface. Therefore,Application
is a wsgi wrapper for your cherrypy applications. When you check the source code of cherrypy you may learn lots of things. I hope this answer help you.
相关问答
更多-
Python CherryPy服务器,cherrypy.Application做什么?(Python CherryPy server, what does cherrypy.Application do?)[2022-09-22]
我搜索了cherrypy源代码,这是我发现的。 在_cptree.py模块中,您将找到Application类。 下面是一个Tree类,它有mount方法,我们用它来绑定应用程序(例如cherrypy.tree.mount(Root(), "/", config=config) ) def mount(self, root, script_name="", config=None): ... 当您查看此方法时,您将看到下面的代码; def mount(self, root, script_name ... -
CherryPy服务器名称标签(CherryPy server name tag)[2023-04-04]
现在可以在config文件/ dict中的每个应用程序基础上进行设置 [/] response.headers.server = "CherryPy Dev01" Actually asking on IRC on their official channel fumanchu gived me a more clean way to do this (using latest svn): import cherrypy from cherrypy import _cpwsgi_server cla ... -
这个例子工作正常。 我确信freenode上的#gevent可以帮助您解决任何安装问题。 That example works fine. I'm sure #gevent on freenode would help you with any installation issues.
-
CherryPy服务器错误日志(CherryPy server errors log)[2021-09-06]
您需要指定错误或访问日志文件名。 你可以在配置文件中这样做...... [global] log.error_file = 'Web.log' log.access_file = 'Access.log' 或者在Python文件中...... cherrypy.config.update({'log.error_file': Web.log, 'log.access_file': Access.log }) 我在想你得到一个“端口80不是免费 ... -
最后! 得到它自己 - 从手册... cherrypy.tree本身就是一个WSGI对象,所以你只需: cherrypy.tree.mount(...) cherrypy.tree.mount(...) cherrypy.tree.mount(...) application = cherrypy.tree Finally! Got it myself - from the manual... cherrypy.tree is itself a WSGI object so you simply do: ...
-
以下是我检查我们的服务器生成的有效csrf令牌的post方法的方法。 def check_token(self=None): # whenever a user posts a form we verify that the csrf token is valid. if cherrypy.request.method == 'POST': token = cherrypy.session.get('_csrf_token') if token is None ...
-
我意识到问题实际上是关于CORS预检请求 。 CORS 规范为简单的CORS请求定义了以下条件: 方法: GET , HEAD , POST 标题: Accept , Accept-Language , Content-Language , Content-Type Cotent类型标头值: application/x-www-form-urlencoded , multipart/form-data , text/plain 否则CORS请求并不简单,并在实际请求之前使用预检OPTIONS请求以确保其符合 ...
-
Python Web服务器(CherryPy)在AWS上扩展并发请求(Python web server (CherryPy) scaling concurrent requests on AWS)[2023-11-03]
在简单的情况下,您只需管理server.thread_pool配置参数,就像在问题的评论中提到的那样。 在实际情况中,它取决于许多因素。 但我可以肯定地说,CherryPy是一个线程服务器,由于Python GIL,一次只运行一个线程。 对于IO绑定工作负载来说,这可能不是一个大问题,但无论如何,您可以利用运行同一应用程序的许多CherryPy进程的CPU核心。 它可能会规定一些设计决策,例如避免进程内缓存,并且通常遵循无共享体系结构,因此您的进程可以互换使用。 拥有许多应用程序实例会使维护变得更加复杂,因 ... -
阅读: http://blog.dscpl.com.au/2015/01/using-alternative-wsgi-servers-with.html 您可以提供app.py文件以覆盖默认Apache / mod_wsgi的使用。 Have a read of: http://blog.dscpl.com.au/2015/01/using-alternative-wsgi-servers-with.html You can supply an app.py file to override the us ...
-
分析CherryPy(Profiling CherryPy)[2022-06-23]
事实证明,CherryPy生成的配置文件可以使用作为CherryPy的一部分提供的profiler.py脚本进行解释。 只需在/cherrypy/lib目录中运行profiler.py ,如下所示: python profiler.py /directory/containing/prof/files 8080 然后在浏览器中导航到localhost:8080 ,目标目录中所有.prof文件的分析结果将显示在一个简单的文本界面中。 我仍然希望能够使用KCacheGrind将结 ...