Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TranSSD-Python
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Justus Müller
TranSSD-Python
Commits
4e04bea9
Commit
4e04bea9
authored
Jun 27, 2024
by
Justus Müller
Browse files
Options
Downloads
Patches
Plain Diff
feat: Make pattern changeable
parent
5f0d3ef2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/drive_handle.py
+2
-2
2 additions, 2 deletions
src/drive_handle.py
src/tests/slack_test.py
+1
-1
1 addition, 1 deletion
src/tests/slack_test.py
with
3 additions
and
3 deletions
src/drive_handle.py
+
2
−
2
View file @
4e04bea9
...
@@ -134,7 +134,7 @@ class DriveHandle:
...
@@ -134,7 +134,7 @@ class DriveHandle:
return
True
return
True
return
False
return
False
def
write_pattern
(
self
)
->
None
:
def
write_pattern
(
self
,
symbol
:
chr
)
->
None
:
"""
"""
Writes the pattern file to the disk
Writes the pattern file to the disk
...
@@ -142,7 +142,7 @@ class DriveHandle:
...
@@ -142,7 +142,7 @@ class DriveHandle:
symbol (chr): The symbol the pattern file shall be filled with
symbol (chr): The symbol the pattern file shall be filled with
"""
"""
print
(
colored
(
"
[DriveHandle] Writing a pattern to the raw disk.
"
,
"
light_grey
"
))
print
(
colored
(
"
[DriveHandle] Writing a pattern to the raw disk.
"
,
"
light_grey
"
))
pattern_symbol
:
bytes
=
b
'
A
'
*
512
pattern_symbol
:
bytes
=
symbol
.
encode
()
*
512
progressbar
=
Spinner
(
'
[DriveHandle] Writing the pattern
'
)
progressbar
=
Spinner
(
'
[DriveHandle] Writing the pattern
'
)
volume_path
=
subprocess
.
check_output
([
'
powershell.exe
'
,
f
'
(Get-Volume -DriveLetter
{
self
.
_drive_letter
}
).UniqueID
'
]).
decode
(
"
utf-8
"
).
replace
(
"
\r\n
"
,
""
)
volume_path
=
subprocess
.
check_output
([
'
powershell.exe
'
,
f
'
(Get-Volume -DriveLetter
{
self
.
_drive_letter
}
).UniqueID
'
]).
decode
(
"
utf-8
"
).
replace
(
"
\r\n
"
,
""
)
...
...
This diff is collapsed.
Click to expand it.
src/tests/slack_test.py
+
1
−
1
View file @
4e04bea9
...
@@ -27,7 +27,7 @@ class SlackTest(DecisionTest):
...
@@ -27,7 +27,7 @@ class SlackTest(DecisionTest):
print
(
colored
(
"
[SlackTest] Running the slack test!
"
,
'
light_blue
'
))
print
(
colored
(
"
[SlackTest] Running the slack test!
"
,
'
light_blue
'
))
# create pattern
# create pattern
self
.
drive_handle
.
write_pattern
()
self
.
drive_handle
.
write_pattern
(
'
A
'
)
self
.
drive_handle
.
flush_cache
()
self
.
drive_handle
.
flush_cache
()
print
(
"
[SlackTest] Waiting 120s for OS to flush the cache...
"
)
print
(
"
[SlackTest] Waiting 120s for OS to flush the cache...
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment