系统信息发现和资产跟踪

corn的Python项目详细描述


系统信息发现和资产跟踪

安装

pip install corn

开发安装

克隆cornrepo并使用pip安装:

^{pr2}$

执行

安装后,corn命令现在应该可用了。在

命令在垂直扩展之前没有输出(详细信息如下)。在

测试

安装要求-测试.txt使用pip并运行pytest:

pip install -r corn/requirements-test.txt
pytest corn/tests

垂直应用程序合并

玉米延伸说明

安装pop:

pip install --upgrade pop

为项目创建新目录:

mkdir corn_{project_name}
cd corn_{project_name}

使用pop seed生成扩展玉米的项目结构:

pop-seed -t v corn_{project_name} -d corn
  • “-t v”指定这是一个垂直应用程序合并的项目
  • “-d corn”表示要实现“corn”的动态名称

请注意,已经为您创建了一些结构。 我们特别关注corn{project_name}/corn中的新目录

添加“玉米”到要求.txt公司名称:

echo "corn" >> requirements.txt

创造玉米

  • Create a new file in “corn_{project_name}/corn”
    • The directory should already have been created by pop-seed.
    • The file name is arbitrary.
    • Every file in this directory, then it’s subdirectories, will be parsed “simultaneously” (as far as that makes sense for asyncio).
    • Corns that are dependant on each other should be assigned in the same function.
    • Do NOT rely on the collector’s recursion strategy for corns to depend on each other.
    • Use hub.corn.init.wait_for(“corn”) to wait for corns to be generated by another sub
  • Add your new project to the python path
    • alternatively, run “pip install -e .” from your project’s root directory
      • you only need to do this once
  • Create an async function in this file with a descriptive yet arbitrary name
    • By convention it should start with “load”
    • Make it async unless you have a really really really good reason.
    • Grains that depend on each other already belong in the same function, don’t depend on synchronous programming for determinism
    • Corns can be accessed and assigned like a dictionary, but our convention is to use the namespace

示例:

async def load_my_corn(hub):
    hub.corn.CORN.new_corn = "Hello World!"

就这样!现在从命令行验证是否收集了玉米:

corn new_corn

输出:

new_corn:
    Hello World!

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

推荐PyPI第三方库


热门话题
由于测试失败,java testcontainers maven构建失败   java实现jacobi算法实现laplace方程   java中的多线程:如何在不等待所有线程使用ExecutorService完成任务的情况下终止所有线程的执行?   java Hello World不在Android Studio 3中工作   ubuntu Tomcat7的Java版本不正确   java Javafx内存泄漏   对于手动实现的Spring数据存储库方法,我应该使用Java8默认方法吗?   googleappengine中的java添加过滤查询   html当使用JSOUP库在Java中读取标签时,如何保留标签(如<br>、<ul>、<li>、<p>等)的含义?   编码为什么jasper生成的报告在Java中不显示西里尔语(保加利亚语)?   java有没有办法隐藏当前位置和jdk动作?   java找出编译原型文件的版本   有没有办法在运行时更改java方法的访问修饰符?   语法字符串。。。Java中的参数   java数组元素在添加其他元素时会相互覆盖   eclipse中的java GWT项目   java如何为spring rest模板请求将动态json属性名映射到jackson   java无法在Windows 10上找到特定的JDK   在xml字符串和java字符串之间提取正则表达式子字符串