-
Notifications
You must be signed in to change notification settings - Fork 324
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
Sort output of S3_File.list
and Enso_File.list
#11929
Changes from 13 commits
53e4da8
21f017d
ee11a77
1780552
d151d5d
4ebf3f3
413e901
a771429
85e9ac1
cbb9fa7
f584add
d1acf61
86f8879
3eab006
46621d0
7f05c32
ce1b578
f9f9c72
cb4f970
72b045a
4cb2a19
7dede39
2b68104
b5b5ff6
1a0880a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,7 +187,7 @@ type S3_File | |
S3_File.Value (S3_Path.Value bucket key) self.credentials | ||
files = pair.second . map key-> | ||
S3_File.Value (S3_Path.Value bucket key) self.credentials | ||
sub_folders + files | ||
(sub_folders + files) . sort | ||
|
||
## ALIAS load bytes, open bytes | ||
ICON data_input | ||
|
@@ -616,3 +616,11 @@ translate_file_errors related_file result = | |
s3_path = S3_Path.Value error.bucket error.key | ||
s3_file = S3_File.Value s3_path related_file.credentials | ||
Error.throw (File_Error.Not_Found s3_file) | ||
|
||
type S3_File_Comparator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This type should probably be marked as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
compare x y = Ordering.compare x.s3_path y.s3_path | ||
|
||
hash x = S3_File_Comparator.hash_builtin x | ||
hash_builtin x = @Builtin_Method "Default_Comparator.hash_builtin" | ||
|
||
Comparable.from that:S3_File = Comparable.new that S3_File_Comparator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we tag these as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import project.Any.Any | ||
import project.Data.Color.Color | ||
import project.Data.Json.JS_Object | ||
import project.Data.Ordering.Comparable | ||
import project.Data.Ordering.Ordering | ||
import project.Data.Numbers.Integer | ||
import project.Data.Text.Encoding.Encoding | ||
import project.Data.Text.Text | ||
|
@@ -444,10 +446,11 @@ type Enso_File | |
if self.is_directory.not then Error.throw (Illegal_Argument.Error "Cannot `list` a non-directory.") else | ||
# Remove secrets from the list - they are handled separately in `Enso_Secret.list`. | ||
assets = list_assets self . filter f-> f.asset_type != Enso_Asset_Type.Secret | ||
assets.map asset-> | ||
results = assets.map asset-> | ||
file = Enso_File.Value (self.enso_path.resolve asset.name) | ||
Asset_Cache.update file asset | ||
file | ||
results.sort | ||
|
||
## GROUP Output | ||
ICON folder_add | ||
|
@@ -583,3 +586,11 @@ File_Like.from (that : Enso_File) = File_Like.Value that | |
## PRIVATE | ||
Writable_File.from (that : Enso_File) = if Data_Link.is_data_link that then Data_Link_Helpers.interpret_data_link_as_writable_file that else | ||
Writable_File.Value that Enso_File_Write_Strategy.instance | ||
|
||
type Enso_File_Comparator | ||
compare x y = Ordering.compare x.enso_path y.enso_path | ||
|
||
hash x = Enso_File_Comparator.hash_builtin x | ||
hash_builtin x = @Builtin_Method "Default_Comparator.hash_builtin" | ||
|
||
Comparable.from that:Enso_File = Comparable.new that Enso_File_Comparator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
private | ||
|
||
import project.Data.Ordering.Comparable | ||
import project.Data.Ordering.Ordering | ||
import project.Data.Ordering.Vector_Lexicographic_Order | ||
import project.Data.Text.Text | ||
import project.Data.Vector.Vector | ||
import project.Enso_Cloud.Enso_File.Enso_File | ||
import project.Enso_Cloud.Enso_User.Enso_User | ||
import project.Error.Error | ||
import project.Errors.Illegal_Argument.Illegal_Argument | ||
import project.Errors.Unimplemented.Unimplemented | ||
import project.Internal.Ordering_Helpers.Default_Comparator | ||
import project.Internal.Path_Helpers | ||
import project.Nothing.Nothing | ||
from project.Data.Boolean import Boolean, False, True | ||
|
@@ -72,3 +76,11 @@ normalize segments = | |
## We need to call normalize again, because technically a path `enso://a/../~/../../~` is a valid path | ||
that points to the user home and it should be correctly normalized, but requires numerous passes to do so. | ||
@Tail_Call normalize new_segments | ||
|
||
type Enso_Path_Comparator | ||
compare x y = Vector_Lexicographic_Order.compare x.path_segments y.path_segments | ||
|
||
hash x = Enso_Path_Comparator.hash_builtin x | ||
hash_builtin x = @Builtin_Method "Default_Comparator.hash_builtin" | ||
|
||
Comparable.from that:Enso_Path = Comparable.new that Enso_Path_Comparator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;-)
It would be easier to change the IDE to not display
from
methods in the component browser than adding this## PRIVATE
at every conversion method occurrence.