Pyro can import and download scripts from GitHub and public Bitbucket Cloud repositories.
When a GitHub or public Bitbucket Cloud URL is used as an Import
path, Pyro will download the respective files and use the download location as the import path.
For example:
<Imports>
<!-- Pyro will accept a GitHub page address. -->
<Import>https://github.com/fireundubh/skyui/tree/master/dist/Data/Scripts/Source</Import>
<!-- Pyro will also accept a GitHub API address. -->
<Import>https://api.github.com/repos/fireundubh/skyui/contents/dist/Data/Scripts/Source?ref=master</Import>
</Imports>
By default, Pyro will download only unchanged files on subsequent runs. This can be overridden with the --force-overwrite
switch.
When a GitHub or public Bitbucket Cloud URL is used as a Folder
path, Pyro will download the respective files and use the download location as the folder path.
For example:
<Folders>
<!-- Pyro will accept a GitHub page address. -->
<Folder NoRecurse="false">https://github.com/chesko256/Campfire/tree/master_fo4/Scripts/Source</Folder>
<!-- Pyro will also accept a GitHub API address. -->
<Folder NoRecurse="false">https://api.github.com/repos/chesko256/Campfire/contents/Scripts/Source?ref=master_fo4</Folder>
</Folders>
If the NoRecurse
attribute is set to true
, all remote files will still be downloaded but only scripts in the initial folder will be compiled.
By default, Pyro will download only unchanged files on subsequent runs. This can be overridden with the --force-overwrite
switch.
GitHub repositories require a personal access token. Your token must have public_repo
access scope.
You can specify a global access token for all repositories in your project file using the --access-token
argument, or you can create a .secrets
file in the program path defining unique access tokens for each repository.
Public Bitbucket Cloud repositories do not require an access token.
Pyro can read access tokens from a .secrets
file placed in the program path. This feature allows you to:
The .secrets
file is simply an INI file with this familiar format:
[github.com/fireundubh/LibFire]
access_token = your_personal_access_token
The access_token
option supports user and system environment variables in Python syntax:
[github.com]
access_token = $ACCESS_TOKEN
Each section name is a host URL part that is matched case-insensitively against import URLs.
Host matches occur in sequential order. These host matching rules should be ordered top-down from narrowest to broadest.
If the --access-token
argument is provided, the value will take priority over the .secrets
file regardless of whether the file exists.
Argument | Description | Type | Default Value |
---|---|---|---|
--access-token |
your personal access token (must have public_repo access scope) |
str |
'' |
--force-overwrite |
download remote files and overwrite existing files | bool |
false |
--remote-temp-path |
temp folder path for remote files (if relative, must be relative to project) | str |
{program_path}\remote |