系统信息发现和资产跟踪

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 JList侦听器找不到符号   多点触摸跨平台java应用程序(Windows、Mac和Linux(Ubuntu)(可能是Android))   在UnitTest中找不到java类加载器资源   java当我尝试在Eclipse中运行我的minecraft mod时,我总是遇到这个错误,这是什么意思?   内部有一个同步块的静态方法,在java中阻止整个类?   不支持java操作:具有BillableStatus的费用在采购中应具有AccountBasedExpenseLineDetail行的CustomerRef   java运行时常量池GC集合   java无法解析配置“:app:\u debugApk”的所有依赖项。找不到名为“default”的配置   在GCP计算引擎中托管Neo4j的java   java如何从BroadcastReceiver更新片段选项卡?   线程“main”组织中的java异常。冬眠注释异常:@org。冬眠注释。表引用未知表:ProductForPractice   在Java/Groovy中嵌入处理   java Android REST教程/示例项目   java我可以在同一测试中在一个模拟器上启动应用程序,在另一个模拟器上启动移动浏览器吗?   java如何更改通知横幅的方向?   安卓 Java帮助实现Firebase授权   if else之后的rs.next()中出现java错误?