Activity 5 of the tutorial uses python-woc. The current tutorial still points to oscar.py. I've started already to replace all mentions of oscar.py by python-woc. However, some parts don't work any more.
@hrz6976, could you please have a look at the following problems and provide solutions on how to solve them? I will add them to PR #1 then.
(1) Should we add that python-woc only works on da5 (ssh to da5) and that one needs to call source /opt/rh/rh-python38/enable
(2) I already updated the code of exercises 5a, 5b, and 5c, but it still fails. Look at the following example (5b):
from oscar import Project
Project('notcake_gcad').url
This ends up in "AssertionError: WocMaps not initialized: call init_woc_objects() or supply a woc keyword argument". How to fix this?
(3) What about this list - is it still up to date or does it need some updating?
|
These are corresponding functions in oscar.py that open the .tch files listed below for a given entity. `/function_name` after a function name denotes the version of that function that returns a Generator object. |
|
|
|
1. `Author('...')` - initialized with a combination of name and email |
|
- `.blobs` |
|
- `.commit_shas/commits` |
|
- `.project_names` |
|
- `.files` |
|
- `.torvald` - returns the torvald path of an Author, i.e, who did this Author work |
|
with that also worked with Linus Torvald |
|
2. `Blob('...')` - initialized with SHA of blob |
|
- `.author` - returns timestamp, author name, and binary SHA of commit |
|
- `.commit_shas/commits` - commits removing this blob are not included |
|
- `.data` - content of the blob |
|
- `.file_sha(filename)` - compute blob sha from a file content |
|
- `.position` - get offset and length of blob data in storage |
|
- `.parent` |
|
- `.string_sha(string)` |
|
- `.tkns` - result of ctags run on this blob, if there were any |
|
3. `Commit('...')` - initialized with SHA of commit |
|
- `.blob_shas/blobs` |
|
- `.child_shas/children` |
|
- `.changed_file_names/files_changed` |
|
- `.parent_shas/parents` |
|
- `.project_names/projects` |
|
- `.attributes` - time, tz, author, tree, parent(s) |
|
- `.tdiff` |
|
4. Deprecated, see [#50](https://github.com/ssc-oscar/oscar.py/issues/50): `File('...')` - initialized with a path, starting from a commit root tree |
|
- `.authors` |
|
- `.blobs` |
|
- `.commit_shas/commits` |
|
5. `Project('...')` - initialized with project name/URI |
|
- `.author_names` |
|
- `.commit_shas/commits` |
|
6. `Tdiff('...')` - initialized with SHA, result of diff run on 2 blobs (if there was a diff) |
|
- `.commit` |
|
- `.file` |
|
7. `Tree('...')` - representation of a git tree object (dir), initialized with SHA of tree |
|
- `.files` |
|
- `.blob_shas/blobs` |
|
- `.commit_shas/commits` |
|
- `.traverse` |
Activity 5 of the tutorial uses python-woc. The current tutorial still points to oscar.py. I've started already to replace all mentions of oscar.py by python-woc. However, some parts don't work any more.
@hrz6976, could you please have a look at the following problems and provide solutions on how to solve them? I will add them to PR #1 then.
(1) Should we add that python-woc only works on da5 (ssh to da5) and that one needs to call source /opt/rh/rh-python38/enable
(2) I already updated the code of exercises 5a, 5b, and 5c, but it still fails. Look at the following example (5b):
This ends up in "AssertionError: WocMaps not initialized: call init_woc_objects() or supply a woc keyword argument". How to fix this?
(3) What about this list - is it still up to date or does it need some updating?
worldofcode.org/docs/tutorial.md
Lines 494 to 534 in 1164f50