Coder Social home page Coder Social logo

nay's People

Contributors

noprobelm avatar

Stargazers

 avatar

Watchers

 avatar

nay's Issues

CHANGE: Create class for operation options

Defining a dictionary at the beginning of the Args class is unwieldy, does not ensure the necessary keys will be present, and is not conducive to future expansion. Write an Options class that will be passed to the Args object upon initialization.

Fix exception handling for Wrapper class

Due to a weird way in which pacman sometimes considers stdout to actually be stderr, I've had some difficulty implementing subprocess.run(check=True) for pacman functions while retaining the full intended stdout.

One example is with subprocess.run(shlex.split(sudo pacman -Rs <targets>), check=True, stderr=subprocess.PIPE), in which case we're attempting to run pacmanas a subprocess, catch any errors usingcheck=True, and print stderr` to the console if an error is encountered.

In the event this example does not encounter an error, the packages intended for removal will still be displayed in stdout as intended, but the "proceed" prompt presented by pacman is actually considered stderr and as a consequence is suppressed from the terminal.

The current design omits stderr=subprocess.PIPE so the user is presented with the full intended stdout and stderr, but as a consequence we can't be specific with our PacmanError exception handling.

Need to figure out a way to capture stderr and/or stdout while still printing it to the console. The methods subprocess.Popen exposes (specifically communicate might be the solution to this problem.

Replace networkx with custom bfs traversal logic

networkx is overkill for an application like this and adds significant weight to nay's dependency list. I used networkx in the first place to get AUR dependency resolution working, but we can easily enough replace this dependency by implementing our own breadth-first search algorithm to install "layers" of dependencies in the correct order.

FEATURE: Implement missing pacman operations

So far the focus has mainly been on Sync, Remove, and Query operations. The latter two are easy as the options/args are redirected to their corresponding "pure wrapper" classes from the operations module.

Need to consider adding operations for -D, -T, -U, and -F so nay is fully interchangeable with pacman

Add operations:

  • -D (database)
  • -T (deptest)
  • -U (upgrade)
  • -F (files)

Add selective sudo for wrapper subclasses

The current implementation assumes you either will or won't run sudo for all options that fall under an operation. The reality is it isn't this black and white. For example, pacman -D operations may or may not require sudo.

  • pacman -D --asdeps requires sudo
  • pacman -Dk does not require sudo

Maybe this could be resolved by checking for the error: you cannot perform this operation unless you are root error produced by pacman, but this approach would be blocked by #38

CHANGE: General clean up

The utils and operations module are filled with functions/classes with less-than-ideal args, both in their definitions as well as the manner in which they're passed. Needs to be cleaned up to be consistent across the board.

FEATURE: Add custom progress bars

If it's not a huge headache, nay would benefit from custom progress bars. The progress bars provided by rich are easy to implement and look beautiful (not to mention they're used by pip)

CHANGE: Condense Package subclasses

I originally thought it would be a good idea to have an AUR and SyncDB subclass for each type of package to eliminate the necessity for conditional statements when creating a Package object's renderable attribute, but this has just resulted in confusing code where different objects must be instantiated depending on the package's source.

The reality is that a package's representation can really only go one of two ways depending on whether its origin is from a sync database or the AUR. I should condense these objects and deal with the consequence of having a few conditional statements when defining the renderable and info class attributes.

BUG: Remove installation of non-explicit packages

nay will currently install all packages and dependencies, regardless of whether they were explicitly supplied by the user. Update functionality to install only packages that were either specified by the user or are uninstalled dependencies.

FEATURE: Implement -G (GetPKBUILD) operation

Example syntax:

nay -G <targets>

  • For targets from a sync DB: asp checkout <target>: dump in PWD
  • for targets from the AUR: git clone https://aur.archlinux.org/<target>.git: dump in PWD

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.