pyrecli 0.1.3__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyrecli-0.2.1/PKG-INFO +152 -0
- pyrecli-0.2.1/README.md +133 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyproject.toml +2 -1
- pyrecli-0.2.1/pyrecli/command/slice.py +21 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/pyrecli.py +31 -3
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/util.py +4 -2
- pyrecli-0.1.3/PKG-INFO +0 -66
- pyrecli-0.1.3/README.md +0 -48
- {pyrecli-0.1.3 → pyrecli-0.2.1}/LICENSE +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/__init__.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/docs.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/grabinv.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/rename.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/scan.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/script.py +0 -0
- {pyrecli-0.1.3 → pyrecli-0.2.1}/pyrecli/command/send.py +0 -0
pyrecli-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyrecli
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Command line utilities for DiamondFire templates
|
|
5
|
+
Home-page: https://github.com/Amp63/pyrecli
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: diamondfire,minecraft,template,cli
|
|
8
|
+
Author: Amp
|
|
9
|
+
Requires-Python: >=3.10,<3.13
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Dist: dfpyre (>=0.9.3,<0.10.0)
|
|
16
|
+
Project-URL: Repository, https://github.com/Amp63/pyrecli
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# pyrecli
|
|
20
|
+
|
|
21
|
+
Command line utilities for DiamondFire templates
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Run the following command in a terminal:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pip install pyrecli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
- `scan`: Scan all templates on the plot and dump them to a text file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
34
|
+
- `send`: Send template items to DiamondFire (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
35
|
+
- `rename`: Rename all occurences of a variable (including text codes)
|
|
36
|
+
- `script`: Generate python scripts from template data
|
|
37
|
+
- `grabinv`: Save all templates in your Minecraft inventory to a file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
38
|
+
- `docs`: Generate markdown documentation from template data
|
|
39
|
+
- `slice`: Slice a template into multiple smaller templates
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## What is this useful for?
|
|
43
|
+
|
|
44
|
+
- Backing up a plot
|
|
45
|
+
- Getting an accurate text representation of DF code
|
|
46
|
+
- Open sourcing
|
|
47
|
+
- Version control
|
|
48
|
+
- Large scale refactoring
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Example Command Usages
|
|
52
|
+
|
|
53
|
+
### Scan
|
|
54
|
+
|
|
55
|
+
**[Requires CodeClient]**
|
|
56
|
+
|
|
57
|
+
Grabs all of the templates on your current plot and saves them to a file.
|
|
58
|
+
You will need to run `/auth` in-game to authorize this action.
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
```sh
|
|
62
|
+
# Dumps all template data into templates.dfts
|
|
63
|
+
pyrecli scan templates.dfts
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Send
|
|
67
|
+
|
|
68
|
+
**[Requires CodeClient]**
|
|
69
|
+
|
|
70
|
+
Sends all templates in a file back to DiamondFire.
|
|
71
|
+
Essentially the reverse of `scan`.
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
```sh
|
|
75
|
+
pyrecli send templates.dfts
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Rename
|
|
79
|
+
|
|
80
|
+
Renames all occurences of a variable in a list of templates.
|
|
81
|
+
You can run this command on a single template, or on an entire plot if a variable is used in many places.
|
|
82
|
+
|
|
83
|
+
This command still requires thorough testing, so make sure you have a backup of your plot before using this command on a large scale.
|
|
84
|
+
|
|
85
|
+
Example:
|
|
86
|
+
```sh
|
|
87
|
+
# Changes all variables named `foo` to `bar`.
|
|
88
|
+
pyrecli rename templates.dfts foo bar
|
|
89
|
+
|
|
90
|
+
# You can also target a specific scope.
|
|
91
|
+
# This changes all occurences of the game variable `plotData` to `gameData`.
|
|
92
|
+
pyrecli rename templates.dfts plotData gameData -s game
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
By default, this modifies the input file in-place, but you can use the `--output_path` flag to output the renamed templates to a new file:
|
|
96
|
+
```sh
|
|
97
|
+
pyrecli rename templates.dfts foo bar --output_path renamed_templates.dfts
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Script
|
|
101
|
+
|
|
102
|
+
Generates Python scripts from template data.
|
|
103
|
+
|
|
104
|
+
Example:
|
|
105
|
+
```sh
|
|
106
|
+
# Convert templates into individual scripts and store them in directory `plot_templates`
|
|
107
|
+
pyrecli script templates.dfts plot_templates
|
|
108
|
+
|
|
109
|
+
# Convert templates into scripts and put them into a single file `plot_templates.py`
|
|
110
|
+
pyrecli script templates.dfts plot_templates.py --onefile
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### Grabinv
|
|
115
|
+
|
|
116
|
+
**[Requires CodeClient]**
|
|
117
|
+
|
|
118
|
+
Scans your inventory for templates and saves them to a file.
|
|
119
|
+
|
|
120
|
+
Example:
|
|
121
|
+
```sh
|
|
122
|
+
# Save inventory templates to `templates.dfts`
|
|
123
|
+
pyrecli grabinv templates.dfts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Docs
|
|
128
|
+
|
|
129
|
+
Generates a Markdown documentation file for a list of templates.
|
|
130
|
+
|
|
131
|
+
Example:
|
|
132
|
+
```sh
|
|
133
|
+
# Generate documentation and save it to `plot_docs.md`
|
|
134
|
+
pyrecli docs templates.dfts plot_docs.md "My Plot Docs"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Slice
|
|
139
|
+
|
|
140
|
+
Slices a single template into multiple smaller templates.
|
|
141
|
+
This is useful for resizing templates to fit on a smaller plot.
|
|
142
|
+
|
|
143
|
+
If multiple templates are passed, only the first one will be used.
|
|
144
|
+
|
|
145
|
+
**NOTE: This feature is not fully implemented yet. Any templates with Control::Return blocks may not work properly if sliced.**
|
|
146
|
+
|
|
147
|
+
Example:
|
|
148
|
+
```sh
|
|
149
|
+
# Slices the first template in `templates.dfts` with a target length of 50 and stores them in `sliced_templates.dfts`
|
|
150
|
+
pyrecli slice templates.dfts sliced_templates.dfts 50
|
|
151
|
+
```
|
|
152
|
+
|
pyrecli-0.2.1/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# pyrecli
|
|
2
|
+
|
|
3
|
+
Command line utilities for DiamondFire templates
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Run the following command in a terminal:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install pyrecli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
- `scan`: Scan all templates on the plot and dump them to a text file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
16
|
+
- `send`: Send template items to DiamondFire (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
17
|
+
- `rename`: Rename all occurences of a variable (including text codes)
|
|
18
|
+
- `script`: Generate python scripts from template data
|
|
19
|
+
- `grabinv`: Save all templates in your Minecraft inventory to a file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
20
|
+
- `docs`: Generate markdown documentation from template data
|
|
21
|
+
- `slice`: Slice a template into multiple smaller templates
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## What is this useful for?
|
|
25
|
+
|
|
26
|
+
- Backing up a plot
|
|
27
|
+
- Getting an accurate text representation of DF code
|
|
28
|
+
- Open sourcing
|
|
29
|
+
- Version control
|
|
30
|
+
- Large scale refactoring
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Example Command Usages
|
|
34
|
+
|
|
35
|
+
### Scan
|
|
36
|
+
|
|
37
|
+
**[Requires CodeClient]**
|
|
38
|
+
|
|
39
|
+
Grabs all of the templates on your current plot and saves them to a file.
|
|
40
|
+
You will need to run `/auth` in-game to authorize this action.
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
```sh
|
|
44
|
+
# Dumps all template data into templates.dfts
|
|
45
|
+
pyrecli scan templates.dfts
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Send
|
|
49
|
+
|
|
50
|
+
**[Requires CodeClient]**
|
|
51
|
+
|
|
52
|
+
Sends all templates in a file back to DiamondFire.
|
|
53
|
+
Essentially the reverse of `scan`.
|
|
54
|
+
|
|
55
|
+
Example:
|
|
56
|
+
```sh
|
|
57
|
+
pyrecli send templates.dfts
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Rename
|
|
61
|
+
|
|
62
|
+
Renames all occurences of a variable in a list of templates.
|
|
63
|
+
You can run this command on a single template, or on an entire plot if a variable is used in many places.
|
|
64
|
+
|
|
65
|
+
This command still requires thorough testing, so make sure you have a backup of your plot before using this command on a large scale.
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
```sh
|
|
69
|
+
# Changes all variables named `foo` to `bar`.
|
|
70
|
+
pyrecli rename templates.dfts foo bar
|
|
71
|
+
|
|
72
|
+
# You can also target a specific scope.
|
|
73
|
+
# This changes all occurences of the game variable `plotData` to `gameData`.
|
|
74
|
+
pyrecli rename templates.dfts plotData gameData -s game
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
By default, this modifies the input file in-place, but you can use the `--output_path` flag to output the renamed templates to a new file:
|
|
78
|
+
```sh
|
|
79
|
+
pyrecli rename templates.dfts foo bar --output_path renamed_templates.dfts
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Script
|
|
83
|
+
|
|
84
|
+
Generates Python scripts from template data.
|
|
85
|
+
|
|
86
|
+
Example:
|
|
87
|
+
```sh
|
|
88
|
+
# Convert templates into individual scripts and store them in directory `plot_templates`
|
|
89
|
+
pyrecli script templates.dfts plot_templates
|
|
90
|
+
|
|
91
|
+
# Convert templates into scripts and put them into a single file `plot_templates.py`
|
|
92
|
+
pyrecli script templates.dfts plot_templates.py --onefile
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Grabinv
|
|
97
|
+
|
|
98
|
+
**[Requires CodeClient]**
|
|
99
|
+
|
|
100
|
+
Scans your inventory for templates and saves them to a file.
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
```sh
|
|
104
|
+
# Save inventory templates to `templates.dfts`
|
|
105
|
+
pyrecli grabinv templates.dfts
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Docs
|
|
110
|
+
|
|
111
|
+
Generates a Markdown documentation file for a list of templates.
|
|
112
|
+
|
|
113
|
+
Example:
|
|
114
|
+
```sh
|
|
115
|
+
# Generate documentation and save it to `plot_docs.md`
|
|
116
|
+
pyrecli docs templates.dfts plot_docs.md "My Plot Docs"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Slice
|
|
121
|
+
|
|
122
|
+
Slices a single template into multiple smaller templates.
|
|
123
|
+
This is useful for resizing templates to fit on a smaller plot.
|
|
124
|
+
|
|
125
|
+
If multiple templates are passed, only the first one will be used.
|
|
126
|
+
|
|
127
|
+
**NOTE: This feature is not fully implemented yet. Any templates with Control::Return blocks may not work properly if sliced.**
|
|
128
|
+
|
|
129
|
+
Example:
|
|
130
|
+
```sh
|
|
131
|
+
# Slices the first template in `templates.dfts` with a target length of 50 and stores them in `sliced_templates.dfts`
|
|
132
|
+
pyrecli slice templates.dfts sliced_templates.dfts 50
|
|
133
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyrecli"
|
|
3
|
-
version = "0.1
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "Command line utilities for DiamondFire templates"
|
|
5
5
|
authors = ["Amp"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -11,6 +11,7 @@ keywords = ["diamondfire", "minecraft", "template", "cli"]
|
|
|
11
11
|
|
|
12
12
|
[tool.poetry.dependencies]
|
|
13
13
|
python = ">=3.10,<3.13"
|
|
14
|
+
dfpyre = "^0.9.3"
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
[tool.poetry.scripts]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from result import Result, Err
|
|
2
|
+
from pyrecli.util import read_input_file, write_output_file, parse_templates_from_string
|
|
3
|
+
|
|
4
|
+
def slice_command(input_path: str, output_path: str, target_length: int) -> Result[None, str]:
|
|
5
|
+
input_result = read_input_file(input_path)
|
|
6
|
+
if input_result.is_err():
|
|
7
|
+
return Err(input_result.err_value)
|
|
8
|
+
|
|
9
|
+
templates_result = parse_templates_from_string(input_result.ok_value)
|
|
10
|
+
if templates_result.is_err():
|
|
11
|
+
return Err(templates_result.err_value)
|
|
12
|
+
templates = templates_result.ok_value
|
|
13
|
+
|
|
14
|
+
if not templates:
|
|
15
|
+
return Err(f'Could not find any templates in {input_path}')
|
|
16
|
+
|
|
17
|
+
first_template = templates[0]
|
|
18
|
+
sliced_templates = first_template.slice(target_length)
|
|
19
|
+
built_templates = [t.build() for t in sliced_templates]
|
|
20
|
+
|
|
21
|
+
return write_output_file(output_path, '\n'.join(built_templates))
|
|
@@ -8,6 +8,23 @@ from pyrecli.command.script import script_command
|
|
|
8
8
|
from pyrecli.command.rename import rename_command
|
|
9
9
|
from pyrecli.command.grabinv import grabinv_command
|
|
10
10
|
from pyrecli.command.docs import docs_command
|
|
11
|
+
from pyrecli.command.slice import slice_command
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def rename_target_scope(value):
|
|
15
|
+
SCOPES = {'game', 'saved', 'local', 'line'}
|
|
16
|
+
if value not in SCOPES:
|
|
17
|
+
raise argparse.ArgumentTypeError(f'Expected one of {SCOPES} for rename target scope')
|
|
18
|
+
return value
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def slice_target_length(value):
|
|
23
|
+
MINIMUM_LENGTH = 5
|
|
24
|
+
ivalue = int(value)
|
|
25
|
+
if ivalue < MINIMUM_LENGTH:
|
|
26
|
+
raise argparse.ArgumentTypeError(f'Target length must be at least {MINIMUM_LENGTH} codeblocks')
|
|
27
|
+
return ivalue
|
|
11
28
|
|
|
12
29
|
|
|
13
30
|
def main():
|
|
@@ -35,19 +52,24 @@ def main():
|
|
|
35
52
|
parser_rename.add_argument('input_path', help='The file containing template data', type=str)
|
|
36
53
|
parser_rename.add_argument('var_to_rename', help='The variable to rename', type=str)
|
|
37
54
|
parser_rename.add_argument('new_var_name', help='The new name for the variable', type=str)
|
|
38
|
-
parser_rename.add_argument('--var_to_rename_scope', '-s', help='The scope to match', type=
|
|
39
|
-
parser_rename.add_argument('--output_path', '-o', help='The file
|
|
55
|
+
parser_rename.add_argument('--var_to_rename_scope', '-s', help='The scope to match', type=rename_target_scope, default=None)
|
|
56
|
+
parser_rename.add_argument('--output_path', '-o', help='The file to output to', type=str, default=None)
|
|
40
57
|
|
|
41
58
|
parser_grabinv = subparsers.add_parser('grabinv', help='Save all templates in the inventory to a file with CodeClient')
|
|
42
59
|
parser_grabinv.add_argument('output_path', help='The file to output template data to', type=str)
|
|
43
60
|
|
|
44
61
|
parser_docs = subparsers.add_parser('docs', help='Generate markdown documentation from template data')
|
|
45
62
|
parser_docs.add_argument('input_path', help='The file containing template data', type=str)
|
|
46
|
-
parser_docs.add_argument('output_path', help='The file
|
|
63
|
+
parser_docs.add_argument('output_path', help='The file to output to', type=str)
|
|
47
64
|
parser_docs.add_argument('title', help='The title for the docs', type=str)
|
|
48
65
|
parser_docs.add_argument('--include_hidden', '-ih', help='Include hidden functions and processes', action='store_true')
|
|
49
66
|
parser_docs.add_argument('--notoc', help='Omit the table of contents', action='store_true')
|
|
50
67
|
|
|
68
|
+
parser_slice = subparsers.add_parser('slice', help='Slice a template into multiple smaller templates')
|
|
69
|
+
parser_slice.add_argument('input_path', help='The file containing template data', type=str)
|
|
70
|
+
parser_slice.add_argument('output_path', help='The file to output template data to', type=str)
|
|
71
|
+
parser_slice.add_argument('target_length', help='The maximum length of each sliced template', type=slice_target_length)
|
|
72
|
+
|
|
51
73
|
parsed_args = parser.parse_args()
|
|
52
74
|
|
|
53
75
|
match parsed_args.command:
|
|
@@ -81,6 +103,12 @@ def main():
|
|
|
81
103
|
parsed_args.input_path, parsed_args.output_path,
|
|
82
104
|
parsed_args.title, parsed_args.include_hidden, parsed_args.notoc
|
|
83
105
|
)
|
|
106
|
+
|
|
107
|
+
case 'slice':
|
|
108
|
+
command_result = slice_command(
|
|
109
|
+
parsed_args.input_path, parsed_args.output_path,
|
|
110
|
+
parsed_args.target_length
|
|
111
|
+
)
|
|
84
112
|
|
|
85
113
|
if command_result.is_err():
|
|
86
114
|
print(command_result.err_value)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import re
|
|
3
|
+
import sys
|
|
3
4
|
from result import Result, Ok, Err
|
|
4
5
|
import websocket
|
|
5
6
|
from dfpyre import DFTemplate
|
|
@@ -47,9 +48,10 @@ def parse_templates_from_string(templates: str) -> Result[list[DFTemplate], str]
|
|
|
47
48
|
def read_input_file(path: str) -> Result[str, str]:
|
|
48
49
|
if path == '-':
|
|
49
50
|
try:
|
|
50
|
-
input_string =
|
|
51
|
+
input_string = sys.stdin.read()
|
|
51
52
|
except EOFError:
|
|
52
|
-
|
|
53
|
+
pass
|
|
54
|
+
return Ok(input_string.strip())
|
|
53
55
|
|
|
54
56
|
if not os.path.isfile(path):
|
|
55
57
|
return Err(f'"{path}" is not a file.')
|
pyrecli-0.1.3/PKG-INFO
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: pyrecli
|
|
3
|
-
Version: 0.1.3
|
|
4
|
-
Summary: Command line utilities for DiamondFire templates
|
|
5
|
-
Home-page: https://github.com/Amp63/pyrecli
|
|
6
|
-
License: MIT
|
|
7
|
-
Keywords: diamondfire,minecraft,template,cli
|
|
8
|
-
Author: Amp
|
|
9
|
-
Requires-Python: >=3.10,<3.13
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Project-URL: Repository, https://github.com/Amp63/pyrecli
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
|
|
18
|
-
# pyrecli
|
|
19
|
-
|
|
20
|
-
Command line utilities for DiamondFire templates
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
Run the following command in a terminal:
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
pip install pyrecli
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Commands
|
|
31
|
-
|
|
32
|
-
- `scan`: Scan all templates on the plot and dump them to a text file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
33
|
-
- `send`: Send template items to DiamondFire (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
34
|
-
- `rename`: Rename all occurences of a variable (including text codes)
|
|
35
|
-
- `script`: Generate python scripts from template data
|
|
36
|
-
- `grabinv`: Save all templates in your Minecraft inventory to a file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
37
|
-
- `docs`: Generate markdown documentation from template data
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## What is this useful for?
|
|
41
|
-
|
|
42
|
-
- Backing up a plot
|
|
43
|
-
- Getting an accurate text representation of DF code
|
|
44
|
-
- Open sourcing
|
|
45
|
-
- Version control
|
|
46
|
-
- Large scale refactoring
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Example Usage
|
|
50
|
-
|
|
51
|
-
These two commands will scan your plot, convert each template into a python script, then place the scripts into a directory called `myplot`.
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
pyrecli scan templates.dfts
|
|
55
|
-
pyrecli script templates.dfts myplot
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
If you prefer the templates to be outputted to a single file, use the `--onefile` flag:
|
|
59
|
-
|
|
60
|
-
```sh
|
|
61
|
-
pyrecli scan templates.dfts
|
|
62
|
-
pyrecli script templates.dfts myplot.py --onefile
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
For more information about generating scripts, run `pyrecli script -h`.
|
|
66
|
-
|
pyrecli-0.1.3/README.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# pyrecli
|
|
2
|
-
|
|
3
|
-
Command line utilities for DiamondFire templates
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Run the following command in a terminal:
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
pip install pyrecli
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Commands
|
|
14
|
-
|
|
15
|
-
- `scan`: Scan all templates on the plot and dump them to a text file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
16
|
-
- `send`: Send template items to DiamondFire (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
17
|
-
- `rename`: Rename all occurences of a variable (including text codes)
|
|
18
|
-
- `script`: Generate python scripts from template data
|
|
19
|
-
- `grabinv`: Save all templates in your Minecraft inventory to a file (requires [CodeClient](github.com/DFOnline/CodeClient))
|
|
20
|
-
- `docs`: Generate markdown documentation from template data
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## What is this useful for?
|
|
24
|
-
|
|
25
|
-
- Backing up a plot
|
|
26
|
-
- Getting an accurate text representation of DF code
|
|
27
|
-
- Open sourcing
|
|
28
|
-
- Version control
|
|
29
|
-
- Large scale refactoring
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Example Usage
|
|
33
|
-
|
|
34
|
-
These two commands will scan your plot, convert each template into a python script, then place the scripts into a directory called `myplot`.
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
pyrecli scan templates.dfts
|
|
38
|
-
pyrecli script templates.dfts myplot
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If you prefer the templates to be outputted to a single file, use the `--onefile` flag:
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
pyrecli scan templates.dfts
|
|
45
|
-
pyrecli script templates.dfts myplot.py --onefile
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
For more information about generating scripts, run `pyrecli script -h`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|