omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Simple shell

    Pythonista
    5
    6
    4789
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • edgauthier
      edgauthier last edited by

      The start of a simple shell for basic file management. Currently supports the following commands (no support for any options at this point):

      • ls
      • pwd
      • cd
      • mkdir
      • rm (handles both directories and files)

      By default, the script tries to protect the user from altering files outside of the Documents directory. To disable these preventative checks, add a setting to the config dict:

      config = {'allow_unsafe': True}

      https://gist.github.com/4063716

      1 Reply Last reply Reply Quote 0
      • pantazi64
        pantazi64 last edited by

        cool

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          Very nice! I've added some error handling and a cat command:

          https://gist.github.com/4066688

          1 Reply Last reply Reply Quote 0
          • pudquick51
            pudquick51 last edited by

            You've got a bug in your do_rm re-implementation, omz

            if len(args == 0):

            should be

            if len(args) == 0:

            1 Reply Last reply Reply Quote 0
            • PKHG222
              PKHG222 last edited by

              Indeed, I changed my copy ;-)

              1 Reply Last reply Reply Quote 0
              • omz
                omz last edited by

                Thanks, fixed.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors