Beispiel #1
0
def main():
    """
    Main function  for vyos-config script
    """

    script = Script()

    script.add_subcommand(ListCommand())

    script.run()
Beispiel #2
0
def main():
    script = Script()
    script.add_argument('--config', default=DEFAULT_CONFIG_PATH, help='Virtual machine directory')

    c = script.add_subcommand(ListCommand('list', 'List VMs'))

    c = script.add_subcommand(StartCommand('start', 'Start VM'))
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    c = script.add_subcommand(StopCommand('stop', 'Stop VM'))
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    c = script.add_subcommand(AutoResumeCommand('resume', 'Autoresume headless VMs'))
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    c = script.add_subcommand(SuspendCommand('suspend', 'Suspend VM'))
    c.add_argument('--autoresume', action='store_true', help='Set autoresume flag')
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    c = script.add_subcommand(StatusCommand('status', 'Show status of VMs'))
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    c = script.add_subcommand(DetailsCommand('details', 'Show VM details'))
    c.add_argument('patterns', nargs='*', help='VM name patterns')

    script.parse_args()
Beispiel #3
0
def main():
    script = Script('pytunes-playlists',
                    'Import and export music player playlists')

    c = script.add_subcommand(ListCommand('list', 'List playlists'))
    c.add_argument('-s',
                   '--smart-playlists',
                   action='store_true',
                   help='Include smart playlists')
    c.add_argument('-y',
                   '--yearly',
                   action='store_true',
                   help='Order listed tracks by year')
    c.add_argument('-f', '--format', help='List formatting string')
    c.add_argument('playlists', nargs='*', help='Playlists to process')

    c = script.add_subcommand(
        ExportFilesCommand('export-files', 'Export playlists as files'))
    c.add_argument('-s',
                   '--smart-playlists',
                   action='store_true',
                   help='Include smart playlists')
    c.add_argument('-y',
                   '--yearly',
                   action='store_true',
                   help='Order exported tracks by year')
    c.add_argument('-f', '--format', help='Filename formatting string')
    c.add_argument('playlists', nargs='*', help='Playlists to process')

    c = script.add_subcommand(ExportCommand('export', 'Export m3u playlists'))
    script.add_argument('-D',
                        '--directory',
                        default=DEFAULT_DIRECTORY,
                        help='Playlist directory for m3u files')
    c.add_argument('-s',
                   '--smart-playlists',
                   action='store_true',
                   help='Include smart playlists')
    c.add_argument('-E',
                   '--ignore-empty',
                   action='store_true',
                   help='Ignore empty playlists')
    c.add_argument('playlists', nargs='*', help='Playlists to process')

    c = script.add_subcommand(ImportCommand('import', 'Import playlists'))
    c.add_argument('-s',
                   '--smart-playlists',
                   action='store_true',
                   help='Include smart playlists')
    c.add_argument('playlists', nargs='*', help='Playlists to process')

    c = script.add_subcommand(CreateCommand('create', 'Create playlists'))
    c.add_argument('names', nargs='*', help='Names of playlists to create')

    c = script.add_subcommand(RemoveCommand('remove', 'Remove playlists'))
    c.add_argument('names', nargs='*', help='Names of playlists to create')

    script.run()
Beispiel #4
0
def main():

    script = Script()

    c = script.add_subcommand(
        InfoCommand('info', 'Show playing track information'))
    c.add_argument('-v',
                   '--verbose',
                   action='store_true',
                   help='Verbose messages')

    c = script.add_subcommand(PlayCommand('play', 'Play/pause/jump to file'))
    c.add_argument('track', nargs='?', help='Track to play')

    c = script.add_subcommand(StopCommand('stop', 'Stop playback'))

    c = script.add_subcommand(
        PreviousTrackCommand('previous', 'Play previous tracks'))
    c = script.add_subcommand(NextTrackCommand('next', 'Play next tracks'))

    c = script.add_subcommand(
        ShuffleModeCommand('shuffle', 'Toggle or show suffle mode'))
    c.add_argument('mode',
                   nargs='?',
                   choices=(
                       'enable',
                       'disable',
                   ),
                   help='Enable or disable shuffle mode')

    c = script.add_subcommand(
        VolumeCommand('volume', 'Adjust or show playback volume'))
    c.add_argument('volume', nargs='?', help='Value to set')

    c = script.add_subcommand(
        UpdateIndexCommand('update-index', 'Update track index database'))

    c = script.add_subcommand(
        LookupDBCommand('lookup-index', 'Lookup track index from database'))
    c.add_argument('paths', nargs='*', help='Track paths to lookup')

    script.run()
Beispiel #5
0
def main():
    script = Script()
    script.add_argument('--config',
                        default=DEFAULT_CONFIG_PATH,
                        help='Virtual machine directory')

    script.add_subcommand(ListCommand())
    script.add_subcommand(StatusCommand())
    script.add_subcommand(StartCommand())
    script.add_subcommand(StopCommand())
    script.add_subcommand(ResumeCommand())
    script.add_subcommand(SuspendCommand())
    script.add_subcommand(DetailsCommand())

    script.parse_args()