Skip to content

Commit 5a07629

Browse files
authored
Remove FolderStore .dat legacy extension (#1078)
* Breaking: Fix FolderStore .dat extention legacy * use get in show AbstractDFG * Update NEWS --------- Co-authored-by: Johannes Terblanche <[email protected]>
1 parent 82e6588 commit 5a07629

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Listing news on any major breaking changes in DFG. For regular changes, see integrated Github.com project milestones for DFG.
2+
3+
# v0.24
4+
5+
- Remove `FolderStore` `.dat` legacy extension. To upgrade a legacy FolderStore remove extention with something like: `foreach(f->mv(f,split(f,".")[1]), files)`
6+
27
# v0.23
8+
39
- save/loadDFG now users Tar.jl and CodecZlib.jl #351.
410
- save/loadDFG now preserves meta fields #921.
511
- Deprecate getNeighbors for listNeighbors.

src/DataBlobs/services/BlobStores.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ function FolderStore(foldername::String; createfolder = true)
190190
return FolderStore{Vector{UInt8}}(:default_folder_store, foldername)
191191
end
192192

193-
blobfilename(store::FolderStore, blobId::UUID) = joinpath(store.folder, "$blobId.dat")
193+
blobfilename(store::FolderStore, blobId::UUID) = joinpath(store.folder, string(blobId))
194194

195195
function getBlob(store::FolderStore{T}, blobId::UUID) where {T}
196-
blobfilename = joinpath(store.folder, "$blobId.dat")
196+
blobfilename = joinpath(store.folder, string(blobId))
197197
if isfile(blobfilename)
198198
open(blobfilename) do f
199199
return read(f)
@@ -204,7 +204,7 @@ function getBlob(store::FolderStore{T}, blobId::UUID) where {T}
204204
end
205205

206206
function addBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
207-
blobfilename = joinpath(store.folder, "$blobId.dat")
207+
blobfilename = joinpath(store.folder, string(blobId))
208208
if isfile(blobfilename)
209209
throw(KeyError("Key '$blobId' blob already exists."))
210210
else
@@ -217,7 +217,7 @@ function addBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
217217
end
218218

219219
function updateBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
220-
blobfilename = joinpath(store.folder, "$blobId.dat")
220+
blobfilename = joinpath(store.folder, string(blobId))
221221
if !isfile(blobfilename)
222222
@warn "Key '$blobId' doesn't exist."
223223
else
@@ -229,7 +229,7 @@ function updateBlob!(store::FolderStore{T}, blobId::UUID, data::T) where {T}
229229
end
230230

231231
function deleteBlob!(store::FolderStore{T}, blobId::UUID) where {T}
232-
blobfilename = joinpath(store.folder, "$blobId.dat")
232+
blobfilename = joinpath(store.folder, string(blobId))
233233

234234
data = getBlob(store, blobId)
235235
rm(blobfilename)
@@ -238,7 +238,7 @@ end
238238

239239
#hasBlob or existsBlob?
240240
function hasBlob(store::FolderStore, blobId::UUID)
241-
blobfilename = joinpath(store.folder, "$blobId.dat")
241+
blobfilename = joinpath(store.folder, string(blobId))
242242
return isfile(blobfilename)
243243
end
244244

src/services/CustomPrinting.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ end
209209

210210
function Base.show(io::IO, dfg::AbstractDFG)
211211
summary(io, dfg)
212-
println(io, "\n UserLabel: ", dfg.userLabel)
213-
println(io, " RobotLabel: ", dfg.robotLabel)
214-
println(io, " SessionLabel: ", dfg.sessionLabel)
215-
println(io, " Description: ", dfg.description)
212+
println(io, "\n UserLabel: ", getUserLabel(dfg))
213+
println(io, " RobotLabel: ", getRobotLabel(dfg))
214+
println(io, " SessionLabel: ", getSessionLabel(dfg))
215+
println(io, " Description: ", getDescription(dfg))
216216
println(io, " Nr variables: ", length(ls(dfg)))
217217
println(io, " Nr factors: ", length(lsf(dfg)))
218218
println(io, " User Data: ", keys(getUserData(dfg)))

0 commit comments

Comments
 (0)