python的代码重载支持库

livecoding的Python项目详细描述


这个库实现了一些通常被称为实时编码或代码的东西 重新加载。它允许应用程序使用python代码,这些代码可能是 当应用程序在 跑步。

  • No need to restart the application in order to incorporate changes made to Python scripts.
  • No need to execute Python scripts manually each time you want to use the code within them.

此库将不允许您现有的Python模块重新加载。 如果您想了解原因,请访问项目主页。这是一个 自定义解决方案,不是对现有实践的创可贴。

版本2.01的更改:

  • MODE_OVERWRITE is recognised as not working properly and now MODE_UPDATE is the default option.
  • Now uses the ‘logging’ module from the standard library for output, whether for debugging or just related to normal usage.
  • Unit testing for managed scripts was only done when the script was first loaded, not when it was subsequently modified and reloaded. Now it happens in both cases.
  • When unit tests are located for a managed script, how many were found for that script are logged as normal usage output.
  • Exceptions that occur during the loading or reloading process are now displayed through ‘logging.exception’, rather than through custom means based around the ‘traceback’ module.
  • If the internal monitoring of file changes is used, depending on which method it chooses to use to monitor, it may do it in a Python thread. If this thread is prevented from exiting with the garbage collection of the code reloader, then the main Python thread and therefore whatever application is running will not exit until the other thread does as well. The other thread can be made to exit, but using the new ‘EndMonitoring’ function.
  • The ‘filechanges’ module was passing notification of all file changes within the directories it monitored. Now it only passes on changes to files with a name ending in ‘.py’.
  • For every changed script that MODE_UPDATE loaded and put into effect, if there were classes in a script with functions defined on them, those classes would be leaked. Under this mode, those scripts and the objects within them, like classes are not necessarily used.
  • Added a way to get callbacks when classes are updated. This is done by passing a function or method to ‘SetClassUpdateCallback’ on the code reloader.
  • Under MODE_UPDATE, when classes were processed and their functions were moved over from the updated script that had been loaded to the original script, they were not rebound. This meant they were referencing the globals dictionary of the temporary script, rather than that of the original script where they were going. Now the rebound functions are used, rather than just being created and ignored.
  • When a script is garbage collected, its globals dictionary is explicitly cleared. This should highlight problems with faulty code reloading, and it also works around a class leakage problem too (issue 12).

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
字符串Java字母替换无效   java Spring Roo JPA MS SQL Server无法打开JPA EntityManager组织。冬眠例外GenericJDBCException:无法打开连接   在scala中使用JavaWS对大型数据文件进行java流式处理   Java编译器是否将字节和短字符识别为文本?   java无法查找符号错误,空指针   mongodb在Java中重用数据库连接   java将多个StringArray从字符串文件获取到活动中   java是一个变量,它只保存最后一次鼠标单击的坐标   c#尺寸有限;添加、删除和洗牌   java如何在Android中显示来自资产文件夹的文本文件中的文本   Android应用程序中的java Tensorflow Lite自定义对象检测模型错误   java如何在foreachloop中使用scanner将来自命令行的输入存储到数组中   java如何定义一个好的存储库接口   Android中的java解析动态json对象