App-sitelenmute
view release on metacpan or search on metacpan
script/fcaption view on Meta::CPAN
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# fcaption: simple image caption editor
# Copyright(c) 2015-2016 by wave++ "Yuri D'Elia" <wavexx@thregr.org>
from __future__ import unicode_literals, generators, print_function
import os, sys
import argparse
import locale
try:
from PySide2 import QtCore, QtGui, QtWidgets
except ImportError:
from PyQt4 import QtCore, QtGui
QtWidgets = QtGui
APP_DESC = "Sitelen Mute image caption editor"
ENCODING = locale.getpreferredencoding()
FILE_EXT = ["jpg", "jpeg", "png", "tif", "tiff"]
if sys.version_info.major < 3:
str = unicode
class ScaledImage(QtWidgets.QLabel):
def __init__(self):
super(ScaledImage, self).__init__()
self._pixmap = QtGui.QPixmap()
script/sitelen-mute view on Meta::CPAN
--viewdir directory containing $me CSS/JavaScript ($viewdir)
--index URL URL location for the index/back button
--version output current $me version ($VERSION)
Add meta tags for Facebook/Twitter (must be specified all or none):
--url URL URL of gallery
--title "TITLE" title for Facebook and Twitter previews
--description "DESC" description for Facebook and Twitter previews};
exit $_[0];
}
# Options: text needs to be decoded based on locale, but filenames are not
# decoded; URLs are decoded because international domain names (IDNA) and
# internationalized resource identifiers (IRI) can still happen.
GetOptions(
'help|h' => sub { print_help(0); },
'version' => sub { say "$0 $VERSION"; exit 0; },
'c=s' => sub { @captions = @{ parse_captions($_[0], $_[1]) || [] }; },
'd' => sub { $nodown = 1; },
'f' => sub { $facedet = 1; },
'i' => sub { $include = 1; },
'o' => sub { $orient = 0; },
'k' => sub { $use_orig = 1; },
'n=s' => sub { shift; $name = decode(locale => shift); },
'p' => sub { $fullpano = 0; },
'r' => sub { $revsort = 1; },
's' => sub { $slim = 1; },
't' => sub { $timesort = 0; },
'v' => sub { $verbose++; },
'noblur' => sub { $do_blur = 0; },
'max-full=s' => sub { @maxfull = parse_wh(@_); },
'max-thumb=s' => sub { @maxthumb = parse_wh(@_); },
'min-thumb=s' => sub { @minthumb = parse_wh(@_); },
'no-sRGB' => sub { $sRGB = 0; },
'quality=i' => sub { $imgq = parse_int($_[0], $_[1], 0, 100); },
'index=s' => sub { shift; $indexUrl = decode(locale => shift); },
'title=s' => sub { shift; $galleryTitle = decode(locale => shift); },
'description=s' => sub { shift; $galleryDescription = decode(locale => shift); },
'url=s' => sub { shift; $galleryUrl = decode(locale => shift); },
'link-orig:s' => sub { $copy_method = parse_copy_method($_[0], $_[1]); },
'viewdir:s' => \$viewdir,
);
print_help(2) unless @ARGV == 2;
if (($galleryTitle || $galleryDescription || $galleryUrl)
&& !($galleryTitle && $galleryDescription && $galleryUrl)) {
fatal "All three are required: --title, --description, and --url";
}
( run in 1.998 second using v1.01-cache-2.11-cpan-ceb78f64989 )