Omoospace
Creator
Bases: ProfileItem
Creator
Attributes:
Name | Type | Description |
---|---|---|
email |
str
|
Creator email |
name |
str
|
Creator name |
website |
str
|
Creator website. |
role |
str
|
Creator role in omoospace. |
Source code in omoospace\omoospace.py
Omoospace
Bases: ProfileContainer
The class of omoospace.
An omoospace class instance is always refer to a existed omoospace directory, not dummy.
Usage:
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Omoospace name. |
description |
str
|
Omoospace description. |
Source code in omoospace\omoospace.py
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 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 |
|
contents_path: Path
property
Path: Contents directory path.
creators: list[Creator]
property
list[Creator]: Creator List
directory_tree: DirectoryTree
property
DirectoryTree: The directory tree of this omoospace.
entities: list[Entity]
property
list[Entity]: the subspace entities in the sourcefiles directory.
externaldata_path: Path
property
Path: ExternalData directory path.
imported_packages: list[Package]
property
list[Package]: The imported package list of this omoospace.
profile_path: Path
property
Path: Omoospace.yml file path.
references_path: Path
property
Path: Reference directory path.
root_path: Path
property
Path: Root path.
softwares: list[Software]
property
list[Software]: Software List
sourcefiles_path: Path
property
Path: SourceFiles directory path.
stageddata_path: Path
property
Path: StagedData directory path.
subspace_tree: SubspaceTree
property
SubspaceTree: The subspace tree of this omoospace.
subspace_tree_dict: dict
property
dict: The tree dict of subspace tree.
works: list[Work]
property
list[Work]: Work List
__init__(detect_dir)
Initialize from existed omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
detect_dir |
PathLike
|
The start directory for detecting omoospace. It could be the subdirectories of omoospace. |
required |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Omoospace's name. |
description |
str
|
Omoospace's description. |
Raises:
Type | Description |
---|---|
NotFoundError
|
No omoospace detected. |
Source code in omoospace\omoospace.py
add_creator(email, name, website=None, role=None)
Add creator to this omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
email |
str
|
Creator email |
required |
name |
str
|
Creator name |
required |
website |
str
|
Creator website. Defaults to None. |
None
|
role |
str
|
Creator role in omoospace. Defaults to None. |
None
|
Raises:
Type | Description |
---|---|
InvalidError
|
Invalid email. |
InvalidError
|
Invalid website. |
Returns:
Name | Type | Description |
---|---|---|
Creator |
Creator
|
New added creator. |
Source code in omoospace\omoospace.py
add_process(*processes, parent_dir=None, add_sequence_number=True, reveal_in_explorer=True)
Add process to this omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*processes |
str
|
a name list of processes, or single process name. |
()
|
parent_dir |
PathLike
|
Add process to which directory.. Defaults to None. |
None
|
add_sequence_number |
str
|
Add sequence number to name. Defaults to True |
True
|
reveal_in_explorer |
bool
|
Whether open directory after or not. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ExistsError
|
Target path already has one. |
NotIncludeError
|
Parent directory is outside SourceFiles. |
CreateFailed
|
Cannot create directory. |
Source code in omoospace\omoospace.py
add_software(name, version, plugins=None)
Add software to this omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Software name |
required |
version |
str
|
Software version. |
required |
plugins |
list[Plugin]
|
Software plugins. Defaults to None. |
None
|
Raises:
Type | Description |
---|---|
InvalidError
|
Invalid version. |
InvalidError
|
Invalid plugin. |
Returns:
Name | Type | Description |
---|---|---|
Software |
Software
|
New added software. |
Source code in omoospace\omoospace.py
add_subspace(name, parent_dir=None, description=None, reveal_in_explorer=True, collect_entities=True)
Add subspace to this omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Subspace name |
required |
parent_dir |
PathLike
|
Add subspace to which directory. Defaults to None. |
None
|
description |
str
|
str = Subspace description. Defaults to None. |
None
|
reveal_in_explorer |
bool
|
Whether open directory after or not. Defaults to True. |
True
|
collect_entities |
bool
|
Whether collect relative entities into it or not. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ExistsError
|
Target path already has one. |
NotIncludeError
|
Parent directory is outside SourceFiles. |
MoveFailed
|
Cannot move files. |
CreateFailed
|
Cannot create directory. |
Returns:
Name | Type | Description |
---|---|---|
Subspace |
Subspace
|
New added subspace. |
Source code in omoospace\omoospace.py
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
add_work(*items, name=None, description=None)
Add work to this omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*items |
list[PathLike]
|
Work items. |
()
|
name |
str
|
Work name. Defaults to None. |
None
|
description |
str
|
Work description. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Work |
Work
|
New added work. |
Source code in omoospace\omoospace.py
export_package(*items, name=None, export_dir='.', description=None, version='0.1.0', reveal_in_explorer=True, overwrite_existing=True)
Export a package.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*items |
PathLike
|
Items to export. |
()
|
name |
str
|
Package name. Defaults to None. |
None
|
export_dir |
PathLike
|
Package export directory. Defaults to None. |
'.'
|
description |
str
|
Package description. Defaults to None. |
None
|
reveal_in_explorer |
bool
|
Whether open directory after or not. Defaults to True. |
True
|
overwrite_existing |
bool
|
Whether overwrite existing or not. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ExistsError
|
Target path already exists. |
NotFoundError
|
No vaild item found. |
Returns:
Name | Type | Description |
---|---|---|
Package |
Package
|
New exported package. |
Source code in omoospace\omoospace.py
get_creator(email)
get_software(name)
get_subspace(identify)
Get subspace object by route or entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
identify |
Union[Route, PathLike]
|
Could be route or entity path |
required |
Raises:
Type | Description |
---|---|
TypeError
|
Not vaild identify type |
Returns:
Name | Type | Description |
---|---|---|
Subspace |
Subspace
|
The wanted subspace. |
Source code in omoospace\omoospace.py
get_work(name)
import_package(package_path, reveal_in_explorer=True, overwrite_existing=True)
Imports the package into the ExternalData directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
package_path |
PathLike
|
Package directory. |
required |
reveal_in_explorer |
bool
|
Whether open directory after or not. Defaults to True. |
True
|
overwrite_existing |
bool
|
Whether overwrite existing or not. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ExistsError
|
Target path already exists. |
Source code in omoospace\omoospace.py
is_contents_item(path)
Check if path is contents item
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
Input |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
result |
Source code in omoospace\omoospace.py
is_omoospace_item(path)
Check if path is this omoospace item
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
Input |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
result |
Source code in omoospace\omoospace.py
Software
Bases: ProfileItem
Software
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Software name |
version |
str
|
Software version. |
Source code in omoospace\omoospace.py
plugins: list[Plugin]
property
list[Plugin]: Software plugin list.
set_plugin(name, version)
Add or change plugin.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Plugin name. |
required |
version |
str
|
Plugin version. |
required |
Source code in omoospace\omoospace.py
Work
Bases: ProfileItem
Work
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Work name. |
description |
str
|
Work description. |
Source code in omoospace\omoospace.py
items: list[str]
property
list[str]: Work item list.
add_item(*items)
Add item to this work.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*items |
PathLike
|
Item paths. |
()
|
Source code in omoospace\omoospace.py
set_items(*items)
Set items to this work. Replace current itmes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*items |
PathLike
|
Item paths. |
()
|
create_omoospace(name, root_dir='.', description=None, structure=None, reveal_in_explorer=True)
Create an omoospace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Omoospace name |
required |
root_dir |
PathLike
|
Add omoospace to which directory. Defaults to '.'. |
'.'
|
description |
str
|
Omoospace description. Defaults to None. |
None
|
structure |
OmoospaceStructure
|
Omoospace structure. Defaults to None. |
None
|
reveal_in_explorer |
bool
|
Whether open directory after or not. Defaults to True. |
True
|
Raises:
Type | Description |
---|---|
ExistsError
|
Target path already exists. |
CreateFailed
|
Fail to create directories. |
Returns:
Name | Type | Description |
---|---|---|
Omoospace |
Omoospace
|
New created omoospace. |