Comments (7)
Yeah, this is pretty annoying. I have the following little patch applied but it can cause some false positives when piping git status
output, for example:
diff --git a/src/parse.py b/src/parse.py
index 8ee9175..1e2283e 100644
--- a/src/parse.py
+++ b/src/parse.py
@@ -22,10 +22,10 @@ import logger
REPOS = ['www']
MASTER_REGEX = re.compile(
- '(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9\-_.]+\.[a-zA-Z0-9]{1,10})[:-]{0,1}(\d+)?')
+ '(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9\-_.]+)[:-]{0,1}(\d+)?')
OTHER_BGS_RESULT_REGEX = re.compile(
'(\/?([a-z.A-Z0-9\-_]+\/)+[a-zA-Z0-9_.]{3,})[:-]{0,1}(\d+)')
-JUST_FILE = re.compile('([a-zA-Z0-9\-_]+\.[a-zA-Z]{1,10})\s+')
+JUST_FILE = re.compile('([a-zA-Z0-9\-_.]+)\s+')
FILE_NO_PERIODS = re.compile(
'([a-zA-Z0-9\-_\/]{1,}\/[a-zA-Z0-9\-_]{1,})(\s|$|:)+')
Between this bug and #18, the released fpp
is unusable on most of my repositories. But that diff makes it work well enough.
from pathpicker.
Why not just use something like os.path.isfile(pathname)
to detect files?
from pathpicker.
@mrjbq7 on Hacker News, the devs said it's because users at Facebook keep their code mounted on network drives, and that would be slow. But they are open to adding it as an option.
from pathpicker.
That makes sense - however, half of my files seem not to have extensions and so this doesn't work very well. I also, don't see the need to differentiate between files and directories, since opening directories could be a valid use-case, too.
from pathpicker.
After #50, this issue is actualy about dot files and with no period in the CWD.
It seems that those are not detected by design since it's more likely that they are not paths in the input. For the CWD I don't believe checking path existence would be a problem with network drive. Let's patch that.
from pathpicker.
It makes sense, could be very hard to parse filenames without dots, taking into account that could be combined with another texts 😞
So, as @mrjbq7 says, os.path.isfile
could be the best option although would be slow
from pathpicker.
Yeah lets move this into #83. We can likely put the filesystem logic as an experimental flag which should mitigate any performance issues we might encounter. I do think it's the right future of the project though, since then we can match on all sorts of things and eliminate a ton of false positives
from pathpicker.
Related Issues (20)
- Allow configuring keyboard controls
- Command mode is broken in latest master HOT 1
- fpp-git on AUR is quite outdated HOT 2
- Feature Request: Make man page easier to read, put each flag in its own line. HOT 5
- Filename within `#` cannot be pick
- The way of determining shell is not reliable.
- Demo videos in homepage not loading on mobile HOT 2
- Issue and PR templates HOT 2
- Skip the `F` key in quick select mode
- Problems with paths with spaces in them
- New release before EOY? HOT 6
- Support for git diffs
- Standalone Executable File
- fpp not opening files in $EDITOR HOT 7
- Infinite loop when selecting entry with certain width relative to window width HOT 1
- Release 0.9.5 but fpp --version says 0.9.2 HOT 1
- feature request: open files in vim tab pages
- chore: use pre-commit hook
- ci: update versions and add `paths-ignore`
- macOS Python segfault HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathpicker.