remote
Higher-level functionality around synchronizing with different EnderCherts
fetch_remotes_from_a_remote_ender_chest(uri)
Grab the list of EnderChests registered with the specified remote EnderChest
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri |
URI
|
The URI to the remote Minecraft root |
required |
Returns:
Type | Description |
---|---|
list of (URI, str) tuples
|
The URIs of the remote EnderChests, paired with their aliases |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the remote list could not be pulled |
Source code in enderchest/remote.py
load_remote_ender_chest(uri)
Load an EnderChest configuration from another machine
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri |
URI
|
The URI to the remote Minecraft root |
required |
Returns:
Type | Description |
---|---|
EnderChest
|
The remote EnderChest configuration |
Raises:
Type | Description |
---|---|
ValueError
|
If the provided URI is invalid |
RuntimeError
|
If the config from the remote EnderChest could not be parsed |
Source code in enderchest/remote.py
sync_with_remotes(minecraft_root, pull_or_push, dry_run=False, sync_confirm_wait=None, **sync_kwargs)
Pull changes from or push changes to remote EnderChests
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minecraft_root |
Path
|
The root directory that your minecraft stuff (or, at least, the one that's the parent of your EnderChest folder). This will be used to construct relative paths. |
required |
pull_or_push |
str
|
"pull" or "push" |
required |
dry_run |
bool
|
Perform a dry run of the sync operation, reporting the operations that will be performed but not actually carrying them out |
False
|
sync_confirm_wait |
bool or int
|
The default behavior when syncing EnderChests is to first perform a dry
run of every sync operation and then wait 5 seconds before proceeding with the
real sync. The idea is to give the user time to interrupt the sync if
the dry run looks wrong. This can be changed by either raising or lowering
the value of confirm, by disabling the dry-run-first behavior entirely
( |
None
|
sync_kwargs |
Any additional arguments that should be passed into the syncing operation |
{}
|
Notes
- When pulling changes, this method will try each remote in the order they are configured and stop once it has successfully pulled from a remote.
This method will attempt to push local changes to every remote
Source code in enderchest/remote.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|