1
     ˆÃ�þ]n5›•±-?) ?ŸÉƒÏ3ÈÇ¿Å [    import logging

import borgmatic.borg.extract
import borgmatic.borg.rlist
import borgmatic.config.validate
import borgmatic.hooks.command

logger = logging.getLogger(__name__)


def run_extract(
    config_filename,
    repository,
    location,
    storage,
    hooks,
    hook_context,
    local_borg_version,
    extract_arguments,
    global_arguments,
    local_path,
    remote_path,
):
    '''
    Run the "extract" action for the given repository.
    '''
    borgmatic.hooks.command.execute_hook(
        hooks.get('before_extract'),
        hooks.get('umask'),
        config_filename,
        'pre-extract',
        global_arguments.dry_run,
        **hook_context,
    )
    if extract_arguments.repository is None or borgmatic.config.validate.repositories_match(
        repository, extract_arguments.repository
    ):
        logger.info('{}: Extracting archive {}'.format(repository, extract_arguments.archive))
        borgmatic.borg.extract.extract_archive(
            global_arguments.dry_run,
            repository,
            borgmatic.borg.rlist.resolve_archive_name(
                repository,
                extract_arguments.archive,
                storage,
                local_borg_version,
                local_path,
                remote_path,
            ),
            extract_arguments.paths,
            location,
            storage,
            local_borg_version,
            local_path=local_path,
            remote_path=remote_path,
            destination_path=extract_arguments.destination,
            strip_components=extract_arguments.strip_components,
            progress=extract_arguments.progress,
        )
    borgmatic.hooks.command.execute_hook(
        hooks.get('after_extract'),
        hooks.get('umask'),
        config_filename,
        'post-extract',
        global_arguments.dry_run,
        **hook_context,
    )
  5   ˆl–ßi~”Je¶¥	AãoÜ*bÑ¿�þD4³e’¼Ì��­ùÊƒy—žÉÀÆ  Ä    #!/usr/bin/perl

package main;
use warnings;
use strict;

use HTML::WikiConverter;

my %o = H::WC::GetOpts->get_opts();
my $wc = new HTML::WikiConverter( %o );

my $html = do { local $/; <> };
print $wc->html2wiki($html), "\n";

#
# Attribute/option handling
#

package H::WC::GetOpts;

use Params::Validate ':types';
use Getopt::Long;
use Pod::Usage;

sub get_opts {
  my %attrs = known_attributes();
  my %o = map { $_ => undef } keys %attrs;

  my @optspec = (
    \%o,
    'list' => sub { warn "Installed dialects:\n"; print map "$_\n", HTML::WikiConverter->available_dialects; exit(1); },
    'help' => sub { pod2usage( -exit => 1, -verbose => 0 ) },
    'options' => sub { warn "Accepted options:\n"; print map "--$_\n", sort keys %attrs; exit(1); },
    attrs2optspecs(\%attrs)
  );

  eval { GetOptions( @optspec ) or pod2usage(2) };
  die "problem parsing command-line options: $@" if $@;

  $o{dialect} ||= $ENV{WCDIALECT};
  pod2usage(2) unless $o{dialect};

  remove_ignored_opts(\%o);
  return %o;
}

sub known_attributes {
  my %attributes = (
    %{ HTML::WikiConverter->__default_attribute_specs },
  );

  my @modules = map { "HTML::WikiConverter::$_" } HTML::WikiConverter->available_dialects;
  foreach my $module ( @modules ) {
    next unless eval "use $module; 1";
    my %attrs = %{ $module->attributes };
    foreach my $attr ( keys %attrs ) {
      $attributes{$attr} = $attrs{$attr};
    }
  }

  delete $attributes{$_} for IGNORED_ATTRS();

  # Normalize attr name with dashes
  foreach my $attr ( keys %attributes ) {
    my $new_attr = $attr;
    if( $new_attr =~ s/_/-/g ) {
      $attributes{$new_attr} = $attributes{$attr};
      delete $attributes{$attr};
    }
  }

  return %attributes;
}

sub attrs2optspecs {
  my $attrs = shift;
  my @specs = ( );

  my %forced_optspecs = FORCED_OPTSPECS();

  while( my( $attr, $spec ) = each %$attrs ) {
    my $type = $spec->{type} ? $spec->{type} : BOOLEAN;
    next if $type == CODEREF;
    next unless $attr;

    if( my $fspec = $forced_optspecs{$attr} ) {
      push @specs, $fspec;
    } else {
      my $reqop