Giter VIP home page Giter VIP logo

Comments (4)

kikislater avatar kikislater commented on August 24, 2024 1

Hi,

Thank you for your answer. Unfortunately patterns doesn't work for me. If I try with
I was thinking about using a list like ["*.*"] allows to not display files ;-)
Example:

>>> display_tree("DroneMDT", max_depth=4, show_hidden=True, ignore_list=["*.py"])
DroneMDT/
├── __init__.py
├── __pycache__/
│   ├── check_images.cpython-310.pyc
│   ├── enriched_func.cpython-310.pyc
│   ├── exif_helper.cpython-310.pyc
│   ├── geoflow_helper.cpython-310.pyc
│   ├── meteo_helper.cpython-310.pyc
│   ├── process_webodm.cpython-310.pyc
│   ├── raster_helper.cpython-310.pyc
│   ├── read_metadata.cpython-310.pyc
│   ├── settings.cpython-310.pyc
│   ├── status_codes.cpython-310.pyc
│   ├── zenodo_helper.cpython-310.pyc
│   └── zip_helper.cpython-310.pyc
├── check_images.py
├── data_to_geoflow
├── data_to_geoflow.py
├── enriched_func.py
├── exif_helper.py
├── generate_drone_metadata.R
├── geoflow_helper.py
├── list_projects.py
├── list_users.py
├── main.py
├── metadata.txt
├── meteo_helper.py
├── prepare_upload.py
├── process_webodm.py
├── raster_helper.py
├── read_metadata.py
├── README.md
├── requirements.txt
├── settings.py
├── status_codes.py
├── uas_report_metrics.Rmd
├── Untitled.ipynb
├── upload_raw_to_zenodo.py
├── zenodo.json
├── zenodo_helper.py
├── zenodo_helper.py.old
├── zenodo_uploader.py
└── zip_helper.py

Btw for my orignal question, I ended with this function:

def tree_sort_by_name(path=os.getcwd(), indent=0):
    print(indent*' ' + '└─', path.split('/')[-1])
    treed = indent*' ' + '└─' +  path.split('/')[-1]
    for file in sorted(os.listdir(path)):
        if os.path.isdir(os.path.join(path, file)):
            treed = treed + "\n" + tree_sort_by_name(os.path.join(path, file), indent+2)
        ### To print files as well
        # else:
            # print('  ' + indent*' ' + '└─', file)
    return treed

from directory-tree.

rahulbordoloi avatar rahulbordoloi commented on August 24, 2024 1

Earlier -
image

Now (Conditional Parameterized) -
image

Is this what you were seeking for?
Also, WIP for Bash Support.

from directory-tree.

rahulbordoloi avatar rahulbordoloi commented on August 24, 2024

Hello @kikislate,

Thanks for reaching out! As of now there're no provisions to display only the directories. Would definitely add as a new feature.

For using patterns, you can take reference from here -

display_tree(max_depth=4, show_hidden=True, ignore_list=["*.py"])

Let me know if there're any further questions, would take the feature request soon and update in this loop.

from directory-tree.

rahulbordoloi avatar rahulbordoloi commented on August 24, 2024

New Changes are Live in PyPi! (https://pypi.org/project/directory-tree/) @kikislater

from directory-tree.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.