question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interface is overly complex: couple of file operations takes 120 lines

See original GitHub issue

Hi,

While the project is extensible and “correct” from OOP point of view, it lacks sensible defaults and shortcuts. In the examples in this repo, it took 120 lines to open, read and delete a file. This makes the project unusable…

It would be cool to get a file this way, for example:

with Session.connect('server', 12345, 'Administrator', password) as session:
    with session.open_file('C$', '/path/to/file') as f:
        ...

Having only two visible entities, session and opened file, would be enough for most users. Connection and TreeConnect may be hidden. Security stuff needs more shurtcuts as it’s impossible for average user to quickly come up with correct ones.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jborean93commented, Sep 3, 2019

Just an FYI, I’ve started work on this and am slowly making progress. You can see the latest status by looking at the easy-api branch. Ultimately I’m trying to replicate the builtin os and shutil modules in Python.

0reactions
jborean93commented, Nov 22, 2019

I’ve finally gotten around to it and have finalised the PR to add the easy-api changes to smbprotocol. If you are interested in trying this out and need any help let me know and I’ll walk you through some of it. The smbclient package should simplify all these operations in a major way and provide a nice an easy way to complete common file operations.

There are still things that are only accessible in the low level API of smbprotocol but over time these can hopefully make their way into smbclient.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GUI Programming - Java Programming Tutorial
In this article, I shall show you how you can reuse the graphics classes provided in JDK for constructing your own Graphical User...
Read more >
IF382 IOG - AP PO Invoice Inbound Interface
The Interface Operations Guide (IOG) contains the interface specific information required for State of South Carolina Agencies to integrate with the SCEIS ...
Read more >
User Interface Principles - Win32 apps | Microsoft Learn
This topic discusses how to implement intuitive user interface and user experience design principles into a Windows applications.
Read more >
Brain-Computer Interfaces in Medicine - PMC - NCBI
Brain-computer interfaces (BCIs) acquire brain signals, analyze them, and translate them into commands that are relayed to output devices that carry out ...
Read more >
Designing the user interface: text, colour, images, moving ...
This allows a meaningful unit of text to appear in most lines. You should avoid very short lines, as they fragment the text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found