dfpyre 0.8.2__tar.gz → 0.8.3__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.
Potentially problematic release.
This version of dfpyre might be problematic. Click here for more details.
- {dfpyre-0.8.2 → dfpyre-0.8.3}/PKG-INFO +20 -3
- {dfpyre-0.8.2 → dfpyre-0.8.3}/README.md +19 -2
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/pyre.py +2 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/pyproject.toml +1 -1
- {dfpyre-0.8.2 → dfpyre-0.8.3}/LICENSE +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/__init__.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/action_literals.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/actiondump.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/data/actiondump_min.json +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/items.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/scriptgen.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/style.py +0 -0
- {dfpyre-0.8.2 → dfpyre-0.8.3}/dfpyre/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dfpyre
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: A package for creating and modifying code templates for the DiamondFire Minecraft server.
|
|
5
5
|
Home-page: https://github.com/Amp63/pyre
|
|
6
6
|
License: MIT
|
|
@@ -39,8 +39,10 @@ This module works best with [CodeClient](https://modrinth.com/mod/codeclient) in
|
|
|
39
39
|
- All code item types
|
|
40
40
|
- Direct sending to DF via recode or codeclient
|
|
41
41
|
- Automatic type conversion (int to num, str to text)
|
|
42
|
+
- Auto completed action names (if your IDE supports type hints)
|
|
42
43
|
- Warnings for unrecognized actions and tags
|
|
43
|
-
-
|
|
44
|
+
- Shorthand format for variables
|
|
45
|
+
- Convert existing templates into equivalent Python code (see [Script Generation](#script-generation))
|
|
44
46
|
|
|
45
47
|
## Documentation
|
|
46
48
|
## Basics
|
|
@@ -485,6 +487,21 @@ t.generate_script('my_template.py') # generated python script will be written
|
|
|
485
487
|
|
|
486
488
|
This feature is useful for getting a text representation of existing templates.
|
|
487
489
|
|
|
490
|
+
|
|
491
|
+
### Inserting Codeblocks
|
|
492
|
+
|
|
493
|
+
Use the `insert` method to insert additional codeblocks into an existing template. By default, codeblocks will be added to the end of the template.
|
|
494
|
+
|
|
495
|
+
```py
|
|
496
|
+
from dfpyre import *
|
|
497
|
+
|
|
498
|
+
my_template = player_event('Join', [
|
|
499
|
+
player_action('SendMessage', '%default has joined!', target=Target.ALL_PLAYERS)
|
|
500
|
+
])
|
|
501
|
+
my_template.insert(player_action('SendMessage', 'Welcome!')) # Add a new codeblock to the end
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
|
|
488
505
|
### Function List
|
|
489
506
|
|
|
490
507
|
- **Events / Function / Process**
|
|
@@ -500,7 +517,7 @@ This feature is useful for getting a text representation of existing templates.
|
|
|
500
517
|
- game_action
|
|
501
518
|
- entity_action
|
|
502
519
|
|
|
503
|
-
- **
|
|
520
|
+
- **Control Flow**
|
|
504
521
|
- if_player
|
|
505
522
|
- if_variable
|
|
506
523
|
- if_game
|
|
@@ -21,8 +21,10 @@ This module works best with [CodeClient](https://modrinth.com/mod/codeclient) in
|
|
|
21
21
|
- All code item types
|
|
22
22
|
- Direct sending to DF via recode or codeclient
|
|
23
23
|
- Automatic type conversion (int to num, str to text)
|
|
24
|
+
- Auto completed action names (if your IDE supports type hints)
|
|
24
25
|
- Warnings for unrecognized actions and tags
|
|
25
|
-
-
|
|
26
|
+
- Shorthand format for variables
|
|
27
|
+
- Convert existing templates into equivalent Python code (see [Script Generation](#script-generation))
|
|
26
28
|
|
|
27
29
|
## Documentation
|
|
28
30
|
## Basics
|
|
@@ -467,6 +469,21 @@ t.generate_script('my_template.py') # generated python script will be written
|
|
|
467
469
|
|
|
468
470
|
This feature is useful for getting a text representation of existing templates.
|
|
469
471
|
|
|
472
|
+
|
|
473
|
+
### Inserting Codeblocks
|
|
474
|
+
|
|
475
|
+
Use the `insert` method to insert additional codeblocks into an existing template. By default, codeblocks will be added to the end of the template.
|
|
476
|
+
|
|
477
|
+
```py
|
|
478
|
+
from dfpyre import *
|
|
479
|
+
|
|
480
|
+
my_template = player_event('Join', [
|
|
481
|
+
player_action('SendMessage', '%default has joined!', target=Target.ALL_PLAYERS)
|
|
482
|
+
])
|
|
483
|
+
my_template.insert(player_action('SendMessage', 'Welcome!')) # Add a new codeblock to the end
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
|
|
470
487
|
### Function List
|
|
471
488
|
|
|
472
489
|
- **Events / Function / Process**
|
|
@@ -482,7 +499,7 @@ This feature is useful for getting a text representation of existing templates.
|
|
|
482
499
|
- game_action
|
|
483
500
|
- entity_action
|
|
484
501
|
|
|
485
|
-
- **
|
|
502
|
+
- **Control Flow**
|
|
486
503
|
- if_player
|
|
487
504
|
- if_variable
|
|
488
505
|
- if_game
|
|
@@ -291,6 +291,8 @@ class DFTemplate:
|
|
|
291
291
|
else:
|
|
292
292
|
self.codeblocks[index:index+len(insert_codeblocks)] = insert_codeblocks
|
|
293
293
|
elif isinstance(insert_codeblocks, CodeBlock):
|
|
294
|
+
if index == -1:
|
|
295
|
+
index = len(self.codeblocks)
|
|
294
296
|
self.codeblocks.insert(index, insert_codeblocks)
|
|
295
297
|
else:
|
|
296
298
|
raise PyreException('Expected CodeBlock or list[CodeBlock] to insert.')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|