-
-
Notifications
You must be signed in to change notification settings - Fork 117
[Minor] Improving the way to read .shp
file names from INI
#1852
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
Merged
Coronia
merged 3 commits into
Phobos-developers:develop
from
DeathFishAtEase:Auto-Fill-file-extension
Sep 12, 2025
Merged
[Minor] Improving the way to read .shp
file names from INI
#1852
Coronia
merged 3 commits into
Phobos-developers:develop
from
DeathFishAtEase:Auto-Fill-file-extension
Sep 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Is this bug also present in 0.4? |
Coronia
approved these changes
Sep 12, 2025
DeathFishAtEase
added a commit
that referenced
this pull request
Sep 12, 2025
> 改进从 INI 中读取 `.shp` 文件名的方式 The original processing method would check if there is a file extension. If not, it would automatically add the `.shp` extension to read. This is a good safeguard, but there are two problems: > 原先的处理方式会检查是否有后缀名,如果没有,那么会自动补上 `.shp` 后缀来读取,这是一个不错的保障手段,但是存在两个问题: 1. It only strictly checks for lowercase `.shp`, meaning that `RING1.SHP` would be considered as *having **no** extension*, so it would automatically add to become `RING1.SHP.shp` for reading. > 只严格检查小写 `.shp`,也就是说 `RING1.SHP` 会被视为 **没有** 后缀,因此自动补充为 `RING1.SHP.shp` 来读取, 2. It does not strictly check whether it is an extension, meaning that `.shp.RING2` would be considered as *having **an** extension*, so it would not add, and actually try to read a file named `.shp.RING2`, rather than `.shp.RING2.shp`. > 不严格检查是否为后缀,也就是说 `.shp.RING2` 会被视为 **已有** 后缀,不会补充,并真的去读取名为 `.shp.RING2` 的文件,而不是 `.shp.RING2.shp`。 Now, some improvements have been made so that uppercase `.SHP` is ***not*** considered as *having **no** extension*, and at the same time, cases where `.shp` is not at the end are ***no longer*** considered as *having **an** extension*. > 现在对它们进行了一些改进,使得大写 `.SHP` **不会** 被视为 **没有** 后缀,同时 **不再** 将 `.shp` 不在末尾的情况视为 **已有** 后缀。 Expected effect of the current changes (`PDFXLOC` (red) as the original incorrect effect, `RING1` (blue) as the expected correct effect): > 当前更改的预期效果(`PDFXLOC`(红)作为原始的错误效果,`RING1`(蓝)作为预期的正确效果): <img width="736" height="613" alt="RING1 SHP" src="https://github.com/user-attachments/assets/470f5dd2-8290-45bc-8966-2ce436ebe20b" /> <img width="736" height="613" alt="RING2 shp A" src="https://github.com/user-attachments/assets/fb54ce79-d725-4306-bc97-59ad72e8e2af" /> - [x] Test has passed. > 测试通过。
DeathFishAtEase
added a commit
to DeathFishAtEase/Phobos
that referenced
this pull request
Sep 12, 2025
DeathFishAtEase
added a commit
to DeathFishAtEase/Phobos
that referenced
this pull request
Sep 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original processing method would check if there is a file extension. If not, it would automatically add the
.shp
extension to read. This is a good safeguard, but there are two problems:It only strictly checks for lowercase
.shp
, meaning thatRING1.SHP
would be considered as having no extension, so it would automatically add to becomeRING1.SHP.shp
for reading.It does not strictly check whether it is an extension, meaning that
.shp.RING2
would be considered as having an extension, so it would not add, and actually try to read a file named.shp.RING2
, rather than.shp.RING2.shp
.Now, some improvements have been made so that uppercase
.SHP
is not considered as having no extension, and at the same time, cases where.shp
is not at the end are no longer considered as having an extension.Expected effect of the current changes (
PDFXLOC
(red) as the original incorrect effect,RING1
(blue) as the expected correct effect):