获取和管理树莓pi图像

pibake的Python项目详细描述


覆盆子皮图像面包师

Documentation Status

此工具从官方获取最新的覆盆子皮图像 来源并保存在本地缓存中。然后可以将图像刻录到sd 缓存副本中的卡。

使用该工具可以使用最新的映像编写pi安装脚本 并防止在将其写入SD卡时发生不幸的事故。

所有下载都保存在本地xdg指定的缓存目录中, ~/.cache/pibake默认情况下。

新图像有新名称,因此旧版本将保留到手动 从缓存中删除。

这意味着图像总是在手边,您可以更新您的本地 必要时复制。

用法

获取帮助

$ pibake --help
Usage: pibake [OPTIONS] COMMAND [ARGS]...

  Fetch, manage and burn Raspberry PI images.

Options:
  -v, --verbose          Level of verbosity of logs
  -c, --cache-path PATH  Image cache path, Default: /home/thys/.cache/pibake
  --help                 Show this message and exit.

Commands:
  bake   Bake selected image to disk mounted at...
  disks  List mounted SD card(s) that are good...
  fetch  Fetch images
  list   List all images available in local cache

获取图像

$ pibake fetch --help
Usage: pibake fetch [OPTIONS]

  Fetch images

Options:
  -o, --overwrite / --no-overwrite
                                  Overwrite existing file
  -i, --image [NOOBS|NOOBS_LITE|RASPIAN|RASPIAN_LITE]
                                  Download NOOBS Full or Lite
  --help                          Show this message and exit.

获取最新的Lite Noobs图像

$ pibake fetch NOOBS
Contacting server...
Fetching /home/thys/.pibake/NOOBS_lite_v2_3.zip
  [####################################]  100%

获取最新的完整noobs图像

$ pibake fetch --full
Contacting server...
Fetching /home/thys/.pibake/NOOBS_v2_3_0.zip
  [####--------------------------------]   13%  0d 00:17:29

查看要烘焙图像的潜在SD卡。大多数发行版将 插入时自动装入磁盘。像鹦鹉螺这样的应用程序也会 装载所有可用磁盘。

$ pibake disks
1 potential disk(s) are available:
Device /dev/sdb1 mounted on /run/media/thys/A881-FFA5

列出本地可用的所有图像

$ pibake list
2017-03-02-raspbian-jessie
NOOBS_lite_v2_3
NOOBS_v2_3_0
NOOBS_v2_4_0

要查看从何处检索图像,请使用-vv选项

pibake -vv fetch
Contacting server...
{'Accept-Ranges': 'bytes',
 'Age': '2714',
 'Content-Length': '33492713',
 'Content-Type': 'application/zip',
 'Date': 'Sun, 09 Apr 2017 09:31:57 GMT',
 'ETag': '"140006-1ff0ee9-549d637969e00"',
 'Last-Modified': 'Fri, 03 Mar 2017 16:41:28 GMT',
 'Server': 'Apache/2.2.22 (Debian)',
 'Via': '1.1 d.cdn.velocix.com:80 (pcd/42.0.189164.189164 (2016-03-03 08:58:06 ''UTC))',
 'X-Cache': 'HIT from d.cdn.velocix.com'}{'Connection': 'close',
 'Content-Encoding': 'gzip',
 'Content-Length': '278',
 'Content-Type': 'text/html; charset=iso-8859-1',
 'Date': 'Sun, 09 Apr 2017 10:17:08 GMT',
 'Location': 'https://downloads.raspberrypi.org/NOOBS_lite/images/NOOBS_lite-2017-03-03/NOOBS_lite_v2_3.zip',
 'Server': 'Apache/2.2.22 (Debian)',
 'Vary': 'Accept-Encoding'}{'Connection': 'close',
 'Content-Encoding': 'gzip',
 'Content-Length': '284',
 'Content-Type': 'text/html; charset=iso-8859-1',
 'Date': 'Sun, 09 Apr 2017 10:17:09 GMT',
 'Location': 'http://director.downloads.raspberrypi.org/NOOBS_lite/images/NOOBS_lite-2017-03-03/NOOBS_lite_v2_3.zip',
 'Server': 'Apache/2.2.22 (Debian)',
 'Vary': 'Accept-Encoding'}{'Connection': 'close',
 'Content-Length': '0',
 'Content-Type': 'text/x-python',
 'Date': 'Sun, 09 Apr 2017 10:17:10 GMT',
 'Location': 'http://vx2-downloads.raspberrypi.org/NOOBS_lite/images/NOOBS_lite-2017-03-03/NOOBS_lite_v2_3.zip',
 'Server': 'Apache/2.2.22 (Debian)'}

安装

pibake在pypi中

$ pip install pibake

从源代码安装到virtualenv

$ workon pibake
$ pip install pibake

在.local/

中从源安装到本地用户

在$path中使用${home}/.local/bin/最有用

$ pip install -r requirements.txt
$ pip install --user .

开发

$ bumpversion --current-version=0.2.2 patch
$ python setup.py sdist bdist_wheel
$ twine upload -r test -s dist/*
$ twine upload dist/*

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

推荐PyPI第三方库


热门话题
java如何在Salesforce中查询自定义对象?   RichFaces 4中的java ExtendedDataTable:数据模型处理   java Android类层次结构和带有片段的接口   java如何在文件中保存JLabel的颜色/大小?   java编辑类中的返回值而不修改类本身?   安卓如何替换字符串java中的ï»   1.3.7.发布>1.4.1。发布| java。lang.NoSuchMethodError:org。springframework。靴子建设者SpringApplicationBuilder。展示横幅   java列表保存在模型中,而不在setter中进行设置   java如何打开一个窗口。windows中的ks文件?   Java HashMap获取值(其中大部分值)   vps的javascript Websocketurl?   使用byte buddy或某些库进行java评测   java Dom4j获取单节点文本值