ProfiWiki API Documentation
docker
Created on 2023-04-01
@author: wf
ProfiWikiContainer
a profiwiki docker container wrapper
Source code in profiwiki/docker.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 |
|
__init__(dc)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dc(DockerContainer) |
the to wrap |
required |
Source code in profiwiki/docker.py
18 19 20 21 22 23 |
|
install_and_run_script(script, script_path)
install and run the given script
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script(str) |
the source code of the script |
required | |
script_path(str) |
the path to copy the script to and then execute |
required |
Source code in profiwiki/docker.py
80 81 82 83 84 85 86 87 88 89 90 91 |
|
install_fontawesome()
install fontawesome to this container
Source code in profiwiki/docker.py
93 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 |
|
install_plantuml()
install plantuml to this container
Source code in profiwiki/docker.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
killremove(volumes=False)
kill and remove me
Parameters:
Name | Type | Description | Default |
---|---|---|---|
volumes(bool) |
if True remove anonymous volumes associated with the container, default=True (to avoid e.g. passwords to get remembered / stuck |
required |
Source code in profiwiki/docker.py
47 48 49 50 51 52 53 54 55 56 57 |
|
log_action(action)
log the given action
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action(str) |
the d |
required |
Source code in profiwiki/docker.py
25 26 27 28 29 30 31 32 33 34 35 |
|
start_cron()
Starting periodic command scheduler: cron.
Source code in profiwiki/docker.py
59 60 61 62 63 |
|
upload(text, path)
upload the given text to the given path
Source code in profiwiki/docker.py
37 38 39 40 41 42 43 44 45 |
|
patch
Created on 2023-04-09
@author: wf
Patch
A class for patch a text file
Source code in profiwiki/patch.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
__init__(file_path)
Initializes a Patch instance with the file path file to be patched.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
The file path of the PHP file to be patched. |
required |
Source code in profiwiki/patch.py
15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
add_text(text, avoid_duplication=True)
Adds text avoiding duplication if specified
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
the text to add |
required |
avoid_duplication(bool) |
if True avoid duplication of existing lines |
required |
Source code in profiwiki/patch.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
patch_mediawiki_config_var(var_name, var_value)
Patches a MediaWiki configuration variable in the PHP file with the given name and value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var_name |
str
|
The name of the configuration variable to be patched. |
required |
var_value |
str
|
The new value to be set for the configuration variable. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in profiwiki/patch.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
save()
save my lines
Source code in profiwiki/patch.py
29 30 31 32 33 34 35 |
|
profiwiki_cmd
Created on 2023-04-01
@author: wf
ProfiWikiCmd
ProfiWiki command line
Source code in profiwiki/profiwiki_cmd.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 |
|
get_arg_parser(config, description, version_msg)
Setup command line argument parser
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config(MwClusterConfig) |
the mediawiki cluster configuration |
required | |
description(str) |
the description |
required | |
version_msg(str) |
the version message |
required |
Returns:
Name | Type | Description |
---|---|---|
ArgumentParser |
ArgumentParser
|
the argument parser |
Source code in profiwiki/profiwiki_cmd.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
optional_debug(args)
start the remote debugger if the arguments specify so
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
The command line arguments |
required |
Source code in profiwiki/profiwiki_cmd.py
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 |
|
main(argv=None)
main program.
Source code in profiwiki/profiwiki_cmd.py
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 |
|
profiwiki_core
Created on 2023-04-01
@author: wf
ProfiWiki
ProfiWiki
Source code in profiwiki/profiwiki_core.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|
__init__(prefix='pw', smw_version='4.1.3', mw_version='1.39.8', port=9079)
constructor
Source code in profiwiki/profiwiki_core.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
apache_config(mwApp)
get the apache configuration for the given mediawiki Docker application
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mwApp(DockerApplication) |
the docker application to generate the configuration for |
required |
Source code in profiwiki/profiwiki_core.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|
check(mwApp)
check
Source code in profiwiki/profiwiki_core.py
296 297 298 299 300 |
|
check_wikiuser(mwApp)
Source code in profiwiki/profiwiki_core.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
|
create(mwApp, forceRebuild=False)
create a profiwiki mediawiki
Source code in profiwiki/profiwiki_core.py
302 303 304 305 306 |
|
down(mwApp, forceRebuild=False)
shut down the profiwiki base mediawiki
Source code in profiwiki/profiwiki_core.py
308 309 310 311 312 |
|
getMwApp(withGenerate=True)
get my mediawiki Docker application
Source code in profiwiki/profiwiki_core.py
171 172 173 174 175 176 177 178 179 180 181 |
|
getMwCluster(withGenerate=True)
get a mediawiki Cluster for my configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
withGenerate(bool) |
if True regenerate the configuration files |
required |
Returns:
Name | Type | Description |
---|---|---|
MediaWikiCluster |
MediaWikiCluster
|
the MediaWiki Cluser |
Source code in profiwiki/profiwiki_core.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
getProfiWikiContainers(mwApp)
get the two containers - for mediawiki and the database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mwApp(DockerApplication) |
the MediaWiki Docker Application |
required |
Returns:
Name | Type | Description |
---|---|---|
Tuple |
(ProfiWikiContainer, ProfiWikiContainer)
|
MediaWiki, Database |
Source code in profiwiki/profiwiki_core.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
list(mwApp)
list the profi wikis
Source code in profiwiki/profiwiki_core.py
314 315 316 317 318 319 |
|
patch(pwc)
apply profi wiki patches to the given ProfiWikiContainer
Source code in profiwiki/profiwiki_core.py
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
system_info()
collect system information
Source code in profiwiki/profiwiki_core.py
79 80 81 82 83 84 85 86 87 88 89 |
|
update(mwApp)
run the update script
Source code in profiwiki/profiwiki_core.py
290 291 292 293 294 |
|
work(args)
work as instructed by the arguments
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args(Namespace) |
the command line arguments |
required |
Source code in profiwiki/profiwiki_core.py
91 92 93 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 |
|
version
Created on 2023-04-01
@author: wf
Version
Bases: object
Version handling for ProfiWiki
Source code in profiwiki/version.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|