Comments (7)
Hello, the split ext should do the work fine.
I sent you the https://ybin.me/p/6056cb919b7ac01d#6TUJO4V8Zwcwg7fuL+g8znLANqG0SQCvKxlh5hll94w= pastebin on linkedin.
Here your code is doing too much :
https://github.com/victordomingos/Count-files/blob/master/countfiles/utils/file_handlers.py#L11
you should use your helper to return the extension and let upper function decide if they process or not files with falsee extensions.
from count-files.
Yes but, matter of fact you do not need a "has_extension" method.
This is the kind of method you will not use that much in other parts of the code, you could simply test if extension is 'truee' or falsee and that's it. if you really wand to have this, make it a property.
extension = file.extension
if extension:
do stufff
# Is better than
if file.has_extention:
extension = file.extension
Because if the code is : has_extention = bool(get_extention) then is it almost useless, and if the code differs it can be error-prone since you do not compare the same thing.
from count-files.
I agree, we must do it. The parser does not process this parameter. But the user can search for files without an extension.
from count-files.
By the way, can we ask potential users their opinion on the actual parser functionality?
(something add, change, optimize). For example, in the Python Сommunity
It is possible to create a free chat for the project (add a link to Readme.md). Log in with GitHub and write. Gitter
from count-files.
Asking for feedback or even some user testing to help spot issues not found during development is fine. I wouldn’t start a chat room at this time for a project like this, though. I prefer to keep the discussion of features and bugs inside the issues section on GutHub. That way we have everything in one place.
But I see no problem in asking also informally in social media and then open issues for relevant suggestions and bugs mentioned elsewhere.
from count-files.
@cgte Nice work, very concise code, with a very different approach. I just think that it's not as readable (at least from my perspective). Having said that, my code is in fact needing a global cleanup. ;-)
You are right about get_file_extension()
doing too much. I just needed to write a has_extension()
function that could very well be replaced by a slightly simpler get_file_extension()
. I will have to merge those two functions soon.
from count-files.
@cgte, I think I get your point. My intention with has_extension()
was to enable slightly shorter and more readable expressions (like in if
clauses), but it was more of a quick way for me to better understand what I was writing in the upper function. I have meanwhile merged those two functions (has_extension()
and get_file_extension()
) into a single get_file_extension()
that returns an empty (falsy) string when there is no extension.
Since we are not using a class for single files, I am not sure if you could/should make it a property.
I will be thankful if you could take another look and see the changes I made in this respect. Any further suggestions for improvement are always welcome.
from count-files.
Related Issues (20)
- `test_show_result_for_search_files` failing on Haiku (hrev52958, 64bit, Python 3.6.7) HOT 3
- Suggest the most similar command(s) when a CLI argument is not recognised HOT 4
- Inconsistencies with case-sensitivity when using --filename-match HOT 1
- Suggestion: add sorting of file extensions by type to Count group HOT 10
- Table issue HOT 2
- Grouping with alphabetic order HOT 2
- Preview for text files in version 1.6.0 HOT 10
- Group the list of currently supported filetypes by categories HOT 11
- Test fails: test_viewing_modes.py HOT 2
- Test runner fails HOT 3
- Ideas for Count Files v1.5 HOT 6
- Argparse and help system. HOT 6
- Add file search by other criteria HOT 4
- How to count symbolic links and windows shortcuts? HOT 3
- Excluding folders or file extensions HOT 1
- Add some new preview systems for common file types: HOT 6
- Search or count for multiple extensions HOT 8
- Optimize the search with skipping root hidden folders. HOT 10
- Help system - improve readability HOT 1
- Switching to classes HOT 3
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 count-files.