Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyber #420

Merged
merged 8 commits into from
Jan 12, 2024
Merged

Cyber #420

merged 8 commits into from
Jan 12, 2024

Conversation

Schamper
Copy link
Member

Cyber

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Attention: 292 lines in your changes are missing coverage. Please review.

Comparison is base (079a077) 74.79% compared to head (e56574f) 73.91%.

Files Patch % Lines
dissect/target/helpers/cyber.py 18.31% 281 Missing ⚠️
dissect/target/loaders/cyber.py 68.42% 6 Missing ⚠️
dissect/target/tools/shell.py 68.75% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #420      +/-   ##
==========================================
- Coverage   74.79%   73.91%   -0.88%     
==========================================
  Files         269      271       +2     
  Lines       22085    22460     +375     
==========================================
+ Hits        16518    16601      +83     
- Misses       5567     5859     +292     
Flag Coverage Δ
unittests 73.91% <23.35%> (-0.88%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Schamper Schamper marked this pull request as ready for review October 23, 2023 22:47
@Schamper Schamper force-pushed the cyber branch 3 times, most recently from 074a99b to b8bf519 Compare December 28, 2023 20:37
Comment on lines +108 to +117
max_rows, max_cols = _get_win_size()

orig_row, _ = _get_cursor_pos()

_cursor_hide()
_cursor_move(orig_row, orig_col)

characters, remaining, (orig_row, orig_col), _ = _get_character_info(
buf, max_rows, max_cols, orig_row, orig_col
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the data on lines 222:232 are pretty similar, maybe an idea to put it in a _setup()? or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, put the setup and cleanup inside a context manager (maybe inside _get_terminal()) and let it return the information from _get_character_info

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a combination of setting stuff up and retrieving some info that's used slightly differently. I'm fine with this small amount of repetition because it's also pretty concise.

Comment on lines +98 to +101
if os.getenv("CYBER") == "💊":
matrix(buf, color, mask_space)
else:
nms(buf, color, mask_space)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An idea to put the with _set_terminal() context manager here? as both these functions use it in the same way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like the nms and matrix functions to be individually usable, so keeping the context manager in there is the best way.

@Schamper Schamper requested a review from Miauwkeru January 11, 2024 16:22
Copy link
Contributor

@Miauwkeru Miauwkeru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Schamper Schamper merged commit ab6a81e into main Jan 12, 2024
@Schamper Schamper deleted the cyber branch January 12, 2024 09:12
Poeloe pushed a commit that referenced this pull request Feb 29, 2024
Zawadidone pushed a commit to Zawadidone/dissect.target that referenced this pull request Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants