GBrowse
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Bio/Graphics/Browser2.pm view on Meta::CPAN
my $self = shift;
my $source = CGI::param('source') || CGI::param('src') || CGI::path_info();
$source =~ s!\#$!!; # get rid of trailing # left by IE
$source =~ s!^/+!!; # get rid of leading & trailing / from path_info()
$source =~ s!/+$!!;
$source;
}
sub update_data_source {
my $self = shift;
my $session = shift;
my $new_source = shift;
my $old_source = $session->source || $self->default_source;
$new_source ||= $self->get_source_from_cgi();
my $source;
if ($self->valid_source($new_source)) {
$session->source($new_source);
lib/Bio/Graphics/Browser2/Render.pm view on Meta::CPAN
#
##################################################################3
sub set_default_state {
my $self = shift;
my $state = $self->state;
$self->default_state if !$state->{tracks} # always set in one form or another
or param('reset');
}
sub update_state {
my $self = shift;
warn "[$$] update_state()" if DEBUG;
return if param('gbgff'); # don't let gbgff requests update our coordinates!!!
# return if url() =~ /gbrowse_img/; # don't let gbrowse_img requests update our coordinates either!!
$self->_update_state;
}
sub _update_state {
my $self = shift;
lib/Bio/Graphics/Browser2/Render/Slave/AWS_Balancer.pm view on Meta::CPAN
}
sub running_as_instance {
my $self = shift;
return -e '/var/lib/cloud/data/previous-instance-id'
&& head('http://169.254.169.254');
}
# update conf file with new snapshot images
sub update_data_snapshots {
my $self = shift;
my @snapshot_ids = @_;
my $timestamp = 'synchronized with local filesystem on '.localtime;
my $conf_file = $self->conf_file;
my ($user,$group) = (stat($conf_file))[4,5];
open my $in,'<',$conf_file or die "Couldn't open $conf_file: $!";
open my $out,'>',"$conf_file.new" or die "Couldn't open $conf_file: $!";
while (<$in>) {
chomp;
s/^(data_snapshots\s*=).*/$1 @snapshot_ids # $timestamp/;
lib/Bio/Graphics/Browser2/UserTracks/Database.pm view on Meta::CPAN
$value =~ s/\s+$//;
my $result = $uploadsdb->do("UPDATE uploads SET $field = ? WHERE trackid = ?", undef, $value, $file);
$self->update_modified($file);
return $result;
} else {
return $uploadsdb->selectrow_array("SELECT $field FROM uploads WHERE trackid = ?", undef, $file);
}
}
# Update Modified (File ID[, User ID]) - Updates the modification date/time of the specified file to right now.
sub update_modified {
my $self = shift;
my $uploadsdb = $self->{uploadsdb};
my $file = shift or return;
my $now = $self->nowfun;
# Do not swap out this line for a field() call, since it's used inside field().
return $uploadsdb->do("UPDATE uploads SET modification_date = $now WHERE trackid = " . $uploadsdb->quote($file));
}
# Created (File ID) - Returns creation date of $file, cannot be set.
sub created {
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.318 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )