view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
view all matches for this distribution
8586878889909192939495sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
view all matches for this distribution
8586878889909192939495sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
view all matches for this distribution
8586878889909192939495sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
view release on metacpan or search on metacpan
1664816649166501665116652166531665416655166561665716658
ccstack = top_si->si_cxstack;
cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
}
if
(cxix < 0)
return
NULL;
/*
caller
() should not report the automatic calls to
&DB::sub
*/
if
(PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
level++;
if
(!level--)
break;
view all matches for this distribution
1666416665166661666716668166691667016671166721667316674if
(CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
/* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
field below is
defined
for
any cx. */
/*
caller
() should not report the automatic calls to
&DB::sub
*/
if
(PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
cx =
&ccstack
[dbcxix];
}
return
cx;
view release on metacpan or search on metacpan
lib/Crypt/RSA/Debug.pm view on Meta::CPAN
view all matches for this distribution
1718192021222324252627my
$DEBUG
= 0;
sub
debug{
return
unless
$DEBUG
;
my
(
$caller
,
undef
) =
caller
;
my
(
undef
,
undef
,
$line
,
$sub
) =
caller
(1);
$sub
=~ s/.*://;
$sub
=
sprintf
"%12s()%4d"
,
$sub
,
$line
;
$sub
.=
" | "
. (
shift
);
$sub
=~ s/\x00/[0]/g;
$sub
=~ s/\x01/[1]/g;
$sub
=~ s/\x02/[2]/g;
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
view all matches for this distribution
8586878889909192939495sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
view release on metacpan or search on metacpan
inc/Inline.pm view on Meta::CPAN
view all matches for this distribution
8586878889909192939495sub
import_heavy {
local
($/, $
") = ("
\n",
' '
);
local
($\, $,);
my
$o
;
my
(
$pkg
,
$script
) =
caller
(1);
# Not sure what this is for. Let's see what breaks.
# $pkg =~ s/^.*[\/\\]//;
my
$class
=
shift
;
if
(
$class
ne
'Inline'
) {
croak M01_usage_use(
$class
)
if
$class
=~ /^Inline::/;
view release on metacpan or search on metacpan
lib/Module/Runtime.pm view on Meta::CPAN
129130131132133134135136137138139
compose_module_name
);
my
%export_ok
=
map
{ (
$_
=>
undef
) }
@EXPORT_OK
;
sub
import
{
my
$me
=
shift
;
my
$callpkg
=
caller
(0);
my
$errs
=
""
;
foreach
(
@_
) {
if
(
exists
$export_ok
{
$_
}) {
# We would need to do "no strict 'refs'" here
# if we had enabled strict at file scope.
lib/Module/Runtime.pm view on Meta::CPAN
view all matches for this distribution
146147148149150151152153154155156
$errs
.=
"\"$_\" is not exported by the $me module\n"
;
}
}
if
(
$errs
ne
""
) {
die
"${errs}Can't continue after import errors "
.
"at @{[(caller(0))[1]]} line @{[(caller(0))[2]]}.\n"
;
}
}
# Logic duplicated from Params::Classify. Duplicating it here avoids
# an extensive and potentially circular dependency graph.
view release on metacpan or search on metacpan
lib/Sub/Delete.pm view on Meta::CPAN
view all matches for this distribution
2324252627282930313233my
%sigils
=
qw( SCALAR $ ARRAY @ HASH % )
;
sub
delete_sub {
my
$sub
=
shift
;
my
(
$stashname
,
$key
) =
$sub
=~ /(.*::)((?:(?!::).)*)\z/s
? ($1,$2) : (
caller
().
"::"
,
$sub
);
exists
+(
my
$stash
= \
%$stashname
)->{
$key
} or
return
;
ref
$stash
->{
$key
} eq
'SCALAR'
and
# perl5.10 constant
delete
$stash
->{
$key
},
return
;
my
$globname
=
"$stashname$key"
;
my
$glob
=
*$globname
;
# autovivify the glob in case future perl
view release on metacpan or search on metacpan
lib/Alter/AlterXS_in_perl.pm view on Meta::CPAN
view all matches for this distribution
222324252627282930313233343536373839}
sub
alter ($$) {
@_
== 2 or croak
"Usage: Alter::alter(obj, val)"
;
my
(
$obj
,
$val
) =
@_
;
corona(
$obj
)->{
caller
()} =
$val
;
$obj
;
}
sub
ego ($) {
@_
== 1 or
die
"Usage: Alter::ego(obj)"
;
my
$obj
=
shift
;
corona(
$obj
)->{
caller
()} ||= _vivify(
caller
());
}
sub
is_xs { 0 }
### Autovivification
view release on metacpan or search on metacpan
lib/Alzabo/Driver.pm view on Meta::CPAN
3536373839404142434445{
my
$self
=
shift
;
unless
(
$self
->{dbh} )
{
my
$sub
= (
caller
(1))[3];
Alzabo::Exception::Driver->throw(
error
=>
"Cannot call $sub before calling connect."
);
}
$self
->{dbh} =
$self
->_dbi_connect(
$self
->{connect_params} )
if
$$ !=
$self
->{connect_pid};
lib/Alzabo/Driver.pm view on Meta::CPAN
439440441442443444445446447448449450451452453454455456457458{
my
$self
=
shift
;
$self
->_ensure_valid_dbh;
my
$callee
= (
caller
(1))[3];
# More commits than begin_tran. Not correct.
if
(
defined
$self
->{tran_count} )
{
$self
->{tran_count}--;
}
else
{
my
$caller
= (
caller
(1))[3];
Carp::cluck(
"$caller called commit without corresponding begin_work call\n"
);
}
# Don't actually commit until we reach 'uber-commit'
lib/Alzabo/Driver.pm view on Meta::CPAN
view all matches for this distribution
479480481482483484485486487488489sub
_virtual
{
my
$self
=
shift
;
my
$sub
= (
caller
(1))[3];
Alzabo::Exception::VirtualMethod->throw(
error
=>
"$sub is a virtual method and must be subclassed in "
.
ref
$self
);
}
package
Alzabo::DriverStatement;
view release on metacpan or search on metacpan
lib/Amazon/SecretsManager.pm view on Meta::CPAN
view all matches for this distribution
4546474849505152535455
AWS_SERVICE_URL_BASE
=>
'secretsmanager'
,
TRUE
=> 1,
FALSE
=> 0
};
__PACKAGE__->main()
if
!
caller
();
sub
new {
my
$class
=
shift
;
$class
=
ref
(
$class
) ||
$class
;
view release on metacpan or search on metacpan
t/99-pod-coverage.t view on Meta::CPAN
view all matches for this distribution
34567891011plan
skip_all
=>
"Test::Pod::Coverage 1.00 required for testing POD coverage"
if
$@;
all_pod_coverage_ok( );
# Workaround for dumb bug (fixed in 5.8.7) where Test::Builder thinks that
# certain "die"s that happen inside evals are not actually inside evals,
# because caller() is broken if you turn on $^P like Module::Refresh does
#
# (I mean, if we've gotten to this line, then clearly the test didn't die, no?)
Test::Builder->new->{Test_Died} = 0;
view release on metacpan or search on metacpan
lib/Ambrosia/Assert.pm view on Meta::CPAN
view all matches for this distribution
1617181920212223242526return
if
eval
{
$package
->can(
'assert'
)};
assign(
shift
)
if
@_
;
no
strict
'refs'
;
my
$package_instance
=
caller
(0);
if
( debug_mode(
$PROCESS_MAP
{$$},
@_
) )
{
*{
"${package_instance}::assert"
} =
sub
(&$) {
goto
&__assert
; };
}
else
view release on metacpan or search on metacpan
lib/Amon2/DBI.pm view on Meta::CPAN
view all matches for this distribution
5657585960616263646566
Scalar::Util::weaken(
$self
->{private_txn_manager}->{dbh});
}
return
$self
->{private_txn_manager};
}
sub
txn_scope {
$_
[0]->_txn_manager->txn_scope(
caller
=> [
caller
(0)]) }
sub
do_i {
my
$self
=
shift
;
my
(
$sql
,
@bind
) = SQL::Interp::sql_interp(
@_
);
$self
->
do
(
$sql
, {},
@bind
);
view release on metacpan or search on metacpan
lib/Amon2/Lite.pm view on Meta::CPAN
1819202122232425262728sub
import
{
my
$class
=
shift
;
no
strict
'refs'
;
my
$router
= Router::Simple->new();
my
$caller
=
caller
(0);
my
$base_class
=
'Amon2::Lite::_child_'
.
$COUNTER
++;
{
no
warnings;
unshift
@{
"$base_class\::ISA"
},
qw/Amon2 Amon2::Web/
;
lib/Amon2/Lite.pm view on Meta::CPAN
373839404142434445464748my
$vpath
= Data::Section::Simple->new(
$caller
)->get_data_section();
require
Plack::App::File;
my
$orig_app
=
$app
;
my
$app_file_1
;
my
$app_file_2
;
my
$root1
= File::Spec->catdir( dirname((
caller
(0))[1]),
'static'
);
my
$root2
= File::Spec->catdir( dirname((
caller
(0))[1]) );
$app
=
sub
{
my
$env
=
shift
;
if
((
my
$content
=
$vpath
->{
$env
->{PATH_INFO}}) &&
$env
->{PATH_INFO} =~ m{^/}) {
my
$ct
= Plack::MIME->mime_type(
$env
->{PATH_INFO});
return
[200, [
'Content-Type'
=>
$ct
,
'Content-Length'
=>
length
(
$content
)], [
$content
]];
lib/Amon2/Lite.pm view on Meta::CPAN
100101102103104105106107108109110*{
"$caller\::router"
} =
sub
{
$router
};
# any [qw/get post delete/] => '/bye' => sub { ... };
# any '/bye' => sub { ... };
*{
"$caller\::any"
} =
sub
($$;$) {
my
$pkg
=
caller
(0);
if
(
@_
==3) {
my
(
$methods
,
$pattern
,
$code
) =
@_
;
$router
->
connect
(
$pattern
,
{
code
=>
$code
,
method
=> [
map
{
uc
$_
}
@$methods
]},
lib/Amon2/Lite.pm view on Meta::CPAN
view all matches for this distribution
146147148149150151152153154155156
return
$c
->res_404();
}
}
};
my
$tmpl_dir
= File::Spec->catdir(dirname((
caller
(0))[1]),
'tmpl'
);
*{
"${base_class}::create_view"
} =
sub
{
$base_class
->template_options();
};
*{
"${base_class}::template_options"
} =
sub
{
my
(
$class
,
%options
) =
@_
;
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
lib/Amon2/Setup/Flavor.pm view on Meta::CPAN
view all matches for this distribution
2728293031323334353637sub
infof {
my
$caller
=
do
{
my
$x
;
for
(1..10) {
$x
=
caller
(
$_
);
last
if
$x
ne __PACKAGE__;
}
$x
;
};
$caller
=~ s/^Amon2::Setup:://;
view release on metacpan or search on metacpan
lib/Analizo/Model.pm view on Meta::CPAN
370371372373374375376377378379380
}
}
}
else
{
# listing raw dependency info
foreach
my
$caller
(
grep
{
$self
->_include_caller(
$_
, @{
$args
{omit}}) }
sort
(
keys
(%{
$self
->calls}))) {
foreach
my
$callee
(
grep
{
$self
->_include_callee(
$_
,
$args
{include_externals}, @{
$args
{omit}}) }
sort
(
keys
(%{
$self
->calls->{
$caller
}}))) {
my
$style
= _reftype_to_style(
$self
->calls->{
$caller
}->{
$callee
});
$graph
->add_edge(
$caller
,
$callee
);
$graph
->set_edge_attribute(
$caller
,
$callee
,
'style'
,
$style
);
$graph
->set_vertex_attribute(
$caller
,
'group'
,
$self
->_function_to_module(
$caller
));
lib/Analizo/Model.pm view on Meta::CPAN
view all matches for this distribution
402403404405406407408409410
return
!
grep
{
$function
eq
$_
}
@omitted
;
}
sub
_include_callee {
my
(
$self
,
$member
,
$include_externals
,
@omitted
) =
@_
;
return
$self
->_include_caller(
$member
,
@omitted
) && (
exists
(
$self
->members->{
$member
}) ||
$include_externals
);
}
1;
view release on metacpan or search on metacpan
lib/Anansi/Class.pm view on Meta::CPAN
view all matches for this distribution
204205206207208209210211212213214=cut
sub import {
my ($self, @parameters) = @_;
my $caller = caller();
foreach my $parameter (@parameters) {
my $value = $self->implicate($caller, $parameter);
*{$caller.'::'.$parameter} = $value if(defined($value));
}
}
view release on metacpan or search on metacpan
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
808182838485868788899091# NOTE: without connecting to a device you can not use e.g. open_app(), swipe() etc.
sub
new {
my
$class
=
ref
(
$_
[0]) ||
$_
[0];
# aka proto
my
$params
=
$_
[1] // {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$self
= {
'_private'
=> {
'confighash'
=>
undef
,
'configfile'
=>
''
,
# this should never be undef
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
159160161162163164165166167168169170# or undef on failure
sub
connect_device {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity;
my
(
$what_device
,
$m
);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
218219220221222223224225226227228229# XML string, ready to do XPath queries
# it needs that connect_device() to have been called prior to this call
sub
dump_current_screen_ui {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity;
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'device_connected()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
314315316317318319320321322323324# it needs that connect_device() to have been called prior to this call
sub
swipe {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
1 }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
438439440441442443444445446447448# This will append to apps() the result.
sub
find_installed_apps {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
515516517518519520521522523524525526# It returns undef on failure.
sub
search_app {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
my
$package
;
if
( !
exists
(
$params
->{
'package'
}) || !
defined
(
$package
=
$params
->{
'package'
}) ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, input parameter 'package' was not specified, it must be a package name or a compiled regex (e.g. via "
...
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
587588589590591592593594595596597# it needs that connect_device() to have been called prior to this call
sub
open_app {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
698699700701702703704705706707708# it needs that connect_device() to have been called prior to this call
sub
close_app {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
789790791792793794795796797798799# it needs that connect_device() to have been called prior to this call
sub
tap {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
818819820821822823824825826827828# it needs that connect_device() to have been called prior to this call
sub
input_text {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
856857858859860861862863864865866# it needs that connect_device() to have been called prior to this call
sub
clear_input_field {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
930931932933934935936937938939940941# NOTE: it uses _ps_parse_output() which is copied verbatim from System::Process
# I wish they would load ps info from a string rather than running their own `ps`
sub
list_running_processes {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity;
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'device_connected()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
10161017101810191020102110221023102410251026# it needs that connect_device() to have been called prior to this call
sub
geofix {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
10491050105110521053105410551056105710581059# it needs that connect_device() to have been called prior to this call
sub
dump_current_location {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
11041105110611071108110911101111111211131114# it needs that connect_device() to have been called prior to this call
sub
list_physical_displays {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
113311341135113611371138113911401141114211431144# on success.
# it needs that connect_device() to have been called prior to this call
sub
dump_current_screen_shot {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity;
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'device_connected()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
120112021203120412051206120712081209121012111212# It returns 1 on failure, 0 on success.
# it needs that connect_device() to have been called prior to this call
sub
dump_current_screen_video {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity;
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'device_connected()'
.
" before calling this."
);
return
1 }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
12801281128212831284128512861287128812891290# it needs that connect_device() to have been called prior to this call
sub
wake_up {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
13021303130413051306130713081309131013111312# it needs that connect_device() to have been called prior to this call
sub
home_screen {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
13261327132813291330133113321333133413351336# it needs that connect_device() to have been called prior to this call
sub
next_screen {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
13451346134713481349135013511352135313541355# it needs that connect_device() to have been called prior to this call
sub
previous_screen {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
13641365136613671368136913701371137213731374# the left-triangle button (see http://developer.android.com/reference/android/view/KeyEvent.html)
sub
navigation_menu_back_button {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
13871388138913901391139213931394139513961397# the round button, it goes to home (see http://developer.android.com/reference/android/view/KeyEvent.html)
sub
navigation_menu_home_button {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
14111412141314141415141614171418141914201421sub
navigation_menu_overview_button {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
14361437143814391440144114421443144414451446# it needs that connect_device() to have been called prior to this call
sub
find_all_apps_roundabout_way {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
14741475147614771478147914801481148214831484# it needs that connect_device() to have been called prior to this call
sub
open_app_roundabout_way {
my
(
$self
,
$params
) =
@_
;
$params
//= {};
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
( !
$self
->is_device_connected() ){
$log
->error(
"${whoami} (via $parent), line "
.__LINE__.
" : error, you need to connect a device to the desktop and ALSO explicitly call "
.
'connect_device()'
.
" before calling this."
);
return
undef
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
1537153815391540154115421543154415451546154715481549155015511552155315541555155615571558# setting a verbosity level will also spawn a chain of other debug subs,
sub
verbosity {
my
(
$self
,
$m
) =
@_
;
my
$log
=
$self
->
log
();
if
(
defined
$m
){
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
$self
->{
'_private'
}->{
'debug'
}->{
'verbosity'
} =
$m
;
if
(
defined
$self
->adb ){
$self
->adb->{
'verbosity'
} =
$m
}
}
return
$self
->{
'_private'
}->{
'debug'
}->{
'verbosity'
}
}
sub
cleanup {
my
(
$self
,
$m
) =
@_
;
my
$log
=
$self
->
log
();
if
(
defined
$m
){
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
$self
->{
'_private'
}->{
'debug'
}->{
'cleanup'
} =
$m
;
}
return
$self
->{
'_private'
}->{
'debug'
}->{
'cleanup'
}
}
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
156215631564156515661567156815691570157115721573sub
configfile {
my
(
$self
,
$infile
) =
@_
;
return
$self
->{
'_private'
}->{
'configfile'
}
unless
defined
$infile
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
# this can be called before the logger is created, so create a temp logger for this
my
$log
=
$self
->
log
() // Mojo::Log->new();
my
$ch
= parse_configfile(
$infile
,
$log
);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
158415851586158715881589159015911592159315941595# return configfile or read+check+set a configfile,
# returns undef on failure or the configfile on success
sub
parse_configfile {
my
(
$infile
,
$log
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
# this can be called before the logger is created, so create a temp logger for this
$log
//= Mojo::Log->new();
my
$ch
= Config::JSON::Enhanced::config2perl({
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
161416151616161716181619162016211622162316241625sub
confighash {
my
(
$self
,
$m
) =
@_
;
if
( !
defined
$m
){
return
$self
->{
'_private'
}->{
'confighash'
} }
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
#print STDOUT "${whoami} (via $parent), line ".__LINE__." : called ...\n";
# we are storing specified confighash but first check it for some fields
# required fields:
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
165916601661166216631664166516661667166816691670# initialises
# do the verbositys
# returns 1 on failure, 0 on success
sub
init {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
# Confighash
# first see if either user specified a config file or the default is present and read it,
# then we will overwrite with user-specified params if any
my
(
$configfile
,
$confighash
);
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
17391740174117421743174417451746174717481749# initialises module-specific things, no need to copy this to other modules
# returns 1 on failure, 0 on success
sub
init_module_specific {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
my
$confighash
=
$self
->confighash();
if
(
$verbosity
> 0 ){
$log
->info(
"${whoami} (via $parent), line "
.__LINE__.
" : called ..."
) }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
17881789179017911792179317941795179617971798
return
0
# success
}
sub
disconnect_device {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
if
(
$verbosity
> 0 ){
$log
->info(
"${whoami} (via $parent), line "
.__LINE__.
" : called ..."
) }
lib/Android/ElectricSheep/Automator.pm view on Meta::CPAN
view all matches for this distribution
18121813181418151816181718181819182018211822# On failure it returns undef
# On success it creates a new DeviceProperties Object which is saved in $self
# and also returned to caller
sub
find_current_device_properties {
my
(
$self
,
$params
) =
@_
;
my
$parent
= (
caller
(1) )[3] ||
"N/A"
;
my
$whoami
= (
caller
(0) )[3];
my
$log
=
$self
->
log
();
my
$verbosity
=
$self
->verbosity();
my
$confighash
=
$self
->confighash();
if
(
$verbosity
> 0 ){
$log
->info(
"${whoami} (via $parent), line "
.__LINE__.
" : called ..."
) }
view release on metacpan or search on metacpan
share/log_config/anki-import.cfg view on Meta::CPAN
view all matches for this distribution
6869707172737475767778798081log4perl.appender.info.layout=PatternLayout
log4perl.appender.
warn
.layout=PatternLayout
log4perl.appender.error.layout=PatternLayout
log4perl.appender.fatal.layout=PatternLayout
log4j.PatternLayout.cspec.E =
sub
{
return
[
caller
(5)]->[1]; };
log4j.PatternLayout.cspec.e =
sub
{
return
[
caller
(5)]->[2]; };
#log4j.PatternLayout.cspec.D = sub { use Data::Dumper qw(Dumper); return Dumper($_[1]); };
log4j.PatternLayout.cspec.s =
sub
{
return
[
caller
(6)]->[1] .
': '
. [
caller
(6)]->[2]; };
log4perl.appender.trace.layout.ConversionPattern=[%-5p] %-80m
%c
:
%e
%n
log4perl.appender.debug.layout.ConversionPattern=[%-5p]
%c
:
%e
%n
%8m
%n
log4perl.appender.info.layout.ConversionPattern= [%-5p] %-80m
%c
:
%e
%n
#log4perl.appender.info.layout.ConversionPattern= [%-5p] %-80m %n
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
lib/Ansible.pm view on Meta::CPAN
view all matches for this distribution
691692693694695696697698699700701
return
join
(
''
,
@r
);
}
sub
callerlevels {
my
$n
= 1;
1
while
caller
(
$n
++);
return
$n
;
}
sub
mget {
my
(
$self
,
@designators
) =
@_
;
view release on metacpan or search on metacpan
lib/Antsy.pm view on Meta::CPAN
502503504505506507508509510511512sub
_is_iterm { _is_term_type( _iterm_id() ) }
sub
_iterm_seq (
$command
,
@args
) {
unless
( _is_iterm() ) {
my
$sub
= (
caller
(1) )[3];
carp(
"$sub only works in iTerm2"
);
return
;
}
OSC() .
join
(
';'
,
@args
,
''
) .
$command
. ST();
lib/Antsy.pm view on Meta::CPAN
view all matches for this distribution
592593594595596597598599600601602=cut
sub _osc_1337 ( $content ) {
unless( _is_iterm() ) {
my $sub = ( caller(1) )[3];
carp( "$sub only works in iTerm2" );
return;
}
OSC() . 1337 . ';' . $content . ST()
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
363364365366367368369370371372373374375376#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
# Done in evals to avoid confusing Perl::MinimumVersion
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
view all matches for this distribution
338339340341342343344345346347348349350351#####################################################################
# Common Utility Functions
sub
_caller {
my
$depth
= 0;
my
$call
=
caller
(
$depth
);
while
(
$call
eq __PACKAGE__ ) {
$depth
++;
$call
=
caller
(
$depth
);
}
return
$call
;
}
sub
_read {