prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>test.js<|end_file_name|><|fim▁begin|>"use strict"; var expect = require('chai').expect , protolib = require(__dirname + '/../') ; describe('protolib', function() { describe('clone', function() { it('should create a clone of the given object', function() { var object = { name: 'Philip' , hello: function() { return 'Hello, my name is ' + this.name; } , date: new Date() , arr: [1, {foo: 'bar'}] }; var clone_object = protolib.clone(object); expect(clone_object).to.have.property('name', 'Philip'); expect(clone_object.hello()).to.equal('Hello, my name is Philip'); expect(clone_object.date.getMonth()).to.equal(new Date().getMonth()); expect(clone_object).to.have.deep.property('arr[0]', 1); expect(clone_object).to.have.deep.property('arr[1].foo', 'bar'); }); it('should throw an error if input is not an object or array', function() { expect(protolib.clone).to.throw('Cannot clone!'); }); }); describe('inherit', function() { it('should set the prototype of an object to the given value', function() { var proto = {foo: 'bar'}; var object = protolib.inherit(proto); expect(object).to.have.property('foo', 'bar'); proto.foo = 'baz'; expect(object).to.have.property('foo', 'baz'); }); }); describe('mixin', function() { it('should add the prototype properties to the given object', function() { var proto = {type: 'list', values: [1, 2, 3]}; var object = {readonly: true}; protolib.mixin(object, proto); expect(object).to.have.property('readonly', true);<|fim▁hole|> expect(object).to.have.deep.property('values[0]', 1); expect(object).to.have.deep.property('values[1]', 2); expect(object).to.have.deep.property('values[2]', 3); }); it('should overwrite any existing properties with duplicate names', function() { var proto = {type: 'list', values: [1, 2, 3]}; var object = {type: 'none'}; protolib.mixin(object, proto); expect(object).to.have.property('type', 'list'); expect(object).to.have.deep.property('values[0]', 1); expect(object).to.have.deep.property('values[1]', 2); expect(object).to.have.deep.property('values[2]', 3); }); }); });<|fim▁end|>
expect(object).to.have.property('type', 'list');
<|file_name|>Dictory.java<|end_file_name|><|fim▁begin|>package com.glaf.base.modules.sys.model; import java.io.Serializable; import java.util.Date; public class Dictory implements Serializable { private static final long serialVersionUID = 2756737871937885934L; private long id; private long typeId; private String code; private String name; private int sort; private String desc; private int blocked; private String ext1; private String ext2; private String ext3; private String ext4; private Date ext5; private Date ext6; public int getBlocked() { return blocked; } public String getCode() { return code; } public String getDesc() { return desc; }<|fim▁hole|> public String getExt1() { return ext1; } public String getExt2() { return ext2; } public String getExt3() { return ext3; } public String getExt4() { return ext4; } public Date getExt5() { return ext5; } public Date getExt6() { return ext6; } public long getId() { return id; } public String getName() { return name; } public int getSort() { return sort; } public long getTypeId() { return typeId; } public void setBlocked(int blocked) { this.blocked = blocked; } public void setCode(String code) { this.code = code; } public void setDesc(String desc) { this.desc = desc; } public void setExt1(String ext1) { this.ext1 = ext1; } public void setExt2(String ext2) { this.ext2 = ext2; } public void setExt3(String ext3) { this.ext3 = ext3; } public void setExt4(String ext4) { this.ext4 = ext4; } public void setExt5(Date ext5) { this.ext5 = ext5; } public void setExt6(Date ext6) { this.ext6 = ext6; } public void setId(long id) { this.id = id; } public void setName(String name) { this.name = name; } public void setSort(int sort) { this.sort = sort; } public void setTypeId(long typeId) { this.typeId = typeId; } }<|fim▁end|>
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate lalrpop; fn main() {<|fim▁hole|> lalrpop::process_root().unwrap(); }<|fim▁end|>
<|file_name|>InvalidUsageException.java<|end_file_name|><|fim▁begin|>/* * WorldEdit, a Minecraft world manipulation toolkit * Copyright (C) sk89q <http://www.sk89q.com> * Copyright (C) WorldEdit team and contributors * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.sk89q.worldedit.util.command;<|fim▁hole|> import com.sk89q.minecraft.util.commands.CommandException; import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkNotNull; /** * Thrown when a command is not used properly. * * <p>When handling this exception, print the error message if it is not null. * Print a one line help instruction unless {@link #isFullHelpSuggested()} * is true, which, in that case, the full help of the command should be * shown.</p> * * <p>If no error message is set and full help is not to be shown, then a generic * "you used this command incorrectly" message should be shown.</p> */ @SuppressWarnings("serial") public class InvalidUsageException extends CommandException { private final CommandCallable command; private final boolean fullHelpSuggested; /** * Create a new instance with no error message and with no suggestion * that full and complete help for the command should be shown. This will * result in a generic error message. * * @param command the command */ public InvalidUsageException(CommandCallable command) { this(null, command); } /** * Create a new instance with a message and with no suggestion * that full and complete help for the command should be shown. * * @param message the message * @param command the command */ public InvalidUsageException(@Nullable String message, CommandCallable command) { this(message, command, false); } /** * Create a new instance with a message. * * @param message the message * @param command the command * @param fullHelpSuggested true if the full help for the command should be shown */ public InvalidUsageException(@Nullable String message, CommandCallable command, boolean fullHelpSuggested) { super(message); checkNotNull(command); this.command = command; this.fullHelpSuggested = fullHelpSuggested; } /** * Get the command. * * @return the command */ public CommandCallable getCommand() { return command; } /** * Get a simple usage string. * * @param prefix the command shebang (such as "/") -- may be blank * @return a usage string */ public String getSimpleUsageString(String prefix) { return getCommandUsed(prefix, command.getDescription().getUsage()); } /** * Return whether the full usage of the command should be shown. * * @return show full usage */ public boolean isFullHelpSuggested() { return fullHelpSuggested; } }<|fim▁end|>
<|file_name|>DICGaussSeidelSmoother.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright held by original author \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class Foam::DICGaussSeidelSmoother Description Combined DIC/GaussSeidel smoother for symmetric matrices in which DIC smoothing is followed by GaussSeidel to ensure that any "spikes" created by the DIC sweeps are smoothed-out. SourceFiles DICGaussSeidelSmoother.C \*---------------------------------------------------------------------------*/ #ifndef DICGaussSeidelSmoother_H #define DICGaussSeidelSmoother_H #include "DICSmoother.H" #include "GaussSeidelSmoother.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class DICGaussSeidelSmoother Declaration \*---------------------------------------------------------------------------*/ class DICGaussSeidelSmoother : public lduSmoother { // Private data DICSmoother dicSmoother_; GaussSeidelSmoother gsSmoother_; public: //- Runtime type information TypeName("DICGaussSeidel"); // Constructors //- Construct from matrix components DICGaussSeidelSmoother ( const lduMatrix& matrix, const FieldField<Field, scalar>& coupleBouCoeffs, const FieldField<Field, scalar>& coupleIntCoeffs, const lduInterfaceFieldPtrsList& interfaces );<|fim▁hole|> // Member Functions //- Execute smoothing virtual void smooth ( scalarField& psi, const scalarField& Source, const direction cmpt, const label nSweeps ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //<|fim▁end|>
<|file_name|>armdFromSourceFabs.js<|end_file_name|><|fim▁begin|>// @flow import { transformFileSync, type babel } from 'babel-core'; import pluginReactIntl from 'babel-plugin-react-intl'; import pluginReactIntlAuto from 'babel-plugin-react-intl-auto'; import pathOr from 'ramda/src/pathOr'; import compose from 'ramda/src/compose'; import type { AbsolutePath } from '../../../../types'; import type { Config } from '../../../config'; import log from '../../../log'; import type { MessageDescriptorsFromFile } from './extract'; const outputBabelFromFabs = (fabs: AbsolutePath, config: Config): babel.BabelFileResult => { const plugins = [pluginReactIntl]; if (config.reactIntlAutoConfig) { plugins.unshift([pluginReactIntlAuto, config.reactIntlAutoConfig]);<|fim▁hole|> } try { return transformFileSync(fabs, { plugins }); } catch (err) { log.error(err); throw err; } }; const armdFromFabs: MessageDescriptorsFromFile = compose( pathOr([], ['metadata', 'react-intl', 'messages']), outputBabelFromFabs, ); export default armdFromFabs;<|fim▁end|>
<|file_name|>bswap16.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_intrinsics)] extern crate core; #[cfg(test)] mod tests { use core::intrinsics::bswap16; // pub fn bswap16(x: u16) -> u16; macro_rules! bswap16_test { ($value:expr, $reverse:expr) => ({ let x: u16 = $value; let result: u16 = unsafe { bswap16(x) }; assert_eq!(result, $reverse); }) } #[test] fn bswap16_test1() { bswap16_test!(0x0000, 0x0000); bswap16_test!(0x0001, 0x0100); bswap16_test!(0x0002, 0x0200); bswap16_test!(0x0004, 0x0400); bswap16_test!(0x0008, 0x0800);<|fim▁hole|> bswap16_test!(0x0010, 0x1000); bswap16_test!(0x0020, 0x2000); bswap16_test!(0x0040, 0x4000); bswap16_test!(0x0080, 0x8000); bswap16_test!(0x0100, 0x0001); bswap16_test!(0x0200, 0x0002); bswap16_test!(0x0400, 0x0004); bswap16_test!(0x0800, 0x0008); bswap16_test!(0x1000, 0x0010); bswap16_test!(0x2000, 0x0020); bswap16_test!(0x4000, 0x0040); bswap16_test!(0x8000, 0x0080); } }<|fim▁end|>
<|file_name|>scripts.js<|end_file_name|><|fim▁begin|>$(function () { var $container = $('#container'); var certificatesInfo = $container.data('certinfo'); var runDate = $container.data('rundate'); $('#created_date').html(runDate); var sorted_certificates = Object.keys(certificatesInfo) .sort(function( a, b ) { return certificatesInfo[a].info.days_left - certificatesInfo[b].info.days_left; }).map(function(sortedKey) { return certificatesInfo[sortedKey]; }); var card_html = String() +'<div class="col-xs-12 col-md-6 col-xl-4">' +' <div class="card text-xs-center" style="border-color:#333;">' +' <div class="card-header" style="overflow:hidden;">' +' <h4 class="text-muted" style="margin-bottom:0;">{{server}}</h4>' +' </div>' +' <div class="card-block {{background}}">' +' <h1 class="card-text display-4" style="margin-top:0;margin-bottom:-1rem;">{{days_left}}</h1>' +' <p class="card-text" style="margin-bottom:.75rem;"><small>days left</small></p>' +' </div>'<|fim▁hole|> +' <h6 class="text-muted" style="margin-bottom:0;"><small>{{common_name}}</small></h6>' +' </div>' +' </div>' +'</div>'; function insert_card(json) { var card_template = Handlebars.compile(card_html), html = card_template(json); $('#panel').append(html); }; sorted_certificates.forEach(function(element, index, array){ var json = { 'server': element.server, 'days_left': element.info.days_left, 'issuer': element.issuer.org, 'common_name': element.subject.common_name, 'issuer_cn': element.issuer.common_name } if (element.info.days_left <= 30 ){ json.background = 'card-inverse card-danger'; } else if (element.info.days_left > 30 && element.info.days_left <= 60 ) { json.background = 'card-inverse card-warning'; } else if (element.info.days_left === "??") { json.background = 'card-inverse card-info'; } else { json.background = 'card-inverse card-success'; } insert_card(json); }); });<|fim▁end|>
+' <div class="card-footer">' +' <h6 class="text-muted" style="margin-bottom:.5rem;">Issued by: {{issuer}}</h6>' +' <h6 class="text-muted" style=""><small>{{issuer_cn}}</small></h6>'
<|file_name|>470 Implement Rand10() Using Rand7().py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 """ Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer in the range 1 to 10. Do NOT use system's Math.random(). """ # The rand7() API is already defined for you. def rand7(): return 0 class Solution: def rand10(self): """ generate 7 twice, (rv1, rv2), 49 combination assign 40 combinations for the 1 to 10 respectively <|fim▁hole|> while True: rv1 = rand7() rv2 = rand7() s = (rv1 - 1) * 7 + (rv2 - 1) # make it start from 0 if s < 40: # s \in [0, 40) return s % 10 + 1 # since I make it start from 0<|fim▁end|>
7-ary system :rtype: int """
<|file_name|>BraitenbergVehicle2b.py<|end_file_name|><|fim▁begin|>""" Braitenberg Vehicle2b The more light sensed on the left side the faster the right motor moves. The more light sensed on the right side the faster the left motor moves. This causes the robot to turn towards a light source. """ from pyrobot.brain import Brain, avg class Vehicle(Brain): def setup(self):<|fim▁hole|> def step(self): leftSpeed = max([s.value for s in self.robot.light[0]["right"]]) rightSpeed = max([s.value for s in self.robot.light[0]["left"]]) print "leftSpeed, rightSpeed:", leftSpeed, rightSpeed self.motors(leftSpeed, rightSpeed) def INIT(engine): if engine.robot.type not in ['K-Team', 'Pyrobot']: raise "Robot should have light sensors!" return Vehicle('Braitenberg2a', engine)<|fim▁end|>
self.robot.light[0].units = "SCALED"
<|file_name|>fuzz6.js<|end_file_name|><|fim▁begin|>// |jit-test| error:TypeError <|fim▁hole|><|fim▁end|>
if (!this.hasOwnProperty("TypedObject")) throw new TypeError(); new TypedObject.StructType(RegExp);
<|file_name|>options.go<|end_file_name|><|fim▁begin|>package levigo // #cgo LDFLAGS: -lleveldb // #include "leveldb/c.h" import "C" // CompressionOpt is a value for Options.SetCompression. type CompressionOpt int // Known compression arguments for Options.SetCompression. const ( NoCompression = CompressionOpt(0) SnappyCompression = CompressionOpt(1) ) // Options represent all of the available options when opening a database with // Open. Options should be created with NewOptions. // // It is usually with to call SetCache with a cache object. Otherwise, all // data will be read off disk. // // To prevent memory leaks, Close must be called on an Options when the // program no longer needs it. type Options struct { Opt *C.leveldb_options_t } // ReadOptions represent all of the available options when reading from a // database. // // To prevent memory leaks, Close must called on a ReadOptions when the // program no longer needs it. type ReadOptions struct { Opt *C.leveldb_readoptions_t } // WriteOptions represent all of the available options when writeing from a // database. // // To prevent memory leaks, Close must called on a WriteOptions when the // program no longer needs it. type WriteOptions struct { Opt *C.leveldb_writeoptions_t } // NewOptions allocates a new Options object. func NewOptions() *Options { opt := C.leveldb_options_create() return &Options{opt} } // NewReadOptions allocates a new ReadOptions object. func NewReadOptions() *ReadOptions { opt := C.leveldb_readoptions_create() return &ReadOptions{opt} }<|fim▁hole|> return &WriteOptions{opt} } // Close deallocates the Options, freeing its underlying C struct. func (o *Options) Close() { C.leveldb_options_destroy(o.Opt) } // SetComparator sets the comparator to be used for all read and write // operations. // // The comparator that created a database must be the same one (technically, // one with the same name string) that is used to perform read and write // operations. // // The default comparator is usually sufficient. func (o *Options) SetComparator(cmp *C.leveldb_comparator_t) { C.leveldb_options_set_comparator(o.Opt, cmp) } // SetErrorIfExists, if passed true, will cause the opening of a database that // already exists to throw an error. func (o *Options) SetErrorIfExists(error_if_exists bool) { eie := boolToUchar(error_if_exists) C.leveldb_options_set_error_if_exists(o.Opt, eie) } // SetCache places a cache object in the database when a database is opened. // // This is usually wise to use. See also ReadOptions.SetFillCache. func (o *Options) SetCache(cache *Cache) { C.leveldb_options_set_cache(o.Opt, cache.Cache) } // SetEnv sets the Env object for the new database handle. func (o *Options) SetEnv(env *Env) { C.leveldb_options_set_env(o.Opt, env.Env) } // SetInfoLog sets a *C.leveldb_logger_t object as the informational logger // for the database. func (o *Options) SetInfoLog(log *C.leveldb_logger_t) { C.leveldb_options_set_info_log(o.Opt, log) } // SetWriteBufferSize sets the number of bytes the database will build up in // memory (backed by an unsorted log on disk) before converting to a sorted // on-disk file. func (o *Options) SetWriteBufferSize(s int) { C.leveldb_options_set_write_buffer_size(o.Opt, C.size_t(s)) } // SetParanoidChecks, when called with true, will cause the database to do // aggressive checking of the data it is processing and will stop early if it // detects errors. // // See the LevelDB documentation docs for details. func (o *Options) SetParanoidChecks(pc bool) { C.leveldb_options_set_paranoid_checks(o.Opt, boolToUchar(pc)) } // SetMaxOpenFiles sets the number of files than can be used at once by the // database. // // See the LevelDB documentation for details. func (o *Options) SetMaxOpenFiles(n int) { C.leveldb_options_set_max_open_files(o.Opt, C.int(n)) } // SetBlockSize sets the approximate size of user data packed per block. // // The default is roughly 4096 uncompressed bytes. A better setting depends on // your use case. See the LevelDB documentation for details. func (o *Options) SetBlockSize(s int) { C.leveldb_options_set_block_size(o.Opt, C.size_t(s)) } // SetBlockRestartInterval is the number of keys between restarts points for // delta encoding keys. // // Most clients should leave this parameter alone. See the LevelDB // documentation for details. func (o *Options) SetBlockRestartInterval(n int) { C.leveldb_options_set_block_restart_interval(o.Opt, C.int(n)) } // SetCompression sets whether to compress blocks using the specified // compresssion algorithm. // // The default value is SnappyCompression and it is fast enough that it is // unlikely you want to turn it off. The other option is NoCompression. // // If the LevelDB library was built without Snappy compression enabled, the // SnappyCompression setting will be ignored. func (o *Options) SetCompression(t CompressionOpt) { C.leveldb_options_set_compression(o.Opt, C.int(t)) } // SetCreateIfMissing causes Open to create a new database on disk if it does // not already exist. func (o *Options) SetCreateIfMissing(b bool) { C.leveldb_options_set_create_if_missing(o.Opt, boolToUchar(b)) } // SetFilterPolicy causes Open to create a new database that will uses filter // created from the filter policy passed in. func (o *Options) SetFilterPolicy(fp *FilterPolicy) { var policy *C.leveldb_filterpolicy_t if fp != nil { policy = fp.Policy } C.leveldb_options_set_filter_policy(o.Opt, policy) } // Close deallocates the ReadOptions, freeing its underlying C struct. func (ro *ReadOptions) Close() { C.leveldb_readoptions_destroy(ro.Opt) } // SetVerifyChecksums controls whether all data read with this ReadOptions // will be verified against corresponding checksums. // // It defaults to false. See the LevelDB documentation for details. func (ro *ReadOptions) SetVerifyChecksums(b bool) { C.leveldb_readoptions_set_verify_checksums(ro.Opt, boolToUchar(b)) } // SetFillCache controls whether reads performed with this ReadOptions will // fill the Cache of the server. It defaults to true. // // It is useful to turn this off on ReadOptions for DB.Iterator (and DB.Get) // calls used in offline threads to prevent bulk scans from flushing out live // user data in the cache. // // See also Options.SetCache func (ro *ReadOptions) SetFillCache(b bool) { C.leveldb_readoptions_set_fill_cache(ro.Opt, boolToUchar(b)) } // SetSnapshot causes reads to provided as they were when the passed in // Snapshot was created by DB.NewSnapshot. This is useful for getting // consistent reads during a bulk operation. // // See the LevelDB documentation for details. func (ro *ReadOptions) SetSnapshot(snap *Snapshot) { var s *C.leveldb_snapshot_t if snap != nil { s = snap.snap } C.leveldb_readoptions_set_snapshot(ro.Opt, s) } // Close deallocates the WriteOptions, freeing its underlying C struct. func (wo *WriteOptions) Close() { C.leveldb_writeoptions_destroy(wo.Opt) } // SetSync controls whether each write performed with this WriteOptions will // be flushed from the operating system buffer cache before the write is // considered complete. // // If called with true, this will signficantly slow down writes. If called // with false, and the host machine crashes, some recent writes may be // lost. The default is false. // // See the LevelDB documentation for details. func (wo *WriteOptions) SetSync(b bool) { C.leveldb_writeoptions_set_sync(wo.Opt, boolToUchar(b)) }<|fim▁end|>
// NewWriteOptions allocates a new WriteOptions object. func NewWriteOptions() *WriteOptions { opt := C.leveldb_writeoptions_create()
<|file_name|>LinqConcateIterator.java<|end_file_name|><|fim▁begin|>package com.github.visgeek.utils.collections; import java.util.Iterator; class LinqConcateIterator<T> implements Iterator<T> { // コンストラクター public LinqConcateIterator(Iterable<T> source, Iterable<? extends T> second) { this.second = second; this.itr = source.iterator(); this.isSwitched = false; } // フィールド private final Iterable<? extends T> second; private Iterator<? extends T> itr; private boolean isSwitched; // プロパティ // メソッド @Override public boolean hasNext() { boolean result = false; <|fim▁hole|> this.itr = this.second.iterator(); result = this.itr.hasNext(); this.isSwitched = true; } } return result; } @Override public T next() { return this.itr.next(); } // スタティックフィールド // スタティックイニシャライザー // スタティックメソッド }<|fim▁end|>
result = this.itr.hasNext(); if (!this.isSwitched) { if (!result) {
<|file_name|>MapTag.java<|end_file_name|><|fim▁begin|>/* * Copyright 2008-2013, ETH Zürich, Samuel Welten, Michael Kuhn, Tobias Langner,<|fim▁hole|> * Sandro Affentranger, Lukas Bossard, Michael Grob, Rahul Jain, * Dominic Langenegger, Sonia Mayor Alonso, Roger Odermatt, Tobias Schlueter, * Yannick Stucki, Sebastian Wendland, Samuel Zehnder, Samuel Zihlmann, * Samuel Zweifel * * This file is part of Jukefox. * * Jukefox is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or any later version. Jukefox is * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * Jukefox. If not, see <http://www.gnu.org/licenses/>. */ package ch.ethz.dcg.jukefox.model.collection; public class MapTag extends BaseTag { float[] coordsPca2D; private float varianceOverPCA; public MapTag(int id, String name, float[] coordsPca2D, float varianceOverPCA) { super(id, name); this.coordsPca2D = coordsPca2D; this.varianceOverPCA = varianceOverPCA; } public float[] getCoordsPca2D() { return coordsPca2D; } public float getVarianceOverPCA() { return varianceOverPCA; } }<|fim▁end|>
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<|fim▁hole|> * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault package org.sonar.ce.configuration; import javax.annotation.ParametersAreNonnullByDefault;<|fim▁end|>
* Lesser General Public License for more details.
<|file_name|>core.py<|end_file_name|><|fim▁begin|>import logging import threading import time from ballast.discovery import ServerList from ballast.rule import Rule, RoundRobinRule from ballast.ping import ( Ping, SocketPing, PingStrategy, SerialPingStrategy ) class LoadBalancer(object): DEFAULT_PING_INTERVAL = 30 MAX_PING_TIME = 3 def __init__(self, server_list, rule=None, ping_strategy=None, ping=None, ping_on_start=True): assert isinstance(server_list, ServerList) assert rule is None or isinstance(rule, Rule) assert ping_strategy is None or isinstance(ping_strategy, PingStrategy) assert ping is None or isinstance(ping, Ping) # some locks for thread-safety self._lock = threading.Lock() self._server_lock = threading.Lock() self._rule = rule \ if rule is not None \ else RoundRobinRule() self._ping_strategy = ping_strategy \ if ping_strategy is not None \ else SerialPingStrategy() self._ping = ping \ if ping is not None \ else SocketPing() self.max_ping_time = self.MAX_PING_TIME self._ping_interval = self.DEFAULT_PING_INTERVAL self._server_list = server_list self._servers = set() self._stats = LoadBalancerStats() self._rule.load_balancer = self self._logger = logging.getLogger(self.__module__) # start our background worker # to periodically ping our servers self._ping_timer_running = False self._ping_timer = None if ping_on_start: self._start_ping_timer() @property def ping_interval(self): return self._ping_interval @ping_interval.setter def ping_interval(self, value): self._ping_interval = value if self._ping_timer_running: self._stop_ping_timer() self._start_ping_timer() @property def max_ping_time(self): if self._ping is None: return 0 return self._ping.max_ping_time @max_ping_time.setter def max_ping_time(self, value): if self._ping is not None: self._ping.max_ping_time = value @property def stats(self): return self._stats @property def servers(self): with self._server_lock: return set(self._servers) @property def reachable_servers(self): with self._server_lock: servers = set() for s in self._servers: if s.is_alive: servers.add(s) return servers def choose_server(self): # choose a server, will # throw if there are none server = self._rule.choose() return server def mark_server_down(self, server): self._logger.debug("Marking server down: %s", server) server._is_alive = False def ping(self, server=None): if server is None: self._ping_all_servers() else: is_alive = self._ping.is_alive(server) server._is_alive = is_alive def ping_async(self, server=None): if server is None: # self._ping_all_servers() t = threading.Thread(name='ballast-worker', target=self._ping_all_servers) t.daemon = True t.start() else: is_alive = self._ping.is_alive(server) server._is_alive = is_alive def _ping_all_servers(self): with self._server_lock: results = self._ping_strategy.ping( self._ping, self._server_list ) self._servers = set(results) def _start_ping_timer(self): with self._lock: if self._ping_timer_running: self._logger.debug("Background pinger already running") return self._ping_timer_running = True self._ping_timer = threading.Thread(name='ballast-worker', target=self._ping_loop) self._ping_timer.daemon = True self._ping_timer.start() def _stop_ping_timer(self): with self._lock: self._ping_timer_running = False self._ping_timer = None def _ping_loop(self): while self._ping_timer_running: try: self._ping_all_servers() except BaseException as e: self._logger.error("There was an error pinging servers: %s", e) <|fim▁hole|> class LoadBalancerStats(object): def get_server_stats(self, server): pass<|fim▁end|>
time.sleep(self._ping_interval)
<|file_name|>aleph.rs<|end_file_name|><|fim▁begin|>extern crate aleph; fn main() {} // use aleph::reader; // extern crate itertools; // use itertools::*; // extern crate ansi_term; // use ansi_term::Colour; <|fim▁hole|>// #[macro_use] // extern crate clap; // use clap::{App, AppSettings, SubCommand}; // use std::io::prelude::*; // fn main() { // let version = option_env!("CARGO_PKG_VERSION").expect("Error: needs to build with Cargo"); // let matches = App::new("Aleph") // .about("The Aleph compiler") // .version(version) // .settings(&[AppSettings::ArgRequiredElseHelp, // AppSettings::SubcommandsNegateReqs]) // .subcommand(SubCommand::with_name("read") // .about("Evalutate expressions from CLI") // .arg_from_usage("<exprs>... 'Expression(s) to evalutate'")) // .subcommand(SubCommand::with_name("repl").about("Start a REPL")) // .subcommand(SubCommand::with_name("dump") // .about("(TMP) Dump the default readtable")) // .get_matches(); // if let Some(_) = matches.subcommand_matches("dump") { // println!("{:#?}", reader::ReadTable::default()); // } else if let Some(m) = matches.subcommand_matches("read") { // println!("{}", // reader::read_string(m.values_of("exprs").unwrap().join(" ")) // .and_then(|f| aleph::tmp_eval(&mut Environment::default(), f)) // .map(|f| Colour::Green.paint(f.to_string())) // .unwrap_or_else(|e| Colour::Red.paint(e))); // } else if let Some(_) = matches.subcommand_matches("repl") { // // crappy repl // println!("\nAleph {}\n\nEnter 'quit' to exit the REPL.", version); // let mut env = Environment::default(); // loop { // print!("\n> "); // std::io::stdout().flush().unwrap(); // let mut input = String::new(); // std::io::stdin().read_line(&mut input).unwrap(); // input = input.trim().to_owned(); // if input == "quit" { // break; // } // println!("{}", // reader::read_string(input) // .and_then(|f| aleph::tmp_eval(&mut env, f)) // .map(|f| Colour::Green.paint(f.to_string())) // .unwrap_or_else(|e| Colour::Red.paint(e))); // } // } // }<|fim▁end|>
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import os import module from flask import Flask, render_template, request, session, redirect, url_for, send_from_directory from werkzeug import secure_filename from functools import wraps app = Flask(__name__) # Configure upload locations app.config['UPLOAD_FOLDER'] = 'uploads/' app.config['ALLOWED_EXTENSIONS'] = set(['chessley']) # Change this to whatever filetype to accept # Checks if uploaded file is a valid file def allowed_file(filename): """ Checks if 'filename' is allowed to be uploaded to the server Params: filename - String containing the name of the uploaded file Returns: True if the file is allowed, False otherwise """ return '.' in filename and filename.rsplit('.',1)[1] in app.config['ALLOWED_EXTENSIONS'] # Wraps for login requirements on certain app.routes def login_required(f): """ Python function wrapper, used on functions that require being logged in to view. Run before a function's body is run. """ @wraps(f) def decorated_function(*args, **kwargs): if "authenticated" not in session or not session["authenticated"] or \ "username" not in session: session.clear() return redirect(url_for("login")) return f(*args, **kwargs) return decorated_function def redirect_if_logged_in(f): """ Python function wrapper, used on functions to redirect to other pages if the user is already logged in. Run before a function's body is run. """ @wraps(f) def decorated_function(*args, **kwargs): if "authenticated" in session and session["authenticated"]: return redirect(url_for("profile")) return f(*args, **kwargs) return decorated_function ############### APPLICATION SITE ROUTES ############### @app.route("/") @app.route("/home") @app.route("/home/") @redirect_if_logged_in def home(): return render_template("home.html") @app.route("/login", methods=["GET","POST"]) @app.route("/login/", methods=["GET","POST"]) @redirect_if_logged_in def login(): if request.method == "POST": REQUIRED = ["username", "pass"] for form_elem in REQUIRED: if form_elem not in request.form: return render_template("login.html") if module.authenticate(request.form['username'], request.form['pass']): session["authenticated"] = True session["username"] = request.form['username'] return redirect(url_for("profile")) return render_template("login.html") @app.route("/logout") @app.route("/logout/") @login_required def logout(): session.clear() return redirect(url_for("login")) @app.route("/register", methods=["POST"]) @app.route("/register/", methods=["POST"]) @redirect_if_logged_in def register(): REQUIRED = ["username", "pass", "pass2"] for form_elem in REQUIRED: if form_elem not in request.form: return redirect(url_for("home")) if request.form["pass"] != request.form["pass2"]: return redirect(url_for("home")) if module.newUser(request.form["username"], request.form["pass"]): session['authenticated'] = True session['username'] = request.form['username']<|fim▁hole|> else: return redirect(url_for("home")) @app.route("/about") @app.route("/about/") def about(): LOGGED_IN = "authenticated" in session and session["authenticated"] return render_template("about.html", AUTH=LOGGED_IN) @app.route("/download", methods=["GET", "POST"]) @app.route("/download/", methods=["GET", "POST"]) @login_required def download(): return render_template('download.html', USERNAME=session['username']) # For when the Jinja is configured @app.route("/upload", methods=["GET","POST"]) @app.route("/upload/", methods=["GET","POST"]) @login_required def upload(): if request.method == "POST": file = request.files["upload_bot"] if file and allowed_file(file.filename): filename = secure_filename(file.filename) file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename + session["username"] + "_bot.chessley")) return render_template("upload.html") @app.route("/leaderboards", methods=["GET", "POST"]) @app.route("/leaderboards/", methods=["GET", "POST"]) def leaderboards(): LOGGED_IN = "authenticated" in session and session["authenticated"] table = module.getRankedUsers() return render_template("leaderboards.html", table=table, AUTH=LOGGED_IN) @app.route("/profile", methods=["GET","POST"]) @app.route("/profile/", methods=["GET","POST"]) @login_required def profile(): if 'username' in session and session['username']!=0: #retrieve user data here dict = module.getUser(session['username']) #dict = {"rank":1,"elo":1400,"wins":100,"losses":50,"stalemates":0} return render_template("profile.html", USERNAME=session['username'], DICT=dict) return render_template("home.html") app.secret_key = str(os.urandom(24)) if __name__ == "__main__": app.debug = True app.run(host="0.0.0.0", port=5000)<|fim▁end|>
return redirect(url_for("profile"))
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-supported data sources. Envelope: A ctypes structure for bounding boxes (GDAL library not required). OGRGeometry: Object for accessing OGR Geometry functionality. OGRGeomType: A class for representing the different OGR Geometry types (GDAL library not required). SpatialReference: Represents OSR Spatial Reference objects. The GDAL library will be imported from the system path using the default library name for the current OS. The default library path may be overridden by setting `GDAL_LIBRARY_PATH` in your settings with the path to the GDAL C library on your system. GDAL links to a large number of external libraries that consume RAM when loaded. Thus, it may desirable to disable GDAL on systems with limited RAM resources -- this may be accomplished by setting `GDAL_LIBRARY_PATH` to a non-existent file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; setting to None/False/'' will not work as a string must be given). """ from django.contrib.gis.gdal.error import (check_err, GDALException, OGRException, OGRIndexError, SRSException) # NOQA from django.contrib.gis.gdal.geomtype import OGRGeomType # NOQA __all__ = [ 'check_err', 'GDALException', 'OGRException', 'OGRIndexError', 'SRSException', 'OGRGeomType', 'HAS_GDAL', ] # Attempting to import objects that depend on the GDAL library. The # HAS_GDAL flag will be set to True if the library is present on # the system. try: from django.contrib.gis.gdal.driver import Driver # NOQA from django.contrib.gis.gdal.datasource import DataSource # NOQA from django.contrib.gis.gdal.libgdal import gdal_version, gdal_full_version, GDAL_VERSION # NOQA from django.contrib.gis.gdal.raster.source import GDALRaster # NOQA <|fim▁hole|> HAS_GDAL = True __all__ += [ 'Driver', 'DataSource', 'gdal_version', 'gdal_full_version', 'GDAL_VERSION', 'SpatialReference', 'CoordTransform', 'OGRGeometry', ] except GDALException: HAS_GDAL = False try: from django.contrib.gis.gdal.envelope import Envelope __all__ += ['Envelope'] except ImportError: # No ctypes, but don't raise an exception. pass<|fim▁end|>
from django.contrib.gis.gdal.srs import SpatialReference, CoordTransform # NOQA from django.contrib.gis.gdal.geometries import OGRGeometry # NOQA
<|file_name|>resolve.rs<|end_file_name|><|fim▁begin|>use super::encode::Metadata; use crate::core::dependency::DepKind; use crate::core::interning::InternedString; use crate::core::{Dependency, PackageId, PackageIdSpec, Summary, Target}; use crate::util::errors::CargoResult; use crate::util::Graph; use std::borrow::Borrow; use std::cmp; use std::collections::{HashMap, HashSet}; use std::fmt; /// Represents a fully-resolved package dependency graph. Each node in the graph /// is a package and edges represent dependencies between packages. /// /// Each instance of `Resolve` also understands the full set of features used /// for each package. pub struct Resolve { /// A graph, whose vertices are packages and edges are dependency specifications /// from `Cargo.toml`. We need a `Vec` here because the same package /// might be present in both `[dependencies]` and `[build-dependencies]`. graph: Graph<PackageId, HashSet<Dependency>>, /// Replacements from the `[replace]` table. replacements: HashMap<PackageId, PackageId>, /// Inverted version of `replacements`. reverse_replacements: HashMap<PackageId, PackageId>, /// An empty `HashSet` to avoid creating a new `HashSet` for every package /// that does not have any features, and to avoid using `Option` to /// simplify the API. empty_features: Vec<InternedString>, /// Features enabled for a given package. features: HashMap<PackageId, Vec<InternedString>>, /// Checksum for each package. A SHA256 hash of the `.crate` file used to /// validate the correct crate file is used. This is `None` for sources /// that do not use `.crate` files, like path or git dependencies. checksums: HashMap<PackageId, Option<String>>, /// "Unknown" metadata. This is a collection of extra, unrecognized data /// found in the `[metadata]` section of `Cargo.lock`, preserved for /// forwards compatibility. metadata: Metadata, /// `[patch]` entries that did not match anything, preserved in /// `Cargo.lock` as the `[[patch.unused]]` table array. Tracking unused /// patches helps prevent Cargo from being forced to re-update the /// registry every time it runs, and keeps the resolve in a locked state /// so it doesn't re-resolve the unused entries. unused_patches: Vec<PackageId>, /// A map from packages to a set of their public dependencies public_dependencies: HashMap<PackageId, HashSet<PackageId>>, /// Version of the `Cargo.lock` format, see /// `cargo::core::resolver::encode` for more. version: ResolveVersion, summaries: HashMap<PackageId, Summary>, } /// A version to indicate how a `Cargo.lock` should be serialized. Currently /// V2 is the default when creating a new lockfile. If a V1 lockfile already /// exists, it will stay as V1. /// /// It's theorized that we can add more here over time to track larger changes /// to the `Cargo.lock` format, but we've yet to see how that strategy pans out. #[derive(PartialEq, Eq, Clone, Copy, Debug, PartialOrd, Ord)] pub enum ResolveVersion { /// Historical baseline for when this abstraction was added. V1, /// A more compact format, more amenable to avoiding source-control merge /// conflicts. The `dependencies` arrays are compressed and checksums are /// listed inline. Introduced in 2019 in version 1.38. New lockfiles use /// V2 by default starting in 1.41. V2, } impl Resolve { pub fn new( graph: Graph<PackageId, HashSet<Dependency>>, replacements: HashMap<PackageId, PackageId>, features: HashMap<PackageId, Vec<InternedString>>, checksums: HashMap<PackageId, Option<String>>, metadata: Metadata, unused_patches: Vec<PackageId>, version: ResolveVersion, summaries: HashMap<PackageId, Summary>, ) -> Resolve { let reverse_replacements = replacements.iter().map(|(&p, &r)| (r, p)).collect(); let public_dependencies = graph .iter() .map(|p| { let public_deps = graph .edges(p) .filter(|(_, deps)| { deps.iter() .any(|d| d.kind() == DepKind::Normal && d.is_public()) }) .map(|(dep_package, _)| *dep_package) .collect::<HashSet<PackageId>>(); (*p, public_deps) }) .collect(); Resolve { graph, replacements, features, checksums, metadata, unused_patches, empty_features: Vec::new(), reverse_replacements, public_dependencies, version, summaries, } } /// Resolves one of the paths from the given dependent package up to /// the root. pub fn path_to_top<'a>(&'a self, pkg: &'a PackageId) -> Vec<&'a PackageId> { self.graph.path_to_top(pkg) } pub fn register_used_patches(&mut self, patches: &[Summary]) { for summary in patches { if self.iter().any(|id| id == summary.package_id()) { continue; } self.unused_patches.push(summary.package_id()); } } pub fn merge_from(&mut self, previous: &Resolve) -> CargoResult<()> { // Given a previous instance of resolve, it should be forbidden to ever // have a checksums which *differ*. If the same package ID has differing // checksums, then something has gone wrong such as: // // * Something got seriously corrupted // * A "mirror" isn't actually a mirror as some changes were made // * A replacement source wasn't actually a replacement, some changes // were made // // In all of these cases, we want to report an error to indicate that // something is awry. Normal execution (esp just using crates.io) should // never run into this. for (id, cksum) in previous.checksums.iter() { if let Some(mine) = self.checksums.get(id) { if mine == cksum { continue; } // If the previous checksum wasn't calculated, the current // checksum is `Some`. This may indicate that a source was // erroneously replaced or was replaced with something that // desires stronger checksum guarantees than can be afforded // elsewhere. if cksum.is_none() { anyhow::bail!( "\ checksum for `{}` was not previously calculated, but a checksum could now \ be calculated this could be indicative of a few possible situations: * the source `{}` did not previously support checksums, but was replaced with one that does * newer Cargo implementations know how to checksum this source, but this older implementation does not * the lock file is corrupt ", id, id.source_id() ) // If our checksum hasn't been calculated, then it could mean // that future Cargo figured out how to checksum something or // more realistically we were overridden with a source that does // not have checksums. } else if mine.is_none() { anyhow::bail!( "\ checksum for `{}` could not be calculated, but a checksum is listed in \ the existing lock file this could be indicative of a few possible situations: * the source `{}` supports checksums, but was replaced with one that doesn't * the lock file is corrupt unable to verify that `{0}` is the same as when the lockfile was generated ", id, id.source_id() ) // If the checksums aren't equal, and neither is None, then they // must both be Some, in which case the checksum now differs. // That's quite bad! } else { anyhow::bail!( "\ checksum for `{}` changed between lock files this could be indicative of a few possible errors: * the lock file is corrupt * a replacement source in use (e.g., a mirror) returned a different checksum * the source itself may be corrupt in one way or another unable to verify that `{0}` is the same as when the lockfile was generated ", id ); } } } // Be sure to just copy over any unknown metadata. self.metadata = previous.metadata.clone(); // The goal of Cargo is largely to preserve the encoding of `Cargo.lock` // that it finds on the filesystem. Sometimes `Cargo.lock` changes are // in the works where they haven't been set as the default yet but will // become the default soon. // // The scenarios we could be in are: // // * This is a brand new lock file with nothing previous. In that case // this method isn't actually called at all, but instead // `default_for_new_lockfiles` called below was encoded during the // resolution step, so that's what we're gonna use. // // * We have an old lock file. In this case we want to switch the // version to `default_for_old_lockfiles`. That puts us in one of // three cases: // // * Our version is older than the default. This means that we're // migrating someone forward, so we switch the encoding. // * Our version is equal to the default, nothing to do! // * Our version is *newer* than the default. This is where we // critically keep the new version of encoding. // // This strategy should get new lockfiles into the pipeline more quickly // while ensuring that any time an old cargo sees a future lock file it // keeps the future lockfile encoding. self.version = cmp::max( previous.version, ResolveVersion::default_for_old_lockfiles(), ); Ok(()) } pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool where PackageId: Borrow<Q>, Q: Ord + Eq, { self.graph.contains(k) } pub fn sort(&self) -> Vec<PackageId> { self.graph.sort() } pub fn iter<'a>(&'a self) -> impl Iterator<Item = PackageId> + 'a { self.graph.iter().cloned() } pub fn deps(&self, pkg: PackageId) -> impl Iterator<Item = (PackageId, &HashSet<Dependency>)> { self.deps_not_replaced(pkg) .map(move |(id, deps)| (self.replacement(id).unwrap_or(id), deps)) } pub fn deps_not_replaced( &self, pkg: PackageId, ) -> impl Iterator<Item = (PackageId, &HashSet<Dependency>)> { self.graph.edges(&pkg).map(|(id, deps)| (*id, deps)) } pub fn replacement(&self, pkg: PackageId) -> Option<PackageId> { self.replacements.get(&pkg).cloned() } pub fn replacements(&self) -> &HashMap<PackageId, PackageId> { &self.replacements } pub fn features(&self, pkg: PackageId) -> &[InternedString] { self.features.get(&pkg).unwrap_or(&self.empty_features) } /// This is only here for legacy support, it will be removed when /// switching to the new feature resolver. pub fn features_clone(&self) -> HashMap<PackageId, Vec<InternedString>> { self.features.clone()<|fim▁hole|> } pub fn is_public_dep(&self, pkg: PackageId, dep: PackageId) -> bool { self.public_dependencies .get(&pkg) .map(|public_deps| public_deps.contains(&dep)) .unwrap_or_else(|| panic!("Unknown dependency {:?} for package {:?}", dep, pkg)) } pub fn query(&self, spec: &str) -> CargoResult<PackageId> { PackageIdSpec::query_str(spec, self.iter()) } pub fn unused_patches(&self) -> &[PackageId] { &self.unused_patches } pub fn checksums(&self) -> &HashMap<PackageId, Option<String>> { &self.checksums } pub fn metadata(&self) -> &Metadata { &self.metadata } pub fn extern_crate_name( &self, from: PackageId, to: PackageId, to_target: &Target, ) -> CargoResult<String> { let empty_set: HashSet<Dependency> = HashSet::new(); let deps = if from == to { &empty_set } else { self.dependencies_listed(from, to) }; let crate_name = to_target.crate_name(); let mut names = deps.iter().map(|d| { d.explicit_name_in_toml() .map(|s| s.as_str().replace("-", "_")) .unwrap_or_else(|| crate_name.clone()) }); let name = names.next().unwrap_or_else(|| crate_name.clone()); for n in names { anyhow::ensure!( n == name, "the crate `{}` depends on crate `{}` multiple times with different names", from, to, ); } Ok(name) } fn dependencies_listed(&self, from: PackageId, to: PackageId) -> &HashSet<Dependency> { // We've got a dependency on `from` to `to`, but this dependency edge // may be affected by [replace]. If the `to` package is listed as the // target of a replacement (aka the key of a reverse replacement map) // then we try to find our dependency edge through that. If that fails // then we go down below assuming it's not replaced. // // Note that we don't treat `from` as if it's been replaced because // that's where the dependency originates from, and we only replace // targets of dependencies not the originator. if let Some(replace) = self.reverse_replacements.get(&to) { if let Some(deps) = self.graph.edge(&from, replace) { return deps; } } match self.graph.edge(&from, &to) { Some(ret) => ret, None => panic!("no Dependency listed for `{}` => `{}`", from, to), } } /// Returns the version of the encoding that's being used for this lock /// file. pub fn version(&self) -> &ResolveVersion { &self.version } pub fn summary(&self, pkg_id: PackageId) -> &Summary { &self.summaries[&pkg_id] } } impl PartialEq for Resolve { fn eq(&self, other: &Resolve) -> bool { macro_rules! compare { ($($fields:ident)* | $($ignored:ident)*) => { let Resolve { $($fields,)* $($ignored: _,)* } = self; $($fields == &other.$fields)&&* } } compare! { // fields to compare graph replacements reverse_replacements empty_features features checksums metadata unused_patches public_dependencies summaries | // fields to ignore version } } } impl fmt::Debug for Resolve { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { writeln!(fmt, "graph: {:?}", self.graph)?; writeln!(fmt, "\nfeatures: {{")?; for (pkg, features) in &self.features { writeln!(fmt, " {}: {:?}", pkg, features)?; } write!(fmt, "}}") } } impl ResolveVersion { /// The default way to encode new `Cargo.lock` files. /// /// It's important that if a new version of `ResolveVersion` is added that /// this is not updated until *at least* the support for the version is in /// the stable release of Rust. It's ok for this to be newer than /// `default_for_old_lockfiles` below. pub fn default_for_new_lockfiles() -> ResolveVersion { ResolveVersion::V2 } /// The default way to encode old preexisting `Cargo.lock` files. This is /// often trailing the new lockfiles one above to give older projects a /// longer time to catch up. /// /// It's important that this trails behind `default_for_new_lockfiles` for /// quite some time. This gives projects a quite large window to update in /// where we don't force updates, so if projects span many versions of Cargo /// all those versions of Cargo will have support for a new version of the /// lock file. pub fn default_for_old_lockfiles() -> ResolveVersion { ResolveVersion::V1 } }<|fim▁end|>
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup(name='MODEL1302010006', version=20140916, description='MODEL1302010006 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/MODEL1302010006', maintainer='Stanley Gu', maintainer_url='[email protected]', packages=find_packages(),<|fim▁hole|><|fim▁end|>
package_data={'': ['*.xml', 'README.md']}, )
<|file_name|>resize-app.py<|end_file_name|><|fim▁begin|>def resizeApp(app, dx, dy): switchApp(app) corner = find(Pattern("1273159241516.png").targetOffset(3,14)) dragDrop(corner, corner.getCenter().offset(dx, dy)) resizeApp("Safari", 50, 50) # exists("1273159241516.png") # click(Pattern("1273159241516.png").targetOffset(3,14).similar(0.7).firstN(2)) # with Region(10,100,300,300):<|fim▁hole|># pass # click("__SIKULI-CAPTURE-BUTTON__")<|fim▁end|>
<|file_name|>ModifyUserSpectraS3ResponseParser.java<|end_file_name|><|fim▁begin|>/* * ****************************************************************************** * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; <|fim▁hole|>import com.spectralogic.ds3client.networking.WebResponse; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.IOException; import java.io.InputStream; public class ModifyUserSpectraS3ResponseParser extends AbstractResponseParser<ModifyUserSpectraS3Response> { private final int[] expectedStatusCodes = new int[]{200}; @Override public ModifyUserSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { final SpectraUser result = XmlOutput.fromXml(inputStream, SpectraUser.class); return new ModifyUserSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); } default: assert false: "validateStatusCode should have made it impossible to reach this line"; } } throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); } }<|fim▁end|>
import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; import com.spectralogic.ds3client.commands.spectrads3.ModifyUserSpectraS3Response; import com.spectralogic.ds3client.models.SpectraUser;
<|file_name|>virtualenv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Create a "virtual" Python installation """ # If you change the version here, change it in setup.py # and docs/conf.py as well. virtualenv_version = "1.7.1.2" import base64 import sys import os import optparse import re import shutil import logging import tempfile import zlib import errno import distutils.sysconfig from distutils.util import strtobool try: import subprocess except ImportError: if sys.version_info <= (2, 3): print('ERROR: %s' % sys.exc_info()[1]) print('ERROR: this script requires Python 2.4 or greater; or at least the subprocess module.') print('If you copy subprocess.py from a newer version of Python this script will probably work') sys.exit(101) else: raise try: set except NameError: from sets import Set as set try: basestring except NameError: basestring = str try: import ConfigParser except ImportError: import configparser as ConfigParser join = os.path.join py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1]) is_jython = sys.platform.startswith('java') is_pypy = hasattr(sys, 'pypy_version_info') is_win = (sys.platform == 'win32') abiflags = getattr(sys, 'abiflags', '') user_dir = os.path.expanduser('~') if sys.platform == 'win32': user_dir = os.environ.get('APPDATA', user_dir) # Use %APPDATA% for roaming default_storage_dir = os.path.join(user_dir, 'virtualenv') else: default_storage_dir = os.path.join(user_dir, '.virtualenv') default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') if is_pypy: expected_exe = 'pypy' elif is_jython: expected_exe = 'jython' else: expected_exe = 'python' REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath', 'fnmatch', 'locale', 'encodings', 'codecs', 'stat', 'UserDict', 'readline', 'copy_reg', 'types', 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', 'zlib'] REQUIRED_FILES = ['lib-dynload', 'config'] majver, minver = sys.version_info[:2] if majver == 2: if minver >= 6: REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc']) if minver >= 7: REQUIRED_MODULES.extend(['_weakrefset']) if minver <= 3: REQUIRED_MODULES.extend(['sets', '__future__']) elif majver == 3: # Some extra modules are needed for Python 3, but different ones # for different versions. REQUIRED_MODULES.extend(['_abcoll', 'warnings', 'linecache', 'abc', 'io', '_weakrefset', 'copyreg', 'tempfile', 'random', '__future__', 'collections', 'keyword', 'tarfile', 'shutil', 'struct', 'copy']) if minver >= 2: REQUIRED_FILES[-1] = 'config-%s' % majver if minver == 3: # The whole list of 3.3 modules is reproduced below - the current # uncommented ones are required for 3.3 as of now, but more may be # added as 3.3 development continues. REQUIRED_MODULES.extend([ #"aifc", #"antigravity", #"argparse", #"ast", #"asynchat", #"asyncore", "base64", #"bdb", #"binhex", "bisect", #"calendar", #"cgi", #"cgitb", #"chunk", #"cmd", #"codeop", #"code", #"colorsys", #"_compat_pickle", #"compileall", #"concurrent", #"configparser", #"contextlib", #"cProfile", #"crypt", #"csv", #"ctypes", #"curses", #"datetime", #"dbm", #"decimal", #"difflib", #"dis", #"doctest", #"dummy_threading", "_dummy_thread", #"email", #"filecmp", #"fileinput", #"formatter", #"fractions", #"ftplib", #"functools", #"getopt", #"getpass", #"gettext", #"glob", #"gzip", "hashlib", "heapq", "hmac", #"html", #"http", #"idlelib", #"imaplib", #"imghdr", #"importlib", #"inspect", #"json", #"lib2to3", #"logging", #"macpath", #"macurl2path", #"mailbox", #"mailcap", #"_markupbase", #"mimetypes", #"modulefinder", #"multiprocessing", #"netrc", #"nntplib", #"nturl2path", #"numbers", #"opcode", #"optparse", #"os2emxpath", #"pdb", #"pickle", #"pickletools", #"pipes", #"pkgutil", #"platform", #"plat-linux2", #"plistlib", #"poplib", #"pprint", #"profile", #"pstats", #"pty", #"pyclbr", #"py_compile", #"pydoc_data", #"pydoc", #"_pyio", #"queue", #"quopri", "reprlib", "rlcompleter", #"runpy", #"sched", #"shelve", #"shlex", #"smtpd", #"smtplib", #"sndhdr", #"socket", #"socketserver", #"sqlite3", #"ssl", #"stringprep", #"string", #"_strptime", #"subprocess", #"sunau", #"symbol", #"symtable", #"sysconfig", #"tabnanny", #"telnetlib", #"test", #"textwrap", #"this", #"_threading_local", #"threading", #"timeit", #"tkinter", #"tokenize", #"token", #"traceback", #"trace", #"tty", #"turtledemo", #"turtle", #"unittest", #"urllib", #"uuid", #"uu", #"wave", "weakref", #"webbrowser", #"wsgiref", #"xdrlib", #"xml", #"xmlrpc", #"zipfile", ]) if is_pypy: # these are needed to correctly display the exceptions that may happen # during the bootstrap REQUIRED_MODULES.extend(['traceback', 'linecache']) class Logger(object): """ Logging object for use in command-line script. Allows ranges of levels, to avoid some redundancy of displayed information. """ DEBUG = logging.DEBUG INFO = logging.INFO NOTIFY = (logging.INFO+logging.WARN)/2 WARN = WARNING = logging.WARN ERROR = logging.ERROR FATAL = logging.FATAL LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] def __init__(self, consumers): self.consumers = consumers self.indent = 0 self.in_progress = None self.in_progress_hanging = False def debug(self, msg, *args, **kw): self.log(self.DEBUG, msg, *args, **kw) def info(self, msg, *args, **kw): self.log(self.INFO, msg, *args, **kw) def notify(self, msg, *args, **kw): self.log(self.NOTIFY, msg, *args, **kw) def warn(self, msg, *args, **kw): self.log(self.WARN, msg, *args, **kw) def error(self, msg, *args, **kw): self.log(self.WARN, msg, *args, **kw) def fatal(self, msg, *args, **kw): self.log(self.FATAL, msg, *args, **kw) def log(self, level, msg, *args, **kw): if args: if kw: raise TypeError( "You may give positional or keyword arguments, not both") args = args or kw rendered = None for consumer_level, consumer in self.consumers: if self.level_matches(level, consumer_level): if (self.in_progress_hanging and consumer in (sys.stdout, sys.stderr)): self.in_progress_hanging = False sys.stdout.write('\n') sys.stdout.flush() if rendered is None: if args: rendered = msg % args else: rendered = msg rendered = ' '*self.indent + rendered if hasattr(consumer, 'write'): consumer.write(rendered+'\n') else: consumer(rendered) def start_progress(self, msg): assert not self.in_progress, ( "Tried to start_progress(%r) while in_progress %r" % (msg, self.in_progress)) if self.level_matches(self.NOTIFY, self._stdout_level()): sys.stdout.write(msg) sys.stdout.flush() self.in_progress_hanging = True else: self.in_progress_hanging = False self.in_progress = msg def end_progress(self, msg='done.'): assert self.in_progress, ( "Tried to end_progress without start_progress") if self.stdout_level_matches(self.NOTIFY): if not self.in_progress_hanging: # Some message has been printed out since start_progress<|fim▁hole|> sys.stdout.write(msg + '\n') sys.stdout.flush() self.in_progress = None self.in_progress_hanging = False def show_progress(self): """If we are in a progress scope, and no log messages have been shown, write out another '.'""" if self.in_progress_hanging: sys.stdout.write('.') sys.stdout.flush() def stdout_level_matches(self, level): """Returns true if a message at this level will go to stdout""" return self.level_matches(level, self._stdout_level()) def _stdout_level(self): """Returns the level that stdout runs at""" for level, consumer in self.consumers: if consumer is sys.stdout: return level return self.FATAL def level_matches(self, level, consumer_level): """ >>> l = Logger([]) >>> l.level_matches(3, 4) False >>> l.level_matches(3, 2) True >>> l.level_matches(slice(None, 3), 3) False >>> l.level_matches(slice(None, 3), 2) True >>> l.level_matches(slice(1, 3), 1) True >>> l.level_matches(slice(2, 3), 1) False """ if isinstance(level, slice): start, stop = level.start, level.stop if start is not None and start > consumer_level: return False if stop is not None and stop <= consumer_level: return False return True else: return level >= consumer_level #@classmethod def level_for_integer(cls, level): levels = cls.LEVELS if level < 0: return levels[0] if level >= len(levels): return levels[-1] return levels[level] level_for_integer = classmethod(level_for_integer) # create a silent logger just to prevent this from being undefined # will be overridden with requested verbosity main() is called. logger = Logger([(Logger.LEVELS[-1], sys.stdout)]) def mkdir(path): if not os.path.exists(path): logger.info('Creating %s', path) os.makedirs(path) else: logger.info('Directory %s already exists', path) def copyfileordir(src, dest): if os.path.isdir(src): shutil.copytree(src, dest, True) else: shutil.copy2(src, dest) def copyfile(src, dest, symlink=True): if not os.path.exists(src): # Some bad symlink in the src logger.warn('Cannot find file %s (bad symlink)', src) return if os.path.exists(dest): logger.debug('File %s already exists', dest) return if not os.path.exists(os.path.dirname(dest)): logger.info('Creating parent directories for %s' % os.path.dirname(dest)) os.makedirs(os.path.dirname(dest)) if not os.path.islink(src): srcpath = os.path.abspath(src) else: srcpath = os.readlink(src) if symlink and hasattr(os, 'symlink') and not is_win: logger.info('Symlinking %s', dest) try: os.symlink(srcpath, dest) except (OSError, NotImplementedError): logger.info('Symlinking failed, copying to %s', dest) copyfileordir(src, dest) else: logger.info('Copying to %s', dest) copyfileordir(src, dest) def writefile(dest, content, overwrite=True): if not os.path.exists(dest): logger.info('Writing %s', dest) f = open(dest, 'wb') f.write(content.encode('utf-8')) f.close() return else: f = open(dest, 'rb') c = f.read() f.close() if c != content: if not overwrite: logger.notify('File %s exists with different content; not overwriting', dest) return logger.notify('Overwriting %s with new content', dest) f = open(dest, 'wb') f.write(content.encode('utf-8')) f.close() else: logger.info('Content %s already in place', dest) def rmtree(dir): if os.path.exists(dir): logger.notify('Deleting tree %s', dir) shutil.rmtree(dir) else: logger.info('Do not need to delete %s; already gone', dir) def make_exe(fn): if hasattr(os, 'chmod'): oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 os.chmod(fn, newmode) logger.info('Changed mode of %s to %s', fn, oct(newmode)) def _find_file(filename, dirs): for dir in reversed(dirs): if os.path.exists(join(dir, filename)): return join(dir, filename) return filename def _install_req(py_executable, unzip=False, distribute=False, search_dirs=None, never_download=False): if search_dirs is None: search_dirs = file_search_dirs() if not distribute: setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3] project_name = 'setuptools' bootstrap_script = EZ_SETUP_PY source = None else: setup_fn = None source = 'distribute-0.6.24.tar.gz' project_name = 'distribute' bootstrap_script = DISTRIBUTE_SETUP_PY if setup_fn is not None: setup_fn = _find_file(setup_fn, search_dirs) if source is not None: source = _find_file(source, search_dirs) if is_jython and os._name == 'nt': # Jython's .bat sys.executable can't handle a command line # argument with newlines fd, ez_setup = tempfile.mkstemp('.py') os.write(fd, bootstrap_script) os.close(fd) cmd = [py_executable, ez_setup] else: cmd = [py_executable, '-c', bootstrap_script] if unzip: cmd.append('--always-unzip') env = {} remove_from_env = [] if logger.stdout_level_matches(logger.DEBUG): cmd.append('-v') old_chdir = os.getcwd() if setup_fn is not None and os.path.exists(setup_fn): logger.info('Using existing %s egg: %s' % (project_name, setup_fn)) cmd.append(setup_fn) if os.environ.get('PYTHONPATH'): env['PYTHONPATH'] = setup_fn + os.path.pathsep + os.environ['PYTHONPATH'] else: env['PYTHONPATH'] = setup_fn else: # the source is found, let's chdir if source is not None and os.path.exists(source): logger.info('Using existing %s egg: %s' % (project_name, source)) os.chdir(os.path.dirname(source)) # in this case, we want to be sure that PYTHONPATH is unset (not # just empty, really unset), else CPython tries to import the # site.py that it's in virtualenv_support remove_from_env.append('PYTHONPATH') else: if never_download: logger.fatal("Can't find any local distributions of %s to install " "and --never-download is set. Either re-run virtualenv " "without the --never-download option, or place a %s " "distribution (%s) in one of these " "locations: %r" % (project_name, project_name, setup_fn or source, search_dirs)) sys.exit(1) logger.info('No %s egg found; downloading' % project_name) cmd.extend(['--always-copy', '-U', project_name]) logger.start_progress('Installing %s...' % project_name) logger.indent += 2 cwd = None if project_name == 'distribute': env['DONT_PATCH_SETUPTOOLS'] = 'true' def _filter_ez_setup(line): return filter_ez_setup(line, project_name) if not os.access(os.getcwd(), os.W_OK): cwd = tempfile.mkdtemp() if source is not None and os.path.exists(source): # the current working dir is hostile, let's copy the # tarball to a temp dir target = os.path.join(cwd, os.path.split(source)[-1]) shutil.copy(source, target) try: call_subprocess(cmd, show_stdout=False, filter_stdout=_filter_ez_setup, extra_env=env, remove_from_env=remove_from_env, cwd=cwd) finally: logger.indent -= 2 logger.end_progress() if os.getcwd() != old_chdir: os.chdir(old_chdir) if is_jython and os._name == 'nt': os.remove(ez_setup) def file_search_dirs(): here = os.path.dirname(os.path.abspath(__file__)) dirs = ['.', here, join(here, 'virtualenv_support')] if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv': # Probably some boot script; just in case virtualenv is installed... try: import virtualenv except ImportError: pass else: dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support')) return [d for d in dirs if os.path.isdir(d)] def install_setuptools(py_executable, unzip=False, search_dirs=None, never_download=False): _install_req(py_executable, unzip, search_dirs=search_dirs, never_download=never_download) def install_distribute(py_executable, unzip=False, search_dirs=None, never_download=False): _install_req(py_executable, unzip, distribute=True, search_dirs=search_dirs, never_download=never_download) _pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) def install_pip(py_executable, search_dirs=None, never_download=False): if search_dirs is None: search_dirs = file_search_dirs() filenames = [] for dir in search_dirs: filenames.extend([join(dir, fn) for fn in os.listdir(dir) if _pip_re.search(fn)]) filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)] filenames.sort() filenames = [filename for basename, i, filename in filenames] if not filenames: filename = 'pip' else: filename = filenames[-1] easy_install_script = 'easy_install' if sys.platform == 'win32': easy_install_script = 'easy_install-script.py' cmd = [join(os.path.dirname(py_executable), easy_install_script), filename] if sys.platform == 'win32': cmd.insert(0, py_executable) if filename == 'pip': if never_download: logger.fatal("Can't find any local distributions of pip to install " "and --never-download is set. Either re-run virtualenv " "without the --never-download option, or place a pip " "source distribution (zip/tar.gz/tar.bz2) in one of these " "locations: %r" % search_dirs) sys.exit(1) logger.info('Installing pip from network...') else: logger.info('Installing existing %s distribution: %s' % ( os.path.basename(filename), filename)) logger.start_progress('Installing pip...') logger.indent += 2 def _filter_setup(line): return filter_ez_setup(line, 'pip') try: call_subprocess(cmd, show_stdout=False, filter_stdout=_filter_setup) finally: logger.indent -= 2 logger.end_progress() def filter_ez_setup(line, project_name='setuptools'): if not line.strip(): return Logger.DEBUG if project_name == 'distribute': for prefix in ('Extracting', 'Now working', 'Installing', 'Before', 'Scanning', 'Setuptools', 'Egg', 'Already', 'running', 'writing', 'reading', 'installing', 'creating', 'copying', 'byte-compiling', 'removing', 'Processing'): if line.startswith(prefix): return Logger.DEBUG return Logger.DEBUG for prefix in ['Reading ', 'Best match', 'Processing setuptools', 'Copying setuptools', 'Adding setuptools', 'Installing ', 'Installed ']: if line.startswith(prefix): return Logger.DEBUG return Logger.INFO class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter): """ Custom help formatter for use in ConfigOptionParser that updates the defaults before expanding them, allowing them to show up correctly in the help listing """ def expand_default(self, option): if self.parser is not None: self.parser.update_defaults(self.parser.defaults) return optparse.IndentedHelpFormatter.expand_default(self, option) class ConfigOptionParser(optparse.OptionParser): """ Custom option parser which updates its defaults by by checking the configuration files and environmental variables """ def __init__(self, *args, **kwargs): self.config = ConfigParser.RawConfigParser() self.files = self.get_config_files() self.config.read(self.files) optparse.OptionParser.__init__(self, *args, **kwargs) def get_config_files(self): config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False) if config_file and os.path.exists(config_file): return [config_file] return [default_config_file] def update_defaults(self, defaults): """ Updates the given defaults with values from the config files and the environ. Does a little special handling for certain types of options (lists). """ # Then go and look for the other sources of configuration: config = {} # 1. config files config.update(dict(self.get_config_section('virtualenv'))) # 2. environmental variables config.update(dict(self.get_environ_vars())) # Then set the options with those values for key, val in config.items(): key = key.replace('_', '-') if not key.startswith('--'): key = '--%s' % key # only prefer long opts option = self.get_option(key) if option is not None: # ignore empty values if not val: continue # handle multiline configs if option.action == 'append': val = val.split() else: option.nargs = 1 if option.action in ('store_true', 'store_false', 'count'): val = strtobool(val) try: val = option.convert_value(key, val) except optparse.OptionValueError: e = sys.exc_info()[1] print("An error occured during configuration: %s" % e) sys.exit(3) defaults[option.dest] = val return defaults def get_config_section(self, name): """ Get a section of a configuration """ if self.config.has_section(name): return self.config.items(name) return [] def get_environ_vars(self, prefix='VIRTUALENV_'): """ Returns a generator with all environmental vars with prefix VIRTUALENV """ for key, val in os.environ.items(): if key.startswith(prefix): yield (key.replace(prefix, '').lower(), val) def get_default_values(self): """ Overridding to make updating the defaults after instantiation of the option parser possible, update_defaults() does the dirty work. """ if not self.process_default_values: # Old, pre-Optik 1.5 behaviour. return optparse.Values(self.defaults) defaults = self.update_defaults(self.defaults.copy()) # ours for option in self._get_all_options(): default = defaults.get(option.dest) if isinstance(default, basestring): opt_str = option.get_opt_string() defaults[option.dest] = option.check_value(opt_str, default) return optparse.Values(defaults) def main(): parser = ConfigOptionParser( version=virtualenv_version, usage="%prog [OPTIONS] DEST_DIR", formatter=UpdatingDefaultsHelpFormatter()) parser.add_option( '-v', '--verbose', action='count', dest='verbose', default=0, help="Increase verbosity") parser.add_option( '-q', '--quiet', action='count', dest='quiet', default=0, help='Decrease verbosity') parser.add_option( '-p', '--python', dest='python', metavar='PYTHON_EXE', help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' 'interpreter to create the new environment. The default is the interpreter that ' 'virtualenv was installed with (%s)' % sys.executable) parser.add_option( '--clear', dest='clear', action='store_true', help="Clear out the non-root install and start from scratch") parser.add_option( '--no-site-packages', dest='no_site_packages', action='store_true', help="Don't give access to the global site-packages dir to the " "virtual environment") parser.add_option( '--system-site-packages', dest='system_site_packages', action='store_true', help="Give access to the global site-packages dir to the " "virtual environment") parser.add_option( '--unzip-setuptools', dest='unzip_setuptools', action='store_true', help="Unzip Setuptools or Distribute when installing it") parser.add_option( '--relocatable', dest='relocatable', action='store_true', help='Make an EXISTING virtualenv environment relocatable. ' 'This fixes up scripts and makes all .pth files relative') parser.add_option( '--distribute', dest='use_distribute', action='store_true', help='Use Distribute instead of Setuptools. Set environ variable ' 'VIRTUALENV_DISTRIBUTE to make it the default ') default_search_dirs = file_search_dirs() parser.add_option( '--extra-search-dir', dest="search_dirs", action="append", default=default_search_dirs, help="Directory to look for setuptools/distribute/pip distributions in. " "You can add any number of additional --extra-search-dir paths.") parser.add_option( '--never-download', dest="never_download", action="store_true", help="Never download anything from the network. Instead, virtualenv will fail " "if local distributions of setuptools/distribute/pip are not present.") parser.add_option( '--prompt=', dest='prompt', help='Provides an alternative prompt prefix for this environment') if 'extend_parser' in globals(): extend_parser(parser) options, args = parser.parse_args() global logger if 'adjust_options' in globals(): adjust_options(options, args) verbosity = options.verbose - options.quiet logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)]) if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): env = os.environ.copy() interpreter = resolve_interpreter(options.python) if interpreter == sys.executable: logger.warn('Already using interpreter %s' % interpreter) else: logger.notify('Running virtualenv with interpreter %s' % interpreter) env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' file = __file__ if file.endswith('.pyc'): file = file[:-1] popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env) raise SystemExit(popen.wait()) # Force --distribute on Python 3, since setuptools is not available. if majver > 2: options.use_distribute = True if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute: print( "The PYTHONDONTWRITEBYTECODE environment variable is " "not compatible with setuptools. Either use --distribute " "or unset PYTHONDONTWRITEBYTECODE.") sys.exit(2) if not args: print('You must provide a DEST_DIR') parser.print_help() sys.exit(2) if len(args) > 1: print('There must be only one argument: DEST_DIR (you gave %s)' % ( ' '.join(args))) parser.print_help() sys.exit(2) home_dir = args[0] if os.environ.get('WORKING_ENV'): logger.fatal('ERROR: you cannot run virtualenv while in a workingenv') logger.fatal('Please deactivate your workingenv, then re-run this script') sys.exit(3) if 'PYTHONHOME' in os.environ: logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it') del os.environ['PYTHONHOME'] if options.relocatable: make_environment_relocatable(home_dir) return if options.no_site_packages: logger.warn('The --no-site-packages flag is deprecated; it is now ' 'the default behavior.') create_environment(home_dir, site_packages=options.system_site_packages, clear=options.clear, unzip_setuptools=options.unzip_setuptools, use_distribute=options.use_distribute, prompt=options.prompt, search_dirs=options.search_dirs, never_download=options.never_download) if 'after_install' in globals(): after_install(options, home_dir) def call_subprocess(cmd, show_stdout=True, filter_stdout=None, cwd=None, raise_on_returncode=True, extra_env=None, remove_from_env=None): cmd_parts = [] for part in cmd: if len(part) > 45: part = part[:20]+"..."+part[-20:] if ' ' in part or '\n' in part or '"' in part or "'" in part: part = '"%s"' % part.replace('"', '\\"') if hasattr(part, 'decode'): try: part = part.decode(sys.getdefaultencoding()) except UnicodeDecodeError: part = part.decode(sys.getfilesystemencoding()) cmd_parts.append(part) cmd_desc = ' '.join(cmd_parts) if show_stdout: stdout = None else: stdout = subprocess.PIPE logger.debug("Running command %s" % cmd_desc) if extra_env or remove_from_env: env = os.environ.copy() if extra_env: env.update(extra_env) if remove_from_env: for varname in remove_from_env: env.pop(varname, None) else: env = None try: proc = subprocess.Popen( cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, cwd=cwd, env=env) except Exception: e = sys.exc_info()[1] logger.fatal( "Error %s while executing command %s" % (e, cmd_desc)) raise all_output = [] if stdout is not None: stdout = proc.stdout encoding = sys.getdefaultencoding() fs_encoding = sys.getfilesystemencoding() while 1: line = stdout.readline() try: line = line.decode(encoding) except UnicodeDecodeError: line = line.decode(fs_encoding) if not line: break line = line.rstrip() all_output.append(line) if filter_stdout: level = filter_stdout(line) if isinstance(level, tuple): level, line = level logger.log(level, line) if not logger.stdout_level_matches(level): logger.show_progress() else: logger.info(line) else: proc.communicate() proc.wait() if proc.returncode: if raise_on_returncode: if all_output: logger.notify('Complete output from command %s:' % cmd_desc) logger.notify('\n'.join(all_output) + '\n----------------------------------------') raise OSError( "Command %s failed with error code %s" % (cmd_desc, proc.returncode)) else: logger.warn( "Command %s had error code %s" % (cmd_desc, proc.returncode)) def create_environment(home_dir, site_packages=False, clear=False, unzip_setuptools=False, use_distribute=False, prompt=None, search_dirs=None, never_download=False): """ Creates a new environment in ``home_dir``. If ``site_packages`` is true, then the global ``site-packages/`` directory will be on the path. If ``clear`` is true (default False) then the environment will first be cleared. """ home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) py_executable = os.path.abspath(install_python( home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear)) install_distutils(home_dir) # use_distribute also is True if VIRTUALENV_DISTRIBUTE env var is set # we also check VIRTUALENV_USE_DISTRIBUTE for backwards compatibility if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'): install_distribute(py_executable, unzip=unzip_setuptools, search_dirs=search_dirs, never_download=never_download) else: install_setuptools(py_executable, unzip=unzip_setuptools, search_dirs=search_dirs, never_download=never_download) install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) install_activate(home_dir, bin_dir, prompt) def path_locations(home_dir): """Return the path locations for the environment (where libraries are, where scripts go, etc)""" # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its # prefix arg is broken: http://bugs.python.org/issue3386 if sys.platform == 'win32': # Windows has lots of problems with executables with spaces in # the name; this function will remove them (using the ~1 # format): mkdir(home_dir) if ' ' in home_dir: try: import win32api except ImportError: print('Error: the path "%s" has a space in it' % home_dir) print('To handle these kinds of paths, the win32api module must be installed:') print(' http://sourceforge.net/projects/pywin32/') sys.exit(3) home_dir = win32api.GetShortPathName(home_dir) lib_dir = join(home_dir, 'Lib') inc_dir = join(home_dir, 'Include') bin_dir = join(home_dir, 'Scripts') elif is_jython: lib_dir = join(home_dir, 'Lib') inc_dir = join(home_dir, 'Include') bin_dir = join(home_dir, 'bin') elif is_pypy: lib_dir = home_dir inc_dir = join(home_dir, 'include') bin_dir = join(home_dir, 'bin') else: lib_dir = join(home_dir, 'lib', py_version) inc_dir = join(home_dir, 'include', py_version + abiflags) bin_dir = join(home_dir, 'bin') return home_dir, lib_dir, inc_dir, bin_dir def change_prefix(filename, dst_prefix): prefixes = [sys.prefix] if sys.platform == "darwin": prefixes.extend(( os.path.join("/Library/Python", sys.version[:3], "site-packages"), os.path.join(sys.prefix, "Extras", "lib", "python"), os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"))) if hasattr(sys, 'real_prefix'): prefixes.append(sys.real_prefix) prefixes = list(map(os.path.abspath, prefixes)) filename = os.path.abspath(filename) for src_prefix in prefixes: if filename.startswith(src_prefix): _, relpath = filename.split(src_prefix, 1) assert relpath[0] == os.sep relpath = relpath[1:] return join(dst_prefix, relpath) assert False, "Filename %s does not start with any of these prefixes: %s" % \ (filename, prefixes) def copy_required_modules(dst_prefix): import imp # If we are running under -p, we need to remove the current # directory from sys.path temporarily here, so that we # definitely get the modules from the site directory of # the interpreter we are running under, not the one # virtualenv.py is installed under (which might lead to py2/py3 # incompatibility issues) _prev_sys_path = sys.path if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): sys.path = sys.path[1:] try: for modname in REQUIRED_MODULES: if modname in sys.builtin_module_names: logger.info("Ignoring built-in bootstrap module: %s" % modname) continue try: f, filename, _ = imp.find_module(modname) except ImportError: logger.info("Cannot import bootstrap module: %s" % modname) else: if f is not None: f.close() dst_filename = change_prefix(filename, dst_prefix) copyfile(filename, dst_filename) if filename.endswith('.pyc'): pyfile = filename[:-1] if os.path.exists(pyfile): copyfile(pyfile, dst_filename[:-1]) finally: sys.path = _prev_sys_path def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear): """Install just the base environment, no distutils patches etc""" if sys.executable.startswith(bin_dir): print('Please use the *system* python to run this script') return if clear: rmtree(lib_dir) ## FIXME: why not delete it? ## Maybe it should delete everything with #!/path/to/venv/python in it logger.notify('Not deleting %s', bin_dir) if hasattr(sys, 'real_prefix'): logger.notify('Using real prefix %r' % sys.real_prefix) prefix = sys.real_prefix else: prefix = sys.prefix mkdir(lib_dir) fix_lib64(lib_dir) stdlib_dirs = [os.path.dirname(os.__file__)] if sys.platform == 'win32': stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) elif sys.platform == 'darwin': stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) if hasattr(os, 'symlink'): logger.info('Symlinking Python bootstrap modules') else: logger.info('Copying Python bootstrap modules') logger.indent += 2 try: # copy required files... for stdlib_dir in stdlib_dirs: if not os.path.isdir(stdlib_dir): continue for fn in os.listdir(stdlib_dir): bn = os.path.splitext(fn)[0] if fn != 'site-packages' and bn in REQUIRED_FILES: copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) # ...and modules copy_required_modules(home_dir) finally: logger.indent -= 2 mkdir(join(lib_dir, 'site-packages')) import site site_filename = site.__file__ if site_filename.endswith('.pyc'): site_filename = site_filename[:-1] elif site_filename.endswith('$py.class'): site_filename = site_filename.replace('$py.class', '.py') site_filename_dst = change_prefix(site_filename, home_dir) site_dir = os.path.dirname(site_filename_dst) writefile(site_filename_dst, SITE_PY) writefile(join(site_dir, 'orig-prefix.txt'), prefix) site_packages_filename = join(site_dir, 'no-global-site-packages.txt') if not site_packages: writefile(site_packages_filename, '') else: if os.path.exists(site_packages_filename): logger.info('Deleting %s' % site_packages_filename) os.unlink(site_packages_filename) if is_pypy or is_win: stdinc_dir = join(prefix, 'include') else: stdinc_dir = join(prefix, 'include', py_version + abiflags) if os.path.exists(stdinc_dir): copyfile(stdinc_dir, inc_dir) else: logger.debug('No include dir %s' % stdinc_dir) # pypy never uses exec_prefix, just ignore it if sys.exec_prefix != prefix and not is_pypy: if sys.platform == 'win32': exec_dir = join(sys.exec_prefix, 'lib') elif is_jython: exec_dir = join(sys.exec_prefix, 'Lib') else: exec_dir = join(sys.exec_prefix, 'lib', py_version) for fn in os.listdir(exec_dir): copyfile(join(exec_dir, fn), join(lib_dir, fn)) if is_jython: # Jython has either jython-dev.jar and javalib/ dir, or just # jython.jar for name in 'jython-dev.jar', 'javalib', 'jython.jar': src = join(prefix, name) if os.path.exists(src): copyfile(src, join(home_dir, name)) # XXX: registry should always exist after Jython 2.5rc1 src = join(prefix, 'registry') if os.path.exists(src): copyfile(src, join(home_dir, 'registry'), symlink=False) copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), symlink=False) mkdir(bin_dir) py_executable = join(bin_dir, os.path.basename(sys.executable)) if 'Python.framework' in prefix: if re.search(r'/Python(?:-32|-64)*$', py_executable): # The name of the python executable is not quite what # we want, rename it. py_executable = os.path.join( os.path.dirname(py_executable), 'python') logger.notify('New %s executable in %s', expected_exe, py_executable) pcbuild_dir = os.path.dirname(sys.executable) pyd_pth = os.path.join(lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth') if is_win and os.path.exists(os.path.join(pcbuild_dir, 'build.bat')): logger.notify('Detected python running from build directory %s', pcbuild_dir) logger.notify('Writing .pth file linking to build directory for *.pyd files') writefile(pyd_pth, pcbuild_dir) else: pcbuild_dir = None if os.path.exists(pyd_pth): logger.info('Deleting %s (not Windows env or not build directory python)' % pyd_pth) os.unlink(pyd_pth) if sys.executable != py_executable: ## FIXME: could I just hard link? executable = sys.executable if sys.platform == 'cygwin' and os.path.exists(executable + '.exe'): # Cygwin misreports sys.executable sometimes executable += '.exe' py_executable += '.exe' logger.info('Executable actually exists in %s' % executable) shutil.copyfile(executable, py_executable) make_exe(py_executable) if sys.platform == 'win32' or sys.platform == 'cygwin': pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe') if os.path.exists(pythonw): logger.info('Also created pythonw.exe') shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe')) python_d = os.path.join(os.path.dirname(sys.executable), 'python_d.exe') python_d_dest = os.path.join(os.path.dirname(py_executable), 'python_d.exe') if os.path.exists(python_d): logger.info('Also created python_d.exe') shutil.copyfile(python_d, python_d_dest) elif os.path.exists(python_d_dest): logger.info('Removed python_d.exe as it is no longer at the source') os.unlink(python_d_dest) # we need to copy the DLL to enforce that windows will load the correct one. # may not exist if we are cygwin. py_executable_dll = 'python%s%s.dll' % ( sys.version_info[0], sys.version_info[1]) py_executable_dll_d = 'python%s%s_d.dll' % ( sys.version_info[0], sys.version_info[1]) pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll) pythondll_d = os.path.join(os.path.dirname(sys.executable), py_executable_dll_d) pythondll_d_dest = os.path.join(os.path.dirname(py_executable), py_executable_dll_d) if os.path.exists(pythondll): logger.info('Also created %s' % py_executable_dll) shutil.copyfile(pythondll, os.path.join(os.path.dirname(py_executable), py_executable_dll)) if os.path.exists(pythondll_d): logger.info('Also created %s' % py_executable_dll_d) shutil.copyfile(pythondll_d, pythondll_d_dest) elif os.path.exists(pythondll_d_dest): logger.info('Removed %s as the source does not exist' % pythondll_d_dest) os.unlink(pythondll_d_dest) if is_pypy: # make a symlink python --> pypy-c python_executable = os.path.join(os.path.dirname(py_executable), 'python') logger.info('Also created executable %s' % python_executable) copyfile(py_executable, python_executable) if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe: secondary_exe = os.path.join(os.path.dirname(py_executable), expected_exe) py_executable_ext = os.path.splitext(py_executable)[1] if py_executable_ext == '.exe': # python2.4 gives an extension of '.4' :P secondary_exe += py_executable_ext if os.path.exists(secondary_exe): logger.warn('Not overwriting existing %s script %s (you must use %s)' % (expected_exe, secondary_exe, py_executable)) else: logger.notify('Also creating executable in %s' % secondary_exe) shutil.copyfile(sys.executable, secondary_exe) make_exe(secondary_exe) if '.framework' in prefix: if 'Python.framework' in prefix: logger.debug('MacOSX Python framework detected') # Make sure we use the the embedded interpreter inside # the framework, even if sys.executable points to # the stub executable in ${sys.prefix}/bin # See http://groups.google.com/group/python-virtualenv/ # browse_thread/thread/17cab2f85da75951 original_python = os.path.join( prefix, 'Resources/Python.app/Contents/MacOS/Python') if 'EPD' in prefix: logger.debug('EPD framework detected') original_python = os.path.join(prefix, 'bin/python') shutil.copy(original_python, py_executable) # Copy the framework's dylib into the virtual # environment virtual_lib = os.path.join(home_dir, '.Python') if os.path.exists(virtual_lib): os.unlink(virtual_lib) copyfile( os.path.join(prefix, 'Python'), virtual_lib) # And then change the install_name of the copied python executable try: call_subprocess( ["install_name_tool", "-change", os.path.join(prefix, 'Python'), '@executable_path/../.Python', py_executable]) except: logger.fatal( "Could not call install_name_tool -- you must have Apple's development tools installed") raise # Some tools depend on pythonX.Y being present py_executable_version = '%s.%s' % ( sys.version_info[0], sys.version_info[1]) if not py_executable.endswith(py_executable_version): # symlinking pythonX.Y > python pth = py_executable + '%s.%s' % ( sys.version_info[0], sys.version_info[1]) if os.path.exists(pth): os.unlink(pth) os.symlink('python', pth) else: # reverse symlinking python -> pythonX.Y (with --python) pth = join(bin_dir, 'python') if os.path.exists(pth): os.unlink(pth) os.symlink(os.path.basename(py_executable), pth) if sys.platform == 'win32' and ' ' in py_executable: # There's a bug with subprocess on Windows when using a first # argument that has a space in it. Instead we have to quote # the value: py_executable = '"%s"' % py_executable cmd = [py_executable, '-c', """ import sys prefix = sys.prefix if sys.version_info[0] == 3: prefix = prefix.encode('utf8') if hasattr(sys.stdout, 'detach'): sys.stdout = sys.stdout.detach() elif hasattr(sys.stdout, 'buffer'): sys.stdout = sys.stdout.buffer sys.stdout.write(prefix) """] logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) try: proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) proc_stdout, proc_stderr = proc.communicate() except OSError: e = sys.exc_info()[1] if e.errno == errno.EACCES: logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e)) sys.exit(100) else: raise e proc_stdout = proc_stdout.strip().decode("utf-8") proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) if hasattr(norm_home_dir, 'decode'): norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) if proc_stdout != norm_home_dir: logger.fatal( 'ERROR: The executable %s is not functioning' % py_executable) logger.fatal( 'ERROR: It thinks sys.prefix is %r (should be %r)' % (proc_stdout, norm_home_dir)) logger.fatal( 'ERROR: virtualenv is not compatible with this system or executable') if sys.platform == 'win32': logger.fatal( 'Note: some Windows users have reported this error when they ' 'installed Python for "Only this user" or have multiple ' 'versions of Python installed. Copying the appropriate ' 'PythonXX.dll to the virtualenv Scripts/ directory may fix ' 'this problem.') sys.exit(100) else: logger.info('Got sys.prefix result: %r' % proc_stdout) pydistutils = os.path.expanduser('~/.pydistutils.cfg') if os.path.exists(pydistutils): logger.notify('Please make sure you remove any previous custom paths from ' 'your %s file.' % pydistutils) ## FIXME: really this should be calculated earlier fix_local_scheme(home_dir) return py_executable def install_activate(home_dir, bin_dir, prompt=None): home_dir = os.path.abspath(home_dir) if sys.platform == 'win32' or is_jython and os._name == 'nt': files = { 'activate.bat': ACTIVATE_BAT, 'deactivate.bat': DEACTIVATE_BAT, 'activate.ps1': ACTIVATE_PS, } # MSYS needs paths of the form /c/path/to/file drive, tail = os.path.splitdrive(home_dir.replace(os.sep, '/')) home_dir_msys = (drive and "/%s%s" or "%s%s") % (drive[:1], tail) # Run-time conditional enables (basic) Cygwin compatibility home_dir_sh = ("""$(if [ "$OSTYPE" "==" "cygwin" ]; then cygpath -u '%s'; else echo '%s'; fi;)""" % (home_dir, home_dir_msys)) files['activate'] = ACTIVATE_SH.replace('__VIRTUAL_ENV__', home_dir_sh) else: files = {'activate': ACTIVATE_SH} # suppling activate.fish in addition to, not instead of, the # bash script support. files['activate.fish'] = ACTIVATE_FISH # same for csh/tcsh support... files['activate.csh'] = ACTIVATE_CSH files['activate_this.py'] = ACTIVATE_THIS if hasattr(home_dir, 'decode'): home_dir = home_dir.decode(sys.getfilesystemencoding()) vname = os.path.basename(home_dir) for name, content in files.items(): content = content.replace('__VIRTUAL_PROMPT__', prompt or '') content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname) content = content.replace('__VIRTUAL_ENV__', home_dir) content = content.replace('__VIRTUAL_NAME__', vname) content = content.replace('__BIN_NAME__', os.path.basename(bin_dir)) writefile(os.path.join(bin_dir, name), content) def install_distutils(home_dir): distutils_path = change_prefix(distutils.__path__[0], home_dir) mkdir(distutils_path) ## FIXME: maybe this prefix setting should only be put in place if ## there's a local distutils.cfg with a prefix setting? home_dir = os.path.abspath(home_dir) ## FIXME: this is breaking things, removing for now: #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT) writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False) def fix_local_scheme(home_dir): """ Platforms that use the "posix_local" install scheme (like Ubuntu with Python 2.7) need to be given an additional "local" location, sigh. """ try: import sysconfig except ImportError: pass else: if sysconfig._get_default_scheme() == 'posix_local': local_path = os.path.join(home_dir, 'local') if not os.path.exists(local_path): os.mkdir(local_path) for subdir_name in os.listdir(home_dir): if subdir_name == 'local': continue os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \ os.path.join(local_path, subdir_name)) def fix_lib64(lib_dir): """ Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y instead of lib/pythonX.Y. If this is such a platform we'll just create a symlink so lib64 points to lib """ if [p for p in distutils.sysconfig.get_config_vars().values() if isinstance(p, basestring) and 'lib64' in p]: logger.debug('This system uses lib64; symlinking lib64 to lib') assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( "Unexpected python lib dir: %r" % lib_dir) lib_parent = os.path.dirname(lib_dir) assert os.path.basename(lib_parent) == 'lib', ( "Unexpected parent dir: %r" % lib_parent) copyfile(lib_parent, os.path.join(os.path.dirname(lib_parent), 'lib64')) def resolve_interpreter(exe): """ If the executable given isn't an absolute path, search $PATH for the interpreter """ if os.path.abspath(exe) != exe: paths = os.environ.get('PATH', '').split(os.pathsep) for path in paths: if os.path.exists(os.path.join(path, exe)): exe = os.path.join(path, exe) break if not os.path.exists(exe): logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) raise SystemExit(3) if not is_executable(exe): logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) raise SystemExit(3) return exe def is_executable(exe): """Checks a file is executable""" return os.access(exe, os.X_OK) ############################################################ ## Relocating the environment: def make_environment_relocatable(home_dir): """ Makes the already-existing environment use relative paths, and takes out the #!-based environment selection in scripts. """ home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) activate_this = os.path.join(bin_dir, 'activate_this.py') if not os.path.exists(activate_this): logger.fatal( 'The environment doesn\'t have a file %s -- please re-run virtualenv ' 'on this environment to update it' % activate_this) fixup_scripts(home_dir) fixup_pth_and_egg_link(home_dir) ## FIXME: need to fix up distutils.cfg OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3], 'activate', 'activate.bat', 'activate_this.py'] def fixup_scripts(home_dir): # This is what we expect at the top of scripts: shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir)) # This is what we'll put: new_shebang = '#!/usr/bin/env python%s' % sys.version[:3] activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this" if sys.platform == 'win32': bin_suffix = 'Scripts' else: bin_suffix = 'bin' bin_dir = os.path.join(home_dir, bin_suffix) home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) for filename in os.listdir(bin_dir): filename = os.path.join(bin_dir, filename) if not os.path.isfile(filename): # ignore subdirs, e.g. .svn ones. continue f = open(filename, 'rb') try: try: lines = f.read().decode('utf-8').splitlines() except UnicodeDecodeError: # This is probably a binary program instead # of a script, so just ignore it. continue finally: f.close() if not lines: logger.warn('Script %s is an empty file' % filename) continue if not lines[0].strip().startswith(shebang): if os.path.basename(filename) in OK_ABS_SCRIPTS: logger.debug('Cannot make script %s relative' % filename) elif lines[0].strip() == new_shebang: logger.info('Script %s has already been made relative' % filename) else: logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)' % (filename, shebang)) continue logger.notify('Making script %s relative' % filename) lines = [new_shebang+'\n', activate+'\n'] + lines[1:] f = open(filename, 'wb') f.write('\n'.join(lines).encode('utf-8')) f.close() def fixup_pth_and_egg_link(home_dir, sys_path=None): """Makes .pth and .egg-link files use relative paths""" home_dir = os.path.normcase(os.path.abspath(home_dir)) if sys_path is None: sys_path = sys.path for path in sys_path: if not path: path = '.' if not os.path.isdir(path): continue path = os.path.normcase(os.path.abspath(path)) if not path.startswith(home_dir): logger.debug('Skipping system (non-environment) directory %s' % path) continue for filename in os.listdir(path): filename = os.path.join(path, filename) if filename.endswith('.pth'): if not os.access(filename, os.W_OK): logger.warn('Cannot write .pth file %s, skipping' % filename) else: fixup_pth_file(filename) if filename.endswith('.egg-link'): if not os.access(filename, os.W_OK): logger.warn('Cannot write .egg-link file %s, skipping' % filename) else: fixup_egg_link(filename) def fixup_pth_file(filename): lines = [] prev_lines = [] f = open(filename) prev_lines = f.readlines() f.close() for line in prev_lines: line = line.strip() if (not line or line.startswith('#') or line.startswith('import ') or os.path.abspath(line) != line): lines.append(line) else: new_value = make_relative_path(filename, line) if line != new_value: logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename)) lines.append(new_value) if lines == prev_lines: logger.info('No changes to .pth file %s' % filename) return logger.notify('Making paths in .pth file %s relative' % filename) f = open(filename, 'w') f.write('\n'.join(lines) + '\n') f.close() def fixup_egg_link(filename): f = open(filename) link = f.read().strip() f.close() if os.path.abspath(link) != link: logger.debug('Link in %s already relative' % filename) return new_link = make_relative_path(filename, link) logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link)) f = open(filename, 'w') f.write(new_link) f.close() def make_relative_path(source, dest, dest_is_directory=True): """ Make a filename relative, where the filename is dest, and it is being referred to from the filename source. >>> make_relative_path('/usr/share/something/a-file.pth', ... '/usr/share/another-place/src/Directory') '../another-place/src/Directory' >>> make_relative_path('/usr/share/something/a-file.pth', ... '/home/user/src/Directory') '../../../home/user/src/Directory' >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') './' """ source = os.path.dirname(source) if not dest_is_directory: dest_filename = os.path.basename(dest) dest = os.path.dirname(dest) dest = os.path.normpath(os.path.abspath(dest)) source = os.path.normpath(os.path.abspath(source)) dest_parts = dest.strip(os.path.sep).split(os.path.sep) source_parts = source.strip(os.path.sep).split(os.path.sep) while dest_parts and source_parts and dest_parts[0] == source_parts[0]: dest_parts.pop(0) source_parts.pop(0) full_parts = ['..']*len(source_parts) + dest_parts if not dest_is_directory: full_parts.append(dest_filename) if not full_parts: # Special case for the current directory (otherwise it'd be '') return './' return os.path.sep.join(full_parts) ############################################################ ## Bootstrap script creation: def create_bootstrap_script(extra_text, python_version=''): """ Creates a bootstrap script, which is like this script but with extend_parser, adjust_options, and after_install hooks. This returns a string that (written to disk of course) can be used as a bootstrap script with your own customizations. The script will be the standard virtualenv.py script, with your extra text added (your extra text should be Python code). If you include these functions, they will be called: ``extend_parser(optparse_parser)``: You can add or remove options from the parser here. ``adjust_options(options, args)``: You can change options here, or change the args (if you accept different kinds of arguments, be sure you modify ``args`` so it is only ``[DEST_DIR]``). ``after_install(options, home_dir)``: After everything is installed, this function is called. This is probably the function you are most likely to use. An example would be:: def after_install(options, home_dir): subprocess.call([join(home_dir, 'bin', 'easy_install'), 'MyPackage']) subprocess.call([join(home_dir, 'bin', 'my-package-script'), 'setup', home_dir]) This example immediately installs a package, and runs a setup script from that package. If you provide something like ``python_version='2.4'`` then the script will start with ``#!/usr/bin/env python2.4`` instead of ``#!/usr/bin/env python``. You can use this when the script must be run with a particular Python version. """ filename = __file__ if filename.endswith('.pyc'): filename = filename[:-1] f = open(filename, 'rb') content = f.read() f.close() py_exe = 'python%s' % python_version content = (('#!/usr/bin/env %s\n' % py_exe) + '## WARNING: This file is generated\n' + content) return content.replace('##EXT' 'END##', extra_text) ##EXTEND## def convert(s): b = base64.b64decode(s.encode('ascii')) return zlib.decompress(b).decode('utf-8') ##file site.py SITE_PY = convert(""" eJzFPf1z2zaWv/OvwMqTIZXKdD66nR2n7o2TOK333MTbpLO5dT1aSoIs1hTJEqRl7c3d337vAwAB kvLHpp3TdGKJBB4eHt43HtDRaHRcljJfiHWxaDIplEyq+UqUSb1SYllUol6l1WK/TKp6C0/n18mV VKIuhNqqGFvFQfD0Cz/BU/FplSqDAnxLmrpYJ3U6T7JsK9J1WVS1XIhFU6X5lUjztE6TLP0XtCjy WDz9cgyC01zAzLNUVuJGVgrgKlEsxfm2XhW5iJoS5/w8/nPycjwRal6lZQ0NKo0zUGSV1EEu5QLQ hJaNAlKmtdxXpZyny3RuG26KJluIMkvmUvzznzw1ahqGgSrWcrOSlRQ5IAMwJcAqEQ/4mlZiXixk LMRrOU9wAH7eEitgaBNcM4VkzAuRFfkVzCmXc6lUUm1FNGtqAkQoi0UBOKWAQZ1mWbApqms1hiWl 9djAI5Ewe/iTYfaAeeL4fc4BHD/kwc95ejth2MA9CK5eMdtUcpneigTBwk95K+dT/SxKl2KRLpdA g7weY5OAEVAiS2cHJS3Ht3qFvjsgrCxXJjCGRJS5Mb+kHnFwWoskU8C2TYk0UoT5WzlLkxyokd/A cAARSBoMjbNIVW3HodmJAgBUuI41SMlaiWidpDkw64/JnND+e5ovio0aEwVgtZT4tVG1O/9ogADQ 2iHAJMDFMqvZ5Fl6LbPtGBD4BNhXUjVZjQKxSCs5r4sqlYoAAGpbIW8B6YlIKqlJyJxp5HZC9Cea pDkuLAoYCjy+RJIs06umIgkTyxQ4F7ji3YefxNuT16fH7zWPGWAss1drwBmg0EI7OMEA4qBR1UFW gEDHwRn+EcligUJ2heMDXm2Dg3tXOohg7mXc7eMsOJBdL64eBuZYgzKhsQLq99/QZaJWQJ//uWe9 g+B4F1Vo4vxtsypAJvNkLcUqYf5Czgi+1XC+i8t69Qq4QSGcGkilcHEQwRThAUlcmkVFLkUJLJal uRwHQKEZtfVXEVjhfZHv01p3OAEgVEEOL51nYxoxlzDRPqxXqC9M4y3NTDcJ7Dqvi4oUB/B/Pidd lCX5NeGoiKH420xepXmOCCEvBOFeSAOr6xQ4cRGLM2pFesE0EiFrL26JItEALyHTAU/K22RdZnLC 4ou69W41QoPJWpi1zpjjoGVN6pVWrZ3qIO+9iD93uI7QrFeVBODNzBO6ZVFMxAx0NmFTJmsWr3pT EOcEA/JEnZAnqCX0xe9A0WOlmrW0L5FXQLMQQwXLIsuKDZDsMAiE2MNGxij7zAlv4R38C3Dx30zW 81UQOCNZwBoUIr8LFAIBkyBzzdUaCY/bNCt3lUyas6YoqoWsaKiHEfuAEX9gY5xr8L6otVHj6eIq F+u0RpU00yYzZYuXhzXrx1c8b5gGWG5FNDNNWzqtcXpZuUpm0rgkM7lESdCL9MouO4wZDIxJtrgW a7Yy8A7IIlO2IMOKBZXOspbkBAAMFr4kT8smo0YKGUwkMNC6JPjrBE16oZ0lYG82ywEqJDbfc7A/ gNu/QIw2qxToMwcIoGFQS8HyzdK6Qgeh1UeBb/RNfx4fOPV0qW0TD7lM0kxb+SQPTunhSVWR+M5l ib0mmhgKZpjX6Npd5UBHFPPRaBQExh3aKvO1UEFdbQ+BFYQZZzqdNSkavukUTb3+oQIeRTgDe91s OwsPNITp9B6o5HRZVsUaX9u5fQRlAmNhj2BPnJOWkewge5z4CsnnqvTSNEXb7bCzQD0UnP908u70 88lHcSQuWpU26eqzSxjzJE+ArckiAFN1hm11GbRExZei7hPvwLwTU4A9o94kvjKpG+BdQP1T1dBr mMbcexmcvD9+fXYy/fnjyU/Tj6efTgBBsDMy2KMpo3lswGFUMQgHcOVCxdq+Br0e9OD18Uf7IJim alpuyy08AEMJLFxFMN+JCPHhVNvgaZovi3BMjX9lJ/yI1Yr2uC4Ov74UR0ci/DW5ScIAvJ62KS/i jyQAn7alhK41/IkKNQ6ChVyCsFxLFKnoKXmyY+4ARISWhbasvxZpbt4zH7lDkMRH1ANwmE7nWaIU Np5OQyAtdRj4QIeY3WGUkwg6llu361ijgp9KwlLk2GWC/wygmMyoH6LBKLpdTCMQsPU8UZJb0fSh 33SKWmY6jfSAIH7E4+AiseIIhWmCWqZKwRMlXkGtM1NFhj8RPsotiQwGQ6jXcJF0sBPfJFkjVeRM CogYRR0yompMFXEQOBUR2M526cbjLjUNz0AzIF9WgN6rOpTDzx54KKBgTNiFoRlHS0wzxPSvHBsQ DuAkhqiglepAYX0mzk/OxctnL/bRAYEocWGp4zVHm5rmjbQPl7BaV7J2EOZe4YSEYezSZYmaEZ8e 3g1zHduV6bPCUi9xJdfFjVwAtsjAziqLn+gNxNIwj3kCqwiamCw4Kz3j6SUYOfLsQVrQ2gP11gTF rL9Z+j0O32WuQHVwKEyk1nE6G6+yKm5SdA9mW/0SrBuoN7RxxhUJnIXzmAyNGGgI8FtzpNRGhqDA qoZdTMIbQaKGX7SqMCZwZ6hbL+nrdV5s8inHrkeoJqOxZV0ULM282KBdgj3xDuwGIFlAKNYSjaGA ky5QtvYBeZg+TBcoS9EAAALTrCjAcmCZ4IymyHEeDoswxq8ECW8l0cLfmCEoODLEcCDR29g+MFoC IcHkrIKzqkEzGcqaaQYDOyTxue4s5qDRB9ChYgyGLtLQuJGh38UhKGdx5iolpx/a0M+fPzPbqBVl RBCxGU4ajf6SzFtcbsEUpqATjA/F+RVigw24owCmUZo1xf5HUZTsP8F6nmvZBssN8Vhdl4cHB5vN Jtb5gKK6OlDLgz//5Ztv/vKMdeJiQfwD03GkRSfH4gN6hz5o/K2xQN+ZlevwY5r73EiwIkl+FDmP iN/3TbooxOH+2OpP5OLWsOK/xvkABTI1gzKVgbajFqMnav9J/FKNxBMRuW2jMXsS2qRaK+ZbXehR F2C7wdOYF01eh44iVeIrsG4QUy/krLkK7eCejTQ/YKoop5Hlgf3nl4iBzxmGr4wpnqKWILZAi++Q /idmm4T8Ga0hkLxoonrx7nZYixniLh4u79Y7dITGzDBVyB0oEX6TBwugbdyXHPxoZxTtnuOMmo9n CIylDwzzalcwQsEhXHAtJq7UOVyNPipI04ZVMygYVzWCgga3bsbU1uDIRoYIEr0bE57zwuoWQKdO rs9E9GYVoIU7Ts/adVnB8YSQB47Ec3oiwak97L17xkvbZBmlYDo86lGFAXsLjXa6AL6MDICJGFU/ j7ilCSw+dBaF12AAWMFZG2SwZY+Z8I3rA472RgPs1LP6u3ozjYdA4CJFnD16EHRC+YhHqBRIUxn5 PXexuCVuf7A7LQ4xlVkmEmm1Q7i6ymNQqO40TMs0R93rLFI8zwrwiq1WJEZq3/vOAkUu+HjImGkJ 1GRoyeE0OiJvzxPAULfDhNdVg6kBN3OCGK1TRdYNybSCf8CtoIwEpY+AlgTNgnmolPkT+x1kzs5X f9nBHpbQyBBu011uSM9iaDjm/Z5AMur8CUhBDiTsCyO5jqwOMuAwZ4E84YbXcqd0E4xYgZw5FoTU DOBOL70AB5/EuGdBEoqQb2slS/GVGMHydUX1Ybr7d+VSkzaInAbkKuh8w5Gbi3DyEEedvITP0H5G gnY3ygI4eAYuj5uad9ncMK1Nk4Cz7ituixRoZMqcjMYuqpeGMG76909HTouWWGYQw1DeQN4mjBlp HNjl1qBhwQ0Yb827Y+nHbsYC+0ZhoV7I9S3Ef2GVqnmhQgxwe7kL96O5ok8bi+1ZOhvBH28BRuNL D5LMdP4Csyz/xiChBz0cgu5NFtMii6TapHlICkzT78hfmh4elpSekTv4SOHUAUwUc5QH7yoQENqs PABxQk0AUbkMlXb7+2DvnOLIwuXuI89tvjh8edkn7mRXhsd+hpfq5LauEoWrlfGisVDgavUNOCpd mFySb/V2o96OxjChKhREkeLDx88CCcGZ2E2yfdzUW4ZHbO6dk/cxqINeu5dcndkRuwAiqBWRUQ7C x3Pkw5F97OTumNgjgDyKYe5YFANJ88m/A+euhYIx9hfbHPNoXZWBH3j9zdfTgcyoi+Q3X4/uGaVD jCGxjzqeoB2ZygDE4LRNl0omGfkaTifKKuYt79g25ZgVOsV/mskuB5xO/Jj3xmS08HvNe4Gj+ewR PSDMLma/QrCqdH7rJkkzSsoDGvv7qOdMnM2pg2F8PEh3o4w5KfBYnk0GQyF18QwWJuTAftyfjvaL jk3udyAgNZ8yUX1U9vQGfLt/5G2qu3uHfajamBgeesaZ/hcDWsKb8ZBd/xINh5/fRRlYYB4NRkNk 9xzt/+9ZPvtjJvnAqZht39/RMD0S0O81E9bjDE3r8XHHIA4tu2sCDbAHWIodHuAdHlp/aN7oWxo/ i1WSEk9Rdz0VG9rrpzQnbtoAlAW7YANwcBn1jvGbpqp435dUYCmrfdzLnAgsczJOGFVP9cEcvJc1 YmKbzSlt7BTFFENqJNSJYDuTsHXhh+VsVZj0kcxv0gr6gsKNwh8+/HgS9hlAD4OdhsG562i45OEm HOE+gmlDTZzwMX2YQo/p8u9LVTeK8AlqttNNclaTbdA++DlZE9IPr8E9yRlv75T3qDFYnq/k/Hoq ad8d2RS7OvnpN/gaMbHb8X7xlEqWVAEGM5lnDdKKfWAs3Vs2+Zy2KmoJro6us8W6G9pN50zcMkuu RESdF5gF0txIiaKbpNKOYFkVWNkpmnRxcJUuhPytSTKMsOVyCbjgPpJ+FfPwlAwSb7kggCv+lJw3 VVpvgQSJKvQ2HNUOOA1nW55o5CHJOy5MQKwmOBQfcdr4ngm3MOQycbq/+YCTxBAYO5h9UuQueg7v 82KKo06pQHbCSPW3yOlx0B2hAAAjAArzH411Es1/I+mVu9dHa+4SFbWkR0o36C/IGUMo0RiTDvyb fvqM6PLWDiyvdmN5dTeWV10srwaxvPKxvLobS1ckcGFt/shIwlAOqbvDMFis4qZ/eJiTZL7idlg4 iQWSAFGUJtY1MsX1w16SibfaCAipbWfvlx62xScpV2RWBWejNUjkftxP0nG1qfx2OlMpi+7MUzHu 7K4CHL/vQRxTndWMurO8LZI6iT25uMqKGYitRXfSApiIbi0Opy3zm+mME60dSzU6/69PP3x4j80R 1MhUGlA3XEQ0LDiV6GlSXam+NLVxWAnsSC39mhjqpgHuPTDJxaPs8T9vqdgCGUdsqFigECV4AFQS ZZu5hUNh2HmuK4z0c2Zy3vc5EqO8HrWT2kGk4/Pzt8efjkeUfRv978gVGENbXzpcfEwL26Dvv7nN LcWxDwi1TjO1xs+dk0frliPut7EGbM+H7zx48RCDPRix+7P8QykFSwKEinUe9jGEenAM9EVhQo8+ hhF7lXPuJhc7K/adI3uOi+KI/tAOQHcAf98RY4wpEEC7UJGJDNpgqqP0rXm9g6IO0Af6el8cgnVD r24k41PUTmLAAXQoa5vtdv+8LRM2ekrWr0++P31/dvr6/PjTD44LiK7ch48HL8TJj58FlWqgAWOf KMEqhRqLgsCwuKeExKKA/xrM/CyamvO10Ovt2ZneNFnjOREsHEabE8Nzriiy0Dh9xQlh+1CXAiFG mQ6QnAM5VDlDB3YwXlrzYRBV6OJiOuczQ2e10aGXPmhlDmTRFnMM0geNXVIwCK72gldUAl6bqLDi zTh9SGkAKW2jbY1GRum53s69sxVlNjq8nCV1hidtZ63oL0IX1/AyVmWWQiT3KrSypLthpUrLOPqh 3WtmvIY0oNMdRtYNedY7sUCr9Srkuen+45bRfmsAw5bB3sK8c0mVGlS+jHVmIsRGvKkSylv4apde r4GCBcM9txoX0TBdCrNPILgWqxQCCODJFVhfjBMAQmcl/Nz8oZMdkAUWSoRv1ov9v4WaIH7rX34Z aF5X2f4/RAlRkOCqnnCAmG7jtxD4xDIWJx/ejUNGjqpkxd8arK0Hh4QSoI60UykRb2ZPIyWzpS71 8PUBvtB+Ar3udK9kWenuw65xiBLwREXkNTxRhn4hVl5Z2BOcyrgDGo8NWMzw+J1bEWA+e+LjSmaZ LhY/fXt2Ar4jnmRACeItsBMYjvMluJut6+D4eGAHFO51w+sK2bhCF5bqHRax12wwaY0iR729Egm7 TpQY7vfqZYGrJFUu2hFOm2GZWvwYWRnWwiwrs3anDVLYbUMUR5lhlpieV1RL6vME8DI9TTgkglgJ z0mYDDxv6KZ5bYoHs3QOehRULijUCQgJEhcPAxLnFTnnwItKmTNE8LDcVunVqsZ9Bugc0/kFbP7j 8eez0/dU0//iZet1DzDnhCKBCddzHGG1HmY74ItbgYdcNZ0O8ax+hTBQ+8Cf7isuFDniAXr9OLGI f7qv+BDXkRMJ8gxAQTVlVzwwAHC6DclNKwuMq42D8eNW47WY+WAoF4lnRnTNhTu/Pifalh1TQnkf 8/IRGzjLUtMwMp3d6rDuR89xWeKO0yIabgRvh2TLfGbQ9br3ZlcdmvvpSSGeJwWM+q39MUyhVq+p no7DbLu4hcJabWN/yZ1cqdNunqMoAxEjt/PYZbJhJaybMwd6Fc09YOJbja6RxEFVPvolH2kPw8PE ErsXp5iOdKKEjABmMqQ+ONOAD4UWARQIFeJGjuROxk9feHN0rMH9c9S6C2zjD6AIdVksHbcoKuBE +PIbO478itBCPXooQsdTyWVe2JIt/GxW6FU+9+c4KAOUxESxq5L8SkYMa2JgfuUTe0cKlrStR+qL 9HLIsIhTcE5vd3B4Xy6GN04Mah1G6LW7ltuuOvLJgw0GT2XcSTAffJVsQPeXTR3xSg6L/PBBtN1Q 74eIhYDQVO+DRyGmY34Ld6xPC3iQGhoWeni/7diF5bUxjqy1j50DRqF9oT3YeQWhWa1oW8Y52Wd8 UesFtAb3qDX5I/tU1+zY3wNHtpyckAXKg7sgvbmNdINOOmHEJ4f42GVKlentwRb9biFvZFaA6wVR HR48+NUePBjHNp0yWJL1xdidb8+3w7jRmxazQ3MyAj0zVcL6xbmsDxCdwYzPXZi1yOBS/6JDkiS/ Ji/5zd9PJ+LN+5/g39fyA8RVeHJwIv4BaIg3RQXxJR99pTsJ8FBFzYFj0Sg8XkjQaKuCr29At+3c ozNui+jTHv4xD6spBRa4Vmu+MwRQ5AnScfDWTzBnGOC3OWTV8UaNpzi0KCP9Emmw+9wJntU40C3j Vb3O0F44WZJ2NS9GZ6dvTt5/PInrW+Rw83PkZFH82iicjt4jrnA/bCLsk3mDTy4dx/kHmZUDfrMO Os0ZFgw6RQhxSWkDTb6PIrHBRVJh5kCU20Uxj7ElsDwfm6s34EiPnfjyXkPvWVmEFY31LlrrzeNj oIb4pauIRtCQ+ug5UU9CKJnh+S1+HI+GTfFEUGob/jy93izczLg+iEMT7GLazjryu1tduGI6a3iW kwivI7sM5mxmliZqPZu7Z/Y+5EJfJwJajvY55DJpslrIHCSXgny61wE0vXvMjiWEWYXNGZ09ozRN tkm2yilCSpQY4agjOpqOGzKUMYQY/Mfkmu0Bnv8TDR8kBuiEKMVPhdNVNfMVSzCHRES9gcKDTZq/ dOt5NIV5UI6Q560jC/NEt5ExupK1nj8/iMYXz9tKB8pKz71DtvMSrJ7LJnugOsunT5+OxH/c7/0w KnFWFNfglgHsQa/ljF7vsNx6cna1+p69eRMDP85X8gIeXFL23D5vckpN3tGVFkTavwZGiGsTWmY0 7Tt2mZN2FW80cwvesNKW4+c8pUuDMLUkUdnqu5cw7WSkiVgSFEOYqHmahpymgPXYFg2ej8M0o+YX eQscnyKYCb7FHTIOtVfoYVItq+Uei86RGBHgEdWW8Wh0wJhOiAGe0/OtRnN6mqd1e7Tjmbt5qg/S 1/YuIM1XItmgZJh5dIjhHLX0WLX1sIs7WdSLWIr5hZtw7MySX9+HO7A2SFqxXBpM4aFZpHkhq7kx p7hi6TytHTCmHcLhznQFElmfOBhAaQTqnazCwkq0ffsnuy4uph9oH3nfjKTLh2p7rRQnh5K8U2AY x+34lIayhLR8a76MYZT3lNbWnoA3lviTTqpiXb93+4V7xLDJ9a0WXL/RXnUBcOgmJasgLTt6OsK5 vsvCZ6bdcRcFfihEJ9xu0qpukmyqL0+YosM2tRvrGk97NO3OQ5fWWwEnvwAPeF9X0YPjYKpskJ5Y BGtOSRyJpU5RxO5pL/9gVFmgl/eCfSXwKZAyi6k5o2ySSBeWXe3hT12z6ah4BPWVOVD0EJtgjrX0 ToS405hQ0VM47la59lrhBos5tmA9725k8KghO7B8L95MsHunhfjuSETPJ+LPnUBsXm7xViYgw5NF /GQR+j4hdb04fNHauX7g24GwE8jLy0dPN0tnNL1wqPz8/r666BED0DXI7jKVi/0nCrFjnL8UqobS zms3p9KM8XT6nq260gez2+MqdCptBlHFplVojmoz/q8dxJz41nqID8ei0mALaA/0m8KXTvGhvXQN CxM1ev7KopRMhzbH8BtenALvNUFdodq5aaor7C3YgZyAPkbJW2Btw4Gg8BE8FNIlL7RoX3W2hf/I xeOi/V2biz0sv/n6LjxdAR88sTBAUI+YTqs/kKl2ssxjF+YB+/X389/Dee8uvns0lXSvYVphKIWF zKuE36BJbMpDm2owIolbQZFb3oaf+nrwTAyLI+qm+jq8a/rc/6656xaBnbnZ3e3N3T/75tJA993N L0M04DBPE+JBNeOtwA7rAleMJ7qoYDhlqT9IfrcTznSHVrgPjClhwAQosanG3mjNdTJ3v2OFzD5f 7+oedRzU1Z1p985+djn+IYqWqwHwuT39TCUeC82B7DfSfV1TLhqcyqsrNU3wrrgpBRtU4NLzIo37 +o6u+pKJ2hqvEy9UARCGm3QpolttDIwBAQ3fWcv1Ic7NGYKGpipKpyxTpQvOIGkXF8DFnDmi/iYz yXWVo0xiwk81VVlBVDDSN5ty4cJQrWcL1CQy1om6NqibHhN90SUOwdUy5ngk56s40vCoA4TgU1PO tU1cqDyd2nfAL8/aY+DpxDKEzJu1rJK6vQLF3yZNxXfOCHQoFhfYSVW0ktnhFBex1PKHgxQmC+z3 r7ST7QUZd5z9Hlut93C2oh46BfaYY+WO7THcnN7aK9Dcq3cWdGGua+Rts5b77LUvsBTmPi/SlTp3 wG/1HUN8cyVnNtFNcPgI5N49kuaX51q1xk6KRcN55iqG/qUyeKqZbPHQXXE9LujfCtdx9O34vt6w zNILDXY0tlTUrtWg4mlHG7cRNVbS3RNR+9XSj4yoPfgPjKj1zX5gcDQ+Wh8M1k/fE3qzmnCvyWsZ AfpMgUi4s9e5ZM2YzMitRoawN70d2WtqWWc6R5yMmUCO7N+fRCD4Ojzllm5611WZcYciWl+66PH3 Zx9eH58RLabnx2/+8/h7qlbB9HHHZj045ZAX+0ztfa8u1k0/6AqDocFbbAfuneTDHRpC731vc3YA wvBBnqEF7Soy9/WuDr0DEf1OgPjd0+5A3aWyByH3/DNdfO/WFXQKWAP9lKsNzS9ny9Y8MjsXLA7t zoR53yaTtYz2cm27Fs6p++urE+236psKd+QBx7b6lFYAc8jIXzaFbI4S2EQlOyrd/3kAlcziMSxz ywdI4Vw6t83RRXMMqvb/LwUVKLsE98HYYZzYG3+pHafLlb3KGvfC5jI2BPHOQY3683OFfSGzHVQI AlZ4+i41RsToP73BZLdjnyhxsU8nLvdR2VzaX7hm2sn9e4qbrrW9k0hx5QZvO0HjZZO5G6m2T68D OX+UnS+WTok/aL4DoHMrngrYG30mVoizrQghkNQbhlg1SHTUF4o5yKPddLA3tHom9nedx3PPownx fHfDRefIm+7xgnuoe3qoxpx6ciwwlq/tOmgnviPIvL0j6BIiz/nAPUV99y18vbl4fmiTrcjv+NpR JFRmM3IM+4VTpnbnxXdOd2KWakJ1TBizOcc0dYtLByr7BLtinF6t/o44yOz7MqSR9364yMf08C70 HnUxtax3CFMS0RM1pmk5pxs07vbJuD/dVm31gfBJjQcA6alAgIVgerrRqZzbcvlr9ExHhbOGrgx1 M+6hIxVUReNzBPcwvl+LX7c7nbB8UHdG0fTnBl0O1EsOws2+A7caeymR3SahO/WWD3a4AHxYdbj/ 8wf079d32e4v7vKrbauXgwek2JfFkkCslOiQyDyOwciA3oxIW2MduRF0vJ+jpaPLUO3ckC/Q8aMy Q7wQmAIMcman2gOwRiH4P2ts6wE= """) ##file ez_setup.py EZ_SETUP_PY = convert(""" eJzNWmtv49a1/a5fwSgwJGE0NN8PDzRFmkyBAYrcIo8CFx5XPk+LHYpUSWoctch/v+ucQ1KkZDrt RT6UwcQ2ebjPfq6195G+/upwanZlMZvP538sy6ZuKnKwatEcD01Z5rWVFXVD8pw0GRbNPkrrVB6t Z1I0VlNax1qM16qnlXUg7DN5EovaPLQPp7X192PdYAHLj1xYzS6rZzLLhXql2UEI2QuLZ5VgTVmd rOes2VlZs7ZIwS3CuX5BbajWNuXBKqXZqZN/dzebWbhkVe4t8c+tvm9l+0NZNUrL7VlLvW58a7m6 sqwS/zhCHYtY9UGwTGbM+iKqGk5Qe59fXavfsYqXz0VeEj7bZ1VVVmurrLR3SGGRvBFVQRrRLzpb utabMqzipVWXFj1Z9fFwyE9Z8TRTxpLDoSoPVaZeLw8qCNoPj4+XFjw+2rPZT8pN2q9Mb6wkCqs6 4vdamcKq7KDNa6OqtTw8VYQP42irZJi1zqtP9ey7D3/65uc//7T964cffvz4P99bG2vu2BFz3Xn/ 6Ocf/qz8qh7tmuZwd3t7OB0y2ySXXVZPt21S1Lc39S3+63e7nVs3ahe79e/9nf8wm+15uOWkIRD4 Lx2xxfmNt9icum8PJ8/2bfH0tLizFknieYzI1HG90OFJkNA0jWgsvZBFImJksX5FStBJoXFKEhI4 vghCx5OUJqEQvnTTwI39kNEJKd5YlzAK4zhMeUIinkgWBE7skJQ7sRd7PE1fl9LrEsAAknA3SrlH RRS5kvgeiUToiUAm3pRF/lgXSn2XOZLFfpqSyA/jNI1DRngqQ+JEbvKqlF4XPyEJw10eCcY9zwti 6capjDmJolQSNiElGOsSeU4QEi8QPBCuoCyOpXD8lJBARDIW4atSzn5h1CNuEkKPhBMmJfW4C30c n/rUZcHLUthFvlBfejQM/ZRHiGss44DwOHU9CCKpk0xYxC7zBfZwweHJKOYe96QUbuA4qR8F0iPB RKSZ64yVYXCHR2jIfeJ4YRSEEeLDXD9xHBI7qfO6mF6bMOZ4ETFKaeLEscfClIQ+SQLfJyHnk54x YsJODBdBRFgCX6YxS9IwjD0RiiREOgqasPh1MVGvTSJQSURIJ4KDPCaiwA0gzYORcPhEtAEqY994 lAiCGnZ9jvdRRl4iYkpCGhJoxMXrYs6R4pGfypQ6EBawwAvS2PEDLpgnmMO8yUi5Y99EAUsD6VMZ kxhZ6AuW+MKhHsIdByn1XhfT+4ZKknqu41COMHHUBCQJzn0EPgqcJJoQc4Ez0nGigMqIEI/G3IFa 8GyAxHYSN2beVKAucCZyIzf1hGB+KINYIGpuxHhEXA9SvXhKygXOSDcBQAF8uUSqEC9MWQop0uUx jRM5gVbsAmeEI3gcRInH0jShksbwdOIgex3EPHangu2Pg0SokG4kOYdhYRi6QRK4LAZ+8TRJo3BK ygVaUYemru8SRqjvOXAGcC6WQcBCAEXsylel9BYhSST2jHggqfRRUVSmQcQcuAqoJ6YSJhhblCi0 BvD7HuM0ZbFHmQwAX14kvYTIKbQKxxYJkUqeOFAHBYmMlb4ApocxAIMnbjQV6XBsEZHAKi7BKm7s uELAuTHIKaQMhEeiKZQJL2KUcF9GAISAMUKS2A2QONyPKWPc5yGfkBKNLULBJGD5xHUjMFGSBLEH EWDMMEhR2lPAGV2wGwsjIsOYwr/oHlANkQNDgsBHgYVkChuisUXUkwmJQw9kD9ilPkjaQai5CCVa idCfkBJfwJ2DGMmUcOaTyA1F6LohyhAtRQIInMyX+IIJSCLTMAALcGC5I2kUM+lKD2HAI2+qAuKx RQE4lgBvJVoGFGDgB67rSi4S38W/eEqX5KIbclQv5KXwSMrBHyoFAeCJ76jGynldSm8Ro8RPgA3o OYLEZ47KWWQbnM3ALJM0kIwtcmPPjQFyCHTKmRs6YeqQMKG+QJ2n4VSk07FF0J0FDpoZV3mYBmkk AiapcBLYypypSKcXyIAkQ2MHbvWThEdAJyKEEwG8WOQHU/1dK6W3SAqE1hchcWPqegxhYmHg0hjc C+YXU0ySjvmIEZSNKxVqEk9wAJOb+mC2mIaphx4HUn6dDSYCjDf1rKlOd2bg2pF6l2e0m7fQu8/E L0xg1Pio73xQI1G7Fg+H62ZcSGv7heQZun2xxa0ldNoWmAfXlhoAVnfagExa3X01M3bjgXmoLp5h tmgwLigR+kV7J34xdzHfdcsgp1351aaXct+JfjjLUxfmLkyD79+r6aRuuKgw1y1HK9Q1Vya1FrTz 4Q2mMIIxjH9lWcu/lHWd0Xww/mGkw9/7P6zmV8JuejNHj1ajv5Q+4pesWXrmfoXgVoV2l3HoxXCo F7Xj1eZimFv3am0pqcVmMNCtMSluMapuytpmxwq/mWTqX+AiJ6eNG87aIGFs/ObYlHv4gWG6PGEU Lfhtb/bgpEDN9XvyGbHE8PwFriLKQXCeMu1Amp0Z5x9bpR+telcec66mWWJ8PZTWTebFcU9FZTU7 0lgYhHvBWpaagAvlXUti6u2VOhZcvyKsx5EjHi010i6fdxnbdbsLaK2OJow8a3G7WNlQ0njpUW2p 5AyOMXaiGh2QPGeYuek5EwRfIyNNgmuVixL+yCtB+OmsPvb4KAfqabfr7dqzCS2mabXU0qjQqrQO 0ScWrCx4bXzTqXEgSBTlVHhElVXWZAhd8TQ4zzARb+0vC6HPE8zZCDd6wallrnz44vmI0rI9bBCt MH2WU5VH7CSMKqbOiLUXdU2ehDngOBfd46POl4pktbB+PNWN2H/4RfmrMIEoLNLgnjnZIFRBizJe paAyxpx62F2G6p/PpN4aFIL9G2tx+Py0rURdHism6oVCGLX9vuTHXNTqlGQAoJePTU2g6jjyoHXb cnVGEpVym3PRDOqy9dhFCXZlt74otDMGdEViw7OiapbOWm0yALkWqPud3g1Pd2h3zLdtA7PVwLxR MkyAAOyXskYO0g9fQPj+pQ6Qhg5pH13vMBJtt8m1nJ81fr+Zv2ldtXrXyh6qMBbwV7Py27KQecaa QRxgokFOBstluVzduw9DYhgmxX9KBPOfdufCmCiF5fvNTb3qy7wrb33K+akYc8GckWLRqGrrqwdw ok72dPm0J3mqkI5FgSy3rb/kAsnTLb+Sp8pLVTmwScCWTkOZVXWzBmGoSllAwqnLCuvtzwPlF/aF vE/Fp2L57bGqIA1IbwTcVBeUtgKhndNc2KR6qu+dh9fp7MWwfpchZzN6VBT7fdn8qQRwD3KI1PWs LcR8/OZ6WKv3F5X+oF75Gk7RXFB+HtHpMHsNr75UxL83uapSR6aOWPW7FyhUFy05U4CVl8w0IBos jQ1ZY86DdUPxX0qpBpDViX9Hqb/FqOqe2vWaTg3KP54ZcoIFS8N9HfUpCmHNkeRnI1pKGdNG94FC BWahHjJrh3zMTdJ23enGGkDX25sanfZNrRrt+bAWLg68TeJD7pAplM+sN+OGsCZfBLTfoAE3FPD3 MiuWHWF0S424umJKnO6Kvwd3d420Qp/uddRd3dRLI3Z1p4rhmy9lphLoIIhix06dui+2EXqrS6ci hyDljbrzUl4+jVap1lvFZfyuurDSfiZVsVR+fvv7XebzkBYrW3CuX8ryG50S6nOSpfgiCvUHzDlA 2dlO5AfV5X002TboNPpUQSui8l99krNUrpgB5dcWoGqmbu1RzoWAI/EK6lD1uQBd8awglmB4rWv9 9hDWNSjbs3ZLoHHb0Zx3hMq8y2Z7NlsCEcWd8rAWsydsp5orXgrDNTuEF0o0z2X1ud10bR0MYZS0 Ie2ncAopNErcAEwVisADTPfoegEknyuxrZxKtAQ0NMBe/Z5RRFKsr1JmALpX7ZPOsrWqpqvX0D/o ZG0yNUe2bVIuxOGd+bG86LTG2dnBsKa6eq63uKAyXXItPtj4WR5Esbxa9rX1A1r82+cqawA+iDH8 q5trYPjntfog8FlFT3UArFJlCGhkZVUddXLk4kKYjvswPVTP3Qi9vsPE7mo/VJsauWGArcaP5Wqs sUERbY3BivX8mc7hTjywtR1m6O5fwuinRsC7SwjABnd6F5aXtViuriCibu600OHzls060IKCufql g63Zv3Mp/t4j05foQb6spxj7zLkfX/uIVHPsB3RL7aqOIF5qnS8+en6tbzajQo/VVxLPa14fJ/Rc 7lx3WeOhYTQz6Jip0hhMCqzc72GoPWoLu8Mb0o5f3dXGSLs4BxdoP6/eqLOVh5VO02exqHRaC0vR +G+mirJU+fmCq5Ta1xyCRccC897nZW+WyGsxiMawF7e329Zb2621wQDo2I7tLv7jrv9/AfAaXNUU TOsyF6jViUG46+NBJqZXv+rRK7Evv2i81ZEw33DQ8y6YowH05r+BuxfN92SX3RbVP8bNymDOGnY7 16PfvzG+4ecrzfzkjPZya/H/ScnXyqwX/JtSrrL5pbrryu1hPKFrZzsrJD6sUuyPwDGdKerJyxmq dvmdHNCrrzU/+2W0pQ6gSvPl/Mertmi+7hBlDhB80kRUqcNeJCGapHNCz1cvCFwsf0A/Ne++jGMf TuOJcm6+ZnP9TRR7tWjHreOhZ6huiKnPAP2zfmqpIqHHLG/emnNhyHxSs+JJYfIwj6t2AlLdVneO 3Is9u0R33ef+Wv2pVizPfbUW0rGhps1FRRfnZ/2xsnr3oT2Slh2tvngsLXu6M0OgIen7ufrjprrD vzXQAgNE22ualqzbyAb97uvl6qF/2a5hcU+eBzVWzOdmVjA0PXQMQoAhsulmBv39oU13134SjSlb dX85nKW3umfYbtu8713Sylhb2i3v2qaoc8C7S2P3pME8uIGedi1IxXbL+adi+P2fT8Xy/m+/PrxZ /TrXDcpqOMjotwdo9AJmg8r1N7BySygc+Gp+XaYdJhpV8f/7Oy3Y1s330l09YBDTjnyjn5qHGF7x 6O7hZfMXz21OyLZB6lUfOGAGMzo/bjaL7VaV7Ha76D/1yJVEqKmr+L2nCbH7+959wDtv38JZplQG BDaonX65d/fwEjNqlDjLVIvM9X+XVxF7 """) ##file distribute_setup.py DISTRIBUTE_SETUP_PY = convert(""" eJztG2tz2zbyu34FTh4PqYSi7TT3GM+pM2nj9DzNJZnYaT8kHhoiIYk1X+XDsvrrb3cBkCAJyc61 dzM3c7qrIxGLxWLfuwCP/lTs6k2eTabT6Xd5Xld1yQsWxfBvvGxqweKsqnmS8DoGoMnliu3yhm15 VrM6Z00lWCXqpqjzPKkAFkdLVvDwjq+FU8lBv9h57JemqgEgTJpIsHoTV5NVnCB6+AFIeCpg1VKE dV7u2DauNyyuPcaziPEoogm4IMLWecHylVxJ4z8/n0wYfFZlnhrUBzTO4rTIyxqpDTpqCb7/yJ2N dliKXxsgi3FWFSKMV3HI7kVZATOQhm6qh98BKsq3WZLzaJLGZZmXHstL4hLPGE9qUWYceKqBuh17 tGgIUFHOqpwtd6xqiiLZxdl6gpvmRVHmRRnj9LxAYRA/bm+HO7i99SeTa2QX8TekhRGjYGUD3yvc SljGBW1PSZeoLNYlj0x5+qgUE8W8vNLfql37tY5Tob+vspTX4aYdEmmBFLS/eUk/Wwk1dYwqI0eT fD2Z1OXuvJNiFaP2yeFPVxcfg6vL64uJeAgFkH5Jzy+QxXJKC8EW7F2eCQObJrtZAgtDUVVSVSKx YoFU/iBMI/cZL9fVTE7BD/4EZC5s1xcPImxqvkyEN2PPaaiFK4FfZWag90PgqEvY2GLBTid7iT4C RQfmg2hAihFbgRQkQeyF/80fSuQR+7XJa1AmfNykIquB9StYPgNd7MDgEWIqwNyBmBTJdwDmmxdO t6QmCxEK3OasP6bwOPA/MG4YHw8bbHOmx9XUYccIOIJTMMMhtenPHQXEOviiVqxuhtLJK78qOFid C98+BD+/urz22IBp7Jkps9cXb159ensd/HTx8ery/TtYb3rq/8V/8XLaDn36+BYfb+q6OD85KXZF 7EtR+Xm5PlFOsDqpwFGF4iQ66fzSyXRydXH96cP1+/dvr4I3r368eD1YKDw7m05MoA8//hBcvnvz Hsen0y+Tf4qaR7zm85+kOzpnZ/7p5B340XPDhCft6HE1uWrSlINVsAf4TP6Rp2JeAIX0e/KqAcpL 8/tcpDxO5JO3cSiySoG+FtKBEF58AASBBPftaDKZkBorX+OCJ1jCvzNtA+IBYk5IyknuXQ7TYJ0W 4CJhy9qb+OldhN/BU+M4uA1/y8vMdS46JKADx5XjqckSME+iYBsBIhD/WtThNlIYWi9BUGC7G5jj mlMJihMR0oX5eSGydhctTKD2obbYm+yHSV4JDC+dQa5zRSxuug0ELQD4E7l1IKrg9cb/BeAVYR4+ TECbDFo/n97MxhuRWLqBjmHv8i3b5uWdyTENbVCphIZhaIzjsh1kr1vddmamO8nyuufAHB2xYTlH IXcGHqRb4Ap0FEI/4N+Cy2LbMoevUVNqXTGTE99YeIBFCIIW6HlZCi4atJ7xZX4v9KRVnAEemypI zZlpJV42MTwQ67UL/3laWeFLHiDr/q/T/wM6TTKkWJgxkKIF0XcthKHYCNsJQsq749Q+HZ//in+X 6PtRbejRHH/Bn9JA9EQ1lDuQUU1rVymqJqn7ygNLSWBlg5rj4gGWrmi4W6XkMaSol+8pNXGd7/Mm iWgWcUraznqNtqKsIAKiVQ7rqnTYa7PaYMkroTdmPI5EwndqVWTlUA0UvNOFyflxNS92x5EP/0fe WRMJ+ByzjgoM6uoHRJxVDjpkeXh2M3s6e5RZAMHtXoyMe8/+99E6+OzhUqdXjzgcAqScDckHfyjK 2j31WCd/lf326x4jyV/qqk8H6IDS7wWZhpT3oMZQO14MUqQBBxZGmmTlhtzBAlW8KS1MWJz92QPh BCt+JxbXZSNa75pyMvGqgcJsS8kz6ShfVnmChoq8mHRLGJoGIPiva3Jvy6tAckmgN3WKu3UAJkVZ W0VJLPI3zaMmERVWSl/a3TgdV4aAY0/c+2GIprdeH0Aq54ZXvK5LtwcIhhJERtC1JuE4W3HQnoXT UL8CHoIo59DVLi3EvrKmnSlz79/jLfYzr8cMX5Xp7rRjybeL6XO12sxC1nAXfXwqbf4+z1ZJHNb9 pQVoiawdQvIm7gz8yVBwplaNeY/TIdRBRuJvSyh03RHE9Jo8O20rMnsORm/G/XZxDAUL1PooaH4P 6TpVMl+y6RgftlJCnjk11pvK1AHzdoNtAuqvqLYAfCubDKOLzz4kAsRjxadbB5yleYmkhpiiaUJX cVnVHpgmoLFOdwDxTrscNv9k7MvxLfBfsi+Z+31TlrBKspOI2XE5A+Q9/y98rOIwcxirshRaXLsv +mMiqSz2ARrIBiZn2PfngZ+4wSkYmamxk9/tK2a/xhqeFEP2WYxVr9tsBlZ9l9dv8iaLfrfRPkqm jcRRqnPIXQVhKXgtht4qwM2RBbZZFIarA1H698Ys+lgCl4pXygtDPfy6a/G15kpxtW0kgu0leUil C7U5FePjWnbuMqjkZVJ4q2i/ZdWGMrMltiPveRL3sGvLy5p0KUqwaE6m3HoFwoXtP0p6qWPS9iFB C2iKYLc9ftwy7HG44CPCjV5dZJEMm9ij5cw5cWY+u5U8ucUVe7k/+BdRCp1Ctv0uvYqIfLlH4mA7 Xe2BOqxhnkXU6yw4BvqlWKG7wbZmWDc86TqutL8aK6na12L4jyQMvVhEQm1KqIKXFIUEtrlVv7lM sKyaGNZojZUGihe2ufX6twDVAVs/veTYxzJs/Rs6QCV92dQue7kqCpI9b7HI/I/fC2DpnhRcg6rs sgwRHexLtVYNax3kzRLt7Bx5/uo+j1GrC7TcqCWny3BGIb0tXlrrIR9fTT3cUt9lS6IUl9zR8BH7 KHh0QrGVYYCB5AxIZ0swuTsPO+xbVEKMhtK1gCaHeVmCuyDrGyCD3ZJWa3uJ8ayjFgSvVVh/sCmH CUIZgj7waJBRSTYS0ZJZHptul9MRkEoLEFk3NvKZShKwliXFAAJ0iT6AB/yWcAeLmvBd55QkDHtJ yBKUjFUlCO66Au+1zB/cVZOF6M2UE6Rhc5zaqx579uxuOzuQFcvmf1efqOnaMF5rz3Ilnx9KmIew mDNDIW1LlpHa+ziXraRRm938FLyqRgPDlXxcBwQ9ft4u8gQcLSxg2j+vwGMXKl2wSHpCYtNNeMMB 4Mn5/HDefhkq3dEa0RP9o9qslhnTfZhBVhFYkzo7pKn0pt4qRSeqAvQNLpqBB+4CPEBWdyH/Z4pt PLxrCvIWK5lYi0zuCCK7DkjkLcG3BQqH9giIeGZ6DeDGGHahl+44dAQ+DqftNPMsPa1XfQizXap2 3WlDN+sDQmMp4OsJkE1ibAjIGRDFMp8zNwGGtnVswVK5Nc07eya4svkh0u2JIQZYz/Quxoj2TXio rNlmFZp2cUPeGzxWqEZ7lggysdWRGZ9ClHX8929f+8cVHmnh6aiPf0ad3Y+ITgY3DCS57ClKEjVO 1eTF2hZ/urZRtQH9sCU2ze8hWQbTCMwOuVskPBQbUHahO9WDMB5X2Gscg/Wp/5TdQSDsNd8h8VJ7 MObu168V1h09/4PpqL4QYDSC7aQA1eq02Vf/ujjXM/sxz7BjOMfiYOju9eIjb7kE6d+ZbFn1y6OO A12HlFJ489DcXHfAgMlIC0BOqAUiEfJINm9qTHrRe2z5rrM5XecMEzaDPR6Tqq/IH0hUzTc40Tlz ZTlAdtCDla6qF0FGk6Q/VDM8ZjmvVJ1txdGRb++4AabAhy7KY31qrMp0BJi3LBG1UzFU/Nb5DvnZ KpriN+qaa7bwvEHzT7Xw8SYCfjW4pzEckoeC6R2HDfvMCmRQ7ZreZoRlHNNteglOVTbuga2aWMWJ PW1056q7yBMZbQJnsJO+P97na4beeR+c9tV8Bel0e0SM6yumGAEMQdobK23burWRjvdYrgAGPBUD /5+mQESQL39xuwNHX/e6CygJoe6Ske2xLkPPuUm6v2ZKz+Wa5IJKWoqpx9ywRdiaObqxMHZBxKnd PfEITE5FKvfJpyayIuw2qiKxYUXq0Kbq/CAs8KWnc+6+qwKepO0rnN6AlJH/07wcO0Cr55HgB/zO 0Id/j/KXkXw0q0uJWgd5OC2yuk8C2J8iSVbVbU60n1WGjHyY4AyTksFW6o3B0W4r6vFjW+mRYXTK hvJ6fH+PmdjQ0zwCPuvl823Q63K6IxVKIAKFd6hKMf6y5dd7FVRmwBc//DBHEWIIAXHK71+hoPEo hT0YZ/fFhKfGVcO3d7F1T7IPxKd3Ld/6jw6yYvaIaT/Kuf+KTRms6JUdSlvslYca1Pol+5RtRBtF s+9kH3NvOLOczCnM1KwNilKs4gdXe/ouuLRBjkKDOpSE+vveOO839oa/1YU6DfhZf4EoGYkHI2w+ Pzu/abMoGvT0tTuRNakoubyQZ/ZOEFTeWJX51nxewl7lPQi5iWGCDpsAHD6sWdYVtplRiRcYRiQe S2OmzgslGZpZJHHtOrjOwpl9ng9O5wwWaPaZiylcwyMiSRWWhpIK64FrApopbxF+K/lj7yH1yK0+ E+RzC5VfS2lHIzC3qUTp0NFCdzlWHRViG9fasbGt0s62GIbUyJGqDpX9KuR0oGicO+rrkTbb3Xsw fqhDdcS2wgGLCoEES5A3sltQSONWT5QLyZRKiBTPGczj0XGXhH5u0Vz6pYK6d4RsGG/IiEOYmMLk beVj1tY/0/c/yvNeTLbBK5bgjHrliT1xH2gLxXzEsCA3rjyu4tz1rhAjvmGr0jhIevXh8g8mfNYV gUOEoJB9ZTRvc5nvFpgliSzM7aI5YpGohbo1h8EbT+LbCIiaGg1z2PYYbjEkz9dDQ30233kwih65 NGi3bodYVlG8oEMF6QtRIckXxg9EbFHm93EkIvn6Q7xS8OaLFpXRfIjUhbvU6w41dMfRrDj6gcNG mV0KChsw1BsSDIjkWYjtHuhYW+WNcKBlA/XH/hqll4aBVUo5VuZ1PbUlyyZ8kUUqaNCdsT2byuby Nl8nvB4daN/7+2hWqerJijTAYfOwlqaKceFzP0n7MiYLKYcTKEWiuy//RJ3rdyO+Igfdm4QeaD4P eNOfN24/m7rRHt2hWdP5snR/dNZr+PtMDEXbz/5/rzwH9NJpZyaMhnnCmyzcdClc92QYKT+qkd6e MbSxDcfWFr6RJCGo4NdvtEioIi5Yyss7PMvPGacDWN5NWDat8bSp3vk3N5gufHbmoXkjm7IzvGKT iLlqAczFA72/BDnzPOUZxO7IuTFCnMZ4etP2A7BpZiaYn/tvXNyw5+20icZB93OsL9O03DMuJVci WcnG+WLqTz2WCrw4UC0wpnQnM+oiNR0EKwh5zEiXAErgtmQt/gzlFSN9j1jvr7vQgD4Z3/XKtxlW 1Wke4Vth0v9js58AClGmcVXRa1rdkZ1GEoMSUsMLZB5VPrvFDTjtxRB8RQuQrgQRMrpGDYQqDsBX mKx25KAnlqkpT4iIFF+5o8siwE8imRqAGg/22JUWg8Yud2wtaoXLnfVvUKiELMyLnfkbCjHI+NWN QMlQeZ1cAyjGd9cGTQ6APty0eYEWyygf0AMYm5PVpK0+YCXyhxBRFEivclbDqv898EtHmrAePepC S8VXAqUqBsf6HaTPC6hAI1et0Xdlmq4FccvHPwcB8T4Z9m1evvwb5S5hnIL4qGgC+k7/enpqJGPJ ylei1zil8rc5xUeB1ipYhdw3STYN3+zpsb8z94XHXhocQhvD+aJ0AcOZh3hezKzlQpgWBONjk0AC +t3p1JBtiNSVmO0ApaTetR09jBDdid1CK6CPx/2gvkizgwQ4M48pbPLqsGYQZG500QNwtRbcWi2q LokDU7kh8wZKZ4z3iKRzQGtbQwu8z6DR2TlJOdwAcZ2MFd7ZGLCh88UnAIYb2NkBQFUgmBb7b9x6 lSqKkxPgfgJV8Nm4AqYbxYPq2nZPgZAF0XLtghJOlWvBN9nwwpPQ4SDlMdXc9x7bc8mvCwSXh153 JRW44NVOQWnnd/j6v4rxw5fbgLiY7r9g8hRQRR4ESGoQqHcpie42ap6d38wm/wIwBuVg """) ##file activate.sh ACTIVATE_SH = convert(""" eJytVVFvokAQfudXTLEP2pw1fW3jg01NNGm1KV4vd22zrDDIJrhrYJHay/33m0VEKGpyufIg7s63 M9/OfDO0YBaKBAIRISzTRMMcIU3Qh0zoEOxEpbGHMBeyxz0t1lyjDRdBrJYw50l4YbVgo1LwuJRK Q5xKEBp8EaOno41l+bg7Be0O/LaAnhbEmKAGFfmAci1iJZcoNax5LPg8wiRHiQBeoCvBPmfT+zv2 PH6afR/cs8fBbGTDG9yADlHmSPOY7f4haInA95WKdQ4s91JpeDQO5fZAnKTxczaaTkbTh+EhMqWx QWl/rEGsNJ2kV0cRySKleRGTUKWUVB81pT+vD3Dpw0cSfoMsFF4IIV8jcHqRyVPLpTHrkOu89IUr EoDHo4gkoBUsiAFVlP4FKjaLFSeNFEeTS4AfJBOV6sKshVwUbmpAkyA4N8kFL+RygQlkpDfum58N GO1QWNLFipij/yn1twOHit5V29UvZ8Seh0/OeDo5kPz8at24lp5jRXSuDlXPuWqUjYCNejlXJwtV mHcUtpCddTh53hM7I15EpA+2VNLHRMep6Rn8xK0FDkYB7ABnn6J3jWnXbLvQfyzqz61dxDFGVP1a o1Xasx7bsipU+zZjlSVjtlUkoXofq9FHlMZtDxaLCrrH2O14wiaDhyFj1wWs2qIl773iTbZohyza iD0TUQQBF5HZr6ISgzKKNZrD5UpvgO5FwoT2tgkIMec+tcYm45sO+fPytqGpBy75aufpTG/gmhRb +u3AjQtC5l1l7QV1dBAcadt+7UhFGpXONprZRviAWtbY3dgZ3N4P2ePT9OFxdjJiruJSuLk7+31f x60HKiWc9eH9SBc04XuPGCVYce1SXlDyJcJrjfKr7ebSNpEaQVpg+l3wiAYOJZ9GCAxoR9JMWAiv +IyoWBSfhOIIIoRar657vSzLLj9Q0xRZX9Kk6SUq0BmPsceNl179Mi8Vii65Pkj21XXf4MAlSy/t Exft7A8WX4/iVRkZprZfNK2/YFL/55T+9wm9m86Uhr8A0Hwt """) ##file activate.fish ACTIVATE_FISH = convert(""" eJydVm1v4jgQ/s6vmA1wBxUE7X2stJVYlVWR2lK13d6d9laRk0yIr8HmbIe0++tvnIQQB9pbXT5A Ys/LM55nZtyHx5RrSHiGsMm1gRAh1xhDwU0Kng8hFzMWGb5jBv2E69SDs0TJDdj3MxilxmzPZzP7 pVPMMl+q9bjXh1eZQ8SEkAZULoAbiLnCyGSvvV6SC7IoBcS4Nw0wjcFbvJDcjiuTswzFDpiIQaHJ lQAjQUi1YRmUboC2uZJig8J4PaCnT5IaDcgsbm/CjinOwgx1KcUTMEhhTgV4g2B1fRk8Le8fv86v g7v545UHpZB9rKnp+gXsMhxLunIIpwVQxP/l9c/Hq9Xt1epm4R27bva6AJqN92G4YhbMG2i+LB+u grv71c3dY7B6WtzfLy9bePbp0taDTXSwJQJszUnnp0y57mvpPcrF7ZODyhswtd59+/jdgw+fwBNS xLSscksUPIDqwwNmCez3PpxGeyBYg6HE0YdcWBxcKczYzuVJi5Wu915vn5oWePCCoPUZBN5B7IgV MCi54ZDLG7TUZ0HweXkb3M5vFmSpFm/gthhBx0UrveoPpv9AJ9unIbQYdUoe21bKg2q48sPFGVwu H+afrxd1qvclaNlRFyh1EQ2sSccEuNAGWQwysfVpz1tPajUqbqJUnEcIJkWo6OXDaodK8ZiLdbmM L1wb+9H0D+pcyPSrX5u5kgWSygRYXCnJUi/KKcuU4cqsAyTKZBiissLc7NFwizvjxtieKBVCIdWz fzilzPaYyljZN0cGN1v7NnaIPNCGmVy3GKuJaQ6iVjE1Qfm+36hglErwmnAD8hu0dDy4uICBA8ZV pQr/q/+O0KFW2kjelu9Dgb9SDBsWV4F4x5CswgS0zBVlk5tDMP5bVtUGpslbm81Lu2sdKq7uNMGh MVQ4fy9xhogC1lS5guhISa0DlBWv0O8odT6/LP+4WZzDV6FzIkEqC0uolGZSZoMnlpxplmD2euaT O4hkTpPnbztDccey0bhjDaBIqaWQa0uwEtQEwtyU56i4fq54F9IE3ORR6mKriODM4XOYZwaVYLYz 7SPbKkz4i7VkB6/Ot1upDE3znNqYKpM8raa0Bx8vfvntJ32UENsM4aI6gJL+jJwhxhh3jVIDOcpi m0r2hmEtS8XXXNBk71QCDXTBNhhPiHX2LtHkrVIlhoEshH/EZgdq53Eirqs5iFKMnkOmqZTtr3Xq djvPTWZT4S3NT5aVLgurMPUWI07BRVYqkQrmtCKohNY8qu9EdACoT6ki0a66XxVF4f9AQ3W38yO5 mWmZmIIpnDFrbXakvKWeZhLwhvrbUH8fahhqD0YUcBDJjEBMQwiznE4y5QbHrbhHBOnUAYzb2tVN jJa65e+eE2Ya30E2GurxUP8ssA6e/wOnvo3V78d3vTcvMB3n7l3iX1JXWqk= """) ##file activate.csh ACTIVATE_CSH = convert(""" eJx9U11vmzAUffevOCVRu+UB9pws29Kl0iq1aVWllaZlcgxciiViItsQdb9+xiQp+dh4QOB7Pu49 XHqY59IgkwVhVRmLmFAZSrGRNkdgykonhFiqSCRW1sJSmJg8wCDT5QrucRCyHn6WFRKhVGmhKwVp kUpNiS3emup3TY6XIn7DVNQyJUwlrgthJD6n/iCNv72uhCzCpFx9CRkThRQGKe08cWXJ9db/yh/u pvzl9mn+PLnjj5P5D1yM8QmXlzBkSdXwZ0H/BBc0mEo5FE5qI2jKhclHOOvy9HD/OO/6YO1mX9vx sY0H/tPIV0dtqel0V7iZvWyNg8XFcBA0ToEqVeqOdNUEQFvN41SumAv32VtJrakQNSmLWmgp4oJM yDoBHgoydtoEAs47r5wHHnUal5vbJ8oOI+9wI86vb2d8Nrm/4Xy4RZ8R85E4uTZPB5EZPnTaaAGu E59J8BE2J8XgrkbLeXMlVoQxznEYFYY8uFFdxsKQRx90Giwx9vSueHP1YNaUSFG4vTaErNSYuBOF lXiVyXa9Sy3JdClEyK1dD6Nos9mEf8iKlOpmqSNTZnYjNEWiUYn2pKNB3ttcLJ3HmYYXy6Un76f7 r8rRsC1TpTJj7f19m5sUf/V3Ir+x/yjtLu8KjLX/CmN/AcVGUUo= """) ##file activate.bat ACTIVATE_BAT = convert(""" eJyFUkEKgzAQvAfyhz0YaL9QEWpRqlSjWGspFPZQTevFHOr/adQaU1GaUzI7Mzu7ZF89XhKkEJS8 qxaKMMsvboQ+LxxE44VICSW1gEa2UFaibqoS0iyJ0xw2lIA6nX5AHCu1jpRsv5KRjknkac9VLVug sX9mtzxIeJDE/mg4OGp47qoLo3NHX2jsMB3AiDht5hryAUOEifoTdCXbSh7V0My2NMq/Xbh5MEjU ZT63gpgNT9lKOJ/CtHsvT99re3pX303kydn4HeyOeAg5cjf2EW1D6HOPkg9NGKhu """) ##file deactivate.bat DEACTIVATE_BAT = convert(""" eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q FlWqXJpcICVYpGzx2BAZ4uHv5+Hv6wq1BWINXBTdKriEKkI1DhW2QAfhttcxxANiFZCBbglQSJUL i2dASrm4rFz9XLgAwJNbyQ== """) ##file activate.ps1 ACTIVATE_PS = convert(""" eJylWdmS40Z2fVeE/oHT6rCloNUEAXDThB6wAyQAEjsB29GBjdgXYiWgmC/zgz/Jv+AEWNVd3S2N xuOKYEUxM+/Jmzfvcm7W//zXf/+wUMOoXtyi1F9kbd0sHH/hFc2iLtrK9b3FrSqyxaVQwr8uhqJd uHaeg9mqzRdR8/13Pyy8qPLdJh0+LMhi0QCoXxYfFh9WtttEnd34H8p6/f1300KauwrULws39e18 0ZaLNm9rgN/ZVf3h++/e124Vlc0vKsspHy+Yyi5+XbzPhijvCtduoiL/kA1ukWV27n0o7Sb8LIFj CvWR5GQgUJdp1Pw8TS9+rPy6SDv/+e3d+0+4qw8f3v20+PliV37efEYBAB9FTKC+RHn/Cfxn3rdv 00Fube5O+iyCtHDs9BfPfz3q4sfFv9d91Ljhfy7ei0VO+nVTtdOkv/jpt0l2AX6iG1jXgKnnDuD4 ke2k/i8fzzz5UedkVcP4pwF+Wvz2FJl+3vt598urXf5Y6LNA5WcFOP7r0sW7b9a+W/xcu0Xpv5zk Kfq3P9Dz9di/fCxS72MXVU1rpx9L4Bxl85Wmn5a+zP76Zuh3pL9ROWr87PN+//GHIl+oOtvn9XSU qH+p0gQBFnx1uV+JLH5O5zv+PXW+WepXVVHZT0+oQezkIATcIm+ivPV/z5J/+cYj3ir4w0Lx09vC e5n/y5/Y5LPPfdrqb88ga/PabxZRVfmp39l588m/6u+/e+OpP+dF7n1WZpJ9//Z4v372fDDz9eHB 7Juvs/BLMHzrxL9+9twXpJfhd1/DrpQ5Euu/vlss3wp9HXC/54C/Ld69m6zwdx3tC0d8daSv0V8B n4b9YYF53sJelJV/ix6LZspw/sJtqyl5LJ5r/23htA1Imfm/gt9R7dqVB1LjhydAX4Gb+zksQF59 9+P7H//U+376afFuvh2/T6P85Xr/5c8C6OXyFY4BGuN+EE0+GeR201b+wkkLN5mmBY5TfMw8ngqL CztXxCSXKMCYrRIElWkEJlEPYsSOeKBVZCAQTKBhApMwRFQzmCThE0YQu2CdEhgjbgmk9GluHpfR /hhwJCZhGI5jt5FsAkOrObVyE6g2y1snyhMGFlDY1x+BoHpCMulTj5JYWNAYJmnKpvLxXgmQ8az1 4fUGxxcitMbbhDFcsiAItg04E+OSBIHTUYD1HI4FHH4kMREPknuYRMyhh3AARWMkfhCketqD1CWJ mTCo/nhUScoQcInB1hpFhIKoIXLo5jLpwFCgsnLCx1QlEMlz/iFEGqzH3vWYcpRcThgWnEKm0QcS rA8ek2a2IYYeowUanOZOlrbWSJUC4c7y2EMI3uJPMnMF/SSXdk6E495VLhzkWHps0rOhKwqk+xBI DhJirhdUCTamMfXz2Hy303hM4DFJ8QL21BcPBULR+gcdYxoeiDqOFSqpi5B5PUISfGg46gFZBPo4 jdh8lueaWuVSMTURfbAUnLINr/QYuuYoMQV6l1aWxuZVTjlaLC14UzqZ+ziTGDzJzhiYoPLrt3uI tXkVR47kAo09lo5BD76CH51cTt1snVpMOttLhY93yxChCQPI4OBecS7++h4p4Bdn4H97bJongtPk s9gQnXku1vzsjjmX4/o4YUDkXkjHwDg5FXozU0fW4y5kyeYW0uJWlh536BKr0kMGjtzTkng6Ep62 uTWnQtiIqKnEsx7e1hLtzlXs7Upw9TwEnp0t9yzCGgUJIZConx9OHJArLkRYW0dW42G9OeR5Nzwk yk1mX7du5RGHT7dka7N3AznmSif7y6tuKe2N1Al/1TUPRqH6E2GLVc27h9IptMLkCKQYRqPQJgzV 2m6WLsSipS3v3b1/WmXEYY1meLEVIU/arOGVkyie7ZsH05ZKpjFW4cpY0YkjySpSExNG2TS8nnJx nrQmWh2WY3cP1eISP9wbaVK35ZXc60yC3VN/j9n7UFoK6zvjSTE2+Pvz6Mx322rnftfP8Y0XKIdv Qd7AfK0nexBTMqRiErvCMa3Hegpfjdh58glW2oNMsKeAX8x6YJLZs9K8/ozjJkWL+JmECMvhQ54x 9rsTHwcoGrDi6Y4I+H7yY4/rJVPAbYymUH7C2D3uiUS3KQ1nrCAUkE1dJMneDQIJMQQx5SONxoEO OEn1/Ig1eBBUeEDRuOT2WGGGE4bNypBLFh2PeIg3bEbg44PHiqNDbGIQm50LW6MJU62JHCGBrmc9 2F7WBJrrj1ssnTAK4sxwRgh5LLblhwNAclv3Gd+jC/etCfyfR8TMhcWQz8TBIbG8IIyAQ81w2n/C mHWAwRzxd3WoBY7BZnsqGOWrOCKwGkMMNfO0Kci/joZgEocLjNnzgcmdehPHJY0FudXgsr+v44TB I3jnMGnsK5veAhgi9iXGifkHMOC09Rh9cAw9sQ0asl6wKMk8mpzFYaaDSgG4F0wisQDDBRpjCINg FIxhlhQ31xdSkkk6odXZFpTYOQpOOgw9ugM2cDQ+2MYa7JsEirGBrOuxsQy5nPMRdYjsTJ/j1iNw FeSt1jY2+dd5yx1/pzZMOQXUIDcXeAzR7QlDRM8AMkUldXOmGmvYXPABjxqkYKO7VAY6JRU7kpXr +Epu2BU3qFFXClFi27784LrDZsJwbNlDw0JzhZ6M0SMXE4iBHehCpHVkrQhpTFn2dsvsZYkiPEEB GSEAwdiur9LS1U6P2U9JhGp4hnFpJo4FfkdJHcwV6Q5dV1Q9uNeeu7rV8PAjwdFg9RLtroifOr0k uOiRTo/obNPhQIf42Fr4mtThWoSjitEdAmFW66UCe8WFjPk1YVNpL9srFbond7jrLg8tqAasIMpy zkH0SY/6zVAwJrEc14zt14YRXdY+fcJ4qOd2XKB0/Kghw1ovd11t2o+zjt+txndo1ZDZ2T+uMVHT VSXhedBAHoJIID9xm6wPQI3cXY+HR7vxtrJuCKh6kbXaW5KkVeJsdsjqsYsOwYSh0w5sMbu7LF8J 5T7U6LJdiTx+ca7RKlulGgS5Z1JSU2Llt32cHFipkaurtBrvNX5UtvNZjkufZ/r1/XyLl6yOpytL Km8Fn+y4wkhlqZP5db0rooqy7xdL4wxzFVTX+6HaxuQJK5E5B1neSSovZ9ALB8091dDbbjVxhWNY Ve5hn1VnI9OF0wpvaRm7SZuC1IRczwC7GnkhPt3muHV1YxUJfo+uh1sYnJy+vI0ZwuPV2uqWJYUH bmBsi1zmFSxHrqwA+WIzLrHkwW4r+bad7xbOzJCnKIa3S3YvrzEBK1Dc0emzJW+SqysQfdEDorQG 9ZJlbQzEHQV8naPaF440YXzJk/7vHGK2xwuP+Gc5xITxyiP+WQ4x18oXHjFzCBy9kir1EFTAm0Zq LYwS8MpiGhtfxiBRDXpxDWxk9g9Q2fzPPAhS6VFDAc/aiNGatUkPtZIStZFQ1qD0IlJa/5ZPAi5J ySp1ETDomZMnvgiysZSBfMikrSDte/K5lqV6iwC5q7YN9I1dBZXUytDJNqU74MJsUyNNLAPopWK3 tzmLkCiDyl7WQnj9sm7Kd5kzgpoccdNeMw/6zPVB3pUwMgi4C7hj4AMFAf4G27oXH8NNT9zll/sK S6wVlQwazjxWKWy20ZzXb9ne8ngGalPBWSUSj9xkc1drsXkZ8oOyvYT3e0rnYsGwx85xZB9wKeKg cJKZnamYwiaMymZvzk6wtDUkxmdUg0mPad0YHtvzpjEfp2iMxvORhnx0kCVLf5Qa43WJsVoyfEyI pzmf8ruM6xBr7dnBgzyxpqXuUPYaKahOaz1LrxNkS/Q3Ae5AC+xl6NbxAqXXlzghZBZHmOrM6Y6Y ctAkltwlF7SKEsShjVh7QHuxMU0a08/eiu3x3M+07OijMcKFFltByXrpk8w+JNnZpnp3CfgjV1Ax gUYCnWwYow42I5wHCcTzLXK0hMZN2DrPM/zCSqe9jRSlJnr70BPE4+zrwbk/xVIDHy2FAQyHoomT Tt5jiM68nBQut35Y0qLclLiQrutxt/c0OlSqXAC8VrxW97lGoRWzhOnifE2zbF05W4xuyhg7JTUL aqJ7SWDywhjlal0b+NLTpERBgnPW0+Nw99X2Ws72gOL27iER9jgzj7Uu09JaZ3n+hmCjjvZpjNst vOWWTbuLrg+/1ltX8WpPauEDEvcunIgTxuMEHweWKCx2KQ9DU/UKdO/3za4Szm2iHYL+ss9AAttm gZHq2pkUXFbV+FiJCKrpBms18zH75vax5jSo7FNunrVWY3Chvd8KKnHdaTt/6ealwaA1x17yTlft 8VBle3nAE+7R0MScC3MJofNCCkA9PGKBgGMYEwfB2QO5j8zUqa8F/EkWKCzGQJ5EZ05HTly1B01E z813G5BY++RZ2sxbQS8ZveGPJNabp5kXAeoign6Tlt5+L8i5ZquY9+S+KEUHkmYMRFBxRrHnbl2X rVemKnG+oB1yd9+zT+4c43jQ0wWmQRR6mTCkY1q3VG05Y120ZzKOMBe6Vy7I5Vz4ygPB3yY4G0FP 8RxiMx985YJPXsgRU58EuHj75gygTzejP+W/zKGe78UQN3yOJ1aMQV9hFH+GAfLRsza84WlPLAI/ 9G/5JdcHftEfH+Y3/fHUG7/o8bv98dzzy3e8S+XCvgqB+VUf7sH0yDHpONdbRE8tAg9NWOzcTJ7q TuAxe/AJ07c1Rs9okJvl1/0G60qvbdDzz5zO0FuPFQIHNp9y9Bd1CufYVx7dB26mAxwa8GMNrN/U oGbNZ3EQ7inLzHy5tRg9AXJrN8cB59cCUBeCiVO7zKM0jU0MamhnRThkg/NMmBOGb6StNeD9tDfA 7czsAWopDdnGoXUHtA+s/k0vNPkBcxEI13jVd/axp85va3LpwGggXXWw12Gwr/JGAH0b8CPboiZd QO1l0mk/UHukud4C+w5uRoNzpCmoW6GbgbMyaQNkga2pQINB18lOXOCJzSWPFOhZcwzdgrsQnne7 nvjBi+7cP2BbtBeDOW5uOLGf3z94FasKIguOqJl+8ss/6Kumns4cuWbqq5592TN/RNIbn5Qo6qbi O4F0P9txxPAwagqPlftztO8cWBzdN/jz3b7GD6JHYP/Zp4ToAMaA74M+EGSft3hEGMuf8EwjnTk/ nz/P7SLipB/ogQ6xNX0fDqNncMCfHqGLCMM0ZzFa+6lPJYQ5p81vW4HkCvidYf6kb+P/oB965g8K C6uR0rdjX1DNKc5pOSTquI8uQ6KXxYaKBn+30/09tK4kMpJPgUIQkbENEPbuezNPPje2Um83SgyX GTCJb6MnGVIpgncdQg1qz2bvPfxYD9fewCXDomx9S+HQJuX6W3VAL+v5WZMudRQZk9ZdOk6GIUtC PqEb/uwSIrtR7/edzqgEdtpEwq7p2J5OQV+RLrmtTvFwFpf03M/VrRyTZ73qVod7v7Jh2Dwe5J25 JqFOU2qEu1sP+CRotklediycKfLjeIZzjJQsvKmiGSNQhxuJpKa+hoWUizaE1PuIRGzJqropwgVB oo1hr870MZLgnXF5ZIpr6mF0L8aSy2gVnTAuoB4WEd4d5NPVC9TMotYXERKlTcwQ2KiB/C48AEfH Qbyq4CN8xTFnTvf/ebOc3isnjD95s0QF0nx9s+y+zMmz782xL0SgEmRpA3x1w1Ff9/74xcxKEPdS IEFTz6GgU0+BK/UZ5Gwbl4gZwycxEw+Kqa5QmMkh4OzgzEVPnDAiAOGBFaBW4wkDmj1G4RyElKgj NlLCq8zsp085MNh/+R4t1Q8yxoSv8PUpTt7izZwf2BTHZZ3pIZpUIpuLkL1nNL6sYcHqcKm237wp T2+RCjgXweXd2Zp7ZM8W6dG5bZsqo0nrJBTx8EC0+CQQdzEGnabTnkzofu1pYkWl4E7XSniECdxy vLYavPMcL9LW5SToJFNnos+uqweOHriUZ1ntIYZUonc7ltEQ6oTRtwOHNwez2sVREskHN+bqG3ua eaEbJ8XpyO8CeD9QJc8nbLP2C2R3A437ISUNyt5Yd0TbDNcl11/DSsOzdbi/VhCC0KE6v1vqVNkq 45ZnG6fiV2NwzInxCNth3BwL0+8814jE6+1W1EeWtpWbSZJOJNYXmWRXa7vLnAljE692eHjZ4y5u y1u63De0IzKca7As48Z3XshVF+3XiLNz0JIMh/JOpbiNLlMi672uO0wYzOCZjRxcxj3D+gVenGIE MvFUGGXuRps2RzMcgWIRolHXpGUP6sMsQt1hspUBnVKUn/WQj2u6j3SXd9Xz0QtEzoM7qTu5y7gR q9gNNsrlEMLdikBt9bFvBnfbUIh6voTw7eDsyTmPKUvF0bHqWLbHe3VRHyRZnNeSGKsB73q66Vsk taxWYmwz1tYVFG/vOQhlM0gUkyvIab3nv2caJ1udU1F3pDMty7stubTE4OJqm0i0ECfrJIkLtraC HwRWKzlqpfhEIqYH09eT9WrOhQyt8YEoyBlnXtAT37WHIQ03TIuEHbnRxZDdLun0iok9PUC79prU m5beZzfQUelEXnhzb/pIROKx3F7qCttYIFGh5dXNzFzID7u8vKykA8Uejf7XXz//S4nKvW//ofS/ QastYw== """) ##file distutils-init.py DISTUTILS_INIT = convert(""" eJytV92L4zYQf/dfMU0ottuse7RvC6FQrg8Lxz2Ugz4si9HacqKuIxlJ2ST313dG8odkO9d7aGBB luZLv/nNjFacOqUtKJMIvzK3cXlhWgp5MDBsqK5SNYftsBAGpLLA4F1oe2Ytl+9wUvW55TswCi4c KibhbFDSglXQCFmDPXIwtm7FawLRbwtPzg2T9gf4gupKv4GS0N262w7V0NvpbCy8cvTo3eAus6C5 ETU3ICQZX1hFTw/dzR6V/AW1RCN4/XAtbsVXqIXmlVX6liS4lOzEYY9QFB2zx6LfoSNjz1a0pqT9 QOIfJWQ2E888NEVZNqLlZZnvIB0NpHkimlFdKn2iRRY7yGG/CCJb6Iz280d34SFXBS2yEYPNF0Q7 yM7oCjpWvbEDQmnhRwOs6zjThpKE8HogwRAgraqYFZgGZvzmzVh+mgz9vskT3hruwyjdFcqyENJw bbMPO5jdzonxK68QKT7B57CMRRG5shRSWDTX3dI8LzRndZbnSWL1zfvriUmK4TcGWSnZiEPCrxXv bM+sP7VW2is2WgWXCO3sAu3Rzysz3FiNCA8WPyM4gb1JAAmCiyTZbhFjWx3h9SzauuRXC9MFoVbc yNTCm1QXOOIfIn/g1kGMhDUBN72hI5XCBQtIXQw8UEEdma6Jaz4vJIJ51Orc15hzzmu6TdFp3ogr Aof0c98tsw1SiaiWotHffk3XYCkqdToxWRfTFXqgpg2khcLluOHMVC0zZhLKIomesfSreUNNgbXi Ky9VRzwzkBneNoGQyyvGjbsFQqOZvpWIjqH281lJ/jireFgR3cPzSyTGWzQpDNIU+03Fs4XKLkhp /n0uFnuF6VphB44b3uWRneSbBoMSioqE8oeF0JY+qTvYfEK+bPLYdoR4McfYQ7wMZj39q0kfP8q+ FfsymO0GzNlPh644Jje06ulqHpOEQqdJUfoidI2O4CWx4qOglLye6RrFQirpCRXvhoRqXH3sYdVJ AItvc+VUsLO2v2hVAWrNIfVGtkG351cUMNncbh/WdowtSPtCdkzYFv6mwYc9o2Jt68ud6wectBr8 hYAulPSlgzH44YbV3ikjrulEaNJxt+/H3wZ7bXSXje/YY4tfVVrVmUstaDwwOBLMg6iduDB0lMVC UyzYx7Ab4kjCqdViEJmDcdk/SKbgsjYXgfMznUWcrtS4z4fmJ/XOM1LPk/iIpqass5XwNbdnLb1Y 8h3ERXSWZI6rZJxKs1LBqVH65w0Oy4ra0CBYxEeuOMbDmV5GI6E0Ha/wgVTtkX0+OXvqsD02CKLf XHbeft85D7tTCMYy2Njp4DJP7gWJr6paVWXZ1+/6YXLv/iE0M90FktiI7yFJD9e7SOLhEkkaMTUO azq9i2woBNR0/0eoF1HFMf0H8ChxH/jgcB34GZIz3Qn4/vid+VEamQrOVqAPTrOfmD4MPdVh09tb 8dLLjvh/61lEP4yW5vJaH4vHcevG8agXvzPGoOhhXNncpTr99PTHx6e/UvffFLaxUSjuSeP286Dw gtEMcW1xKr/he4/6IQ6FUXP+0gkioHY5iwC9Eyx3HKO7af0zPPe+XyLn7fAY78k4aiR387bCr5XT 5C4rFgwLGfMvJuAMew== """) ##file distutils.cfg DISTUTILS_CFG = convert(""" eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg 9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= """) ##file activate_this.py ACTIVATE_THIS = convert(""" eJyNU01v2zAMvetXEB4K21jmDOstQA4dMGCHbeihlyEIDMWmG62yJEiKE//7kXKdpN2KzYBt8euR fKSyLPs8wiEo8wh4wqZTGou4V6Hm0wJa1cSiTkJdr8+GsoTRHuCotBayiWqQEYGtMCgfD1KjGYBe 5a3p0cRKiAe2NtLADikftnDco0ko/SFEVgEZ8aRC5GLux7i3BpSJ6J1H+i7A2CjiHq9z7JRZuuQq siwTIvpxJYCeuWaBpwZdhB+yxy/eWz+ZvVSU8C4E9FFZkyxFsvCT/ZzL8gcz9aXVE14Yyp2M+2W0 y7n5mp0qN+avKXvbsyyzUqjeWR8hjGE+2iCE1W1tQ82hsCZN9UzlJr+/e/iab8WfqsmPI6pWeUPd FrMsd4H/55poeO9n54COhUs+sZNEzNtg/wanpjpuqHJaxs76HtZryI/K3H7KJ/KDIhqcbJ7kI4ar XL+sMgXnX0D+Te2Iy5xdP8yueSlQB/x/ED2BTAtyE3K4SYUN6AMNfbO63f4lBW3bUJPbTL+mjSxS PyRfJkZRgj+VbFv+EzHFi5pKwUEepa4JslMnwkowSRCXI+m5XvEOvtuBrxHdhLalG0JofYBok6qj YdN2dEngUlbC4PG60M1WEN0piu7Nq7on0mgyyUw3iV1etLo6r/81biWdQ9MWHFaePWZYaq+nmp+t s3az+sj7eA0jfgPfeoN1 """) if __name__ == '__main__': main() ## TODO: ## Copy python.exe.manifest ## Monkeypatch distutils.sysconfig<|fim▁end|>
sys.stdout.write('...' + self.in_progress + msg + '\n') sys.stdout.flush() else:
<|file_name|>config_base.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import collections import re from paddle.trainer_config_helpers.default_decorators import wrap_name_default import paddle.trainer_config_helpers as conf_helps class LayerType(type): def __new__(cls, name, bases, attrs): method_name = attrs.get('METHOD_NAME', None) if method_name is not None: method = getattr(conf_helps, method_name) if method.__doc__ is not None: mapper = attrs.get("__map_docstr__", None) if mapper is not None: attrs['__doc__'] = LayerType.__map_docstr__( mapper(method.__doc__), method_name=method_name, name=name) else: attrs['__doc__'] = LayerType.__map_docstr__( method.__doc__, method_name=method_name, name=name) return super(LayerType, cls).__new__(cls, name, bases, attrs)<|fim▁hole|> def __map_docstr__(doc, name, method_name): assert isinstance(doc, basestring) # replace LayerOutput to paddle.v2.config_base.Layer doc = doc.replace("LayerOutput", "paddle.v2.config_base.Layer") doc = doc.replace('ParameterAttribute', 'paddle.v2.attr.ParameterAttribute') doc = re.sub(r'ExtraLayerAttribute[^\s]?', 'paddle.v2.attr.ExtraAttribute', doc) # xxx_layer to xxx doc = re.sub(r"(?P<name>[a-z]+)_layer", r"\g<name>", doc) # XxxxActivation to paddle.v2.Activation.Xxxx doc = re.sub(r"(?P<name>[A-Z][a-zA-Z]+)Activation", r"paddle.v2.Activation.\g<name>", doc) # TODO(yuyang18): Add more rules if needed. return doc class Layer(object): __metaclass__ = LayerType def __init__(self, name=None, parent_layers=None): assert isinstance(parent_layers, dict) self.name = name self.__contex__ = {} self.__parent_layers__ = parent_layers def to_proto(self, context): """ function to set proto attribute """ kwargs = dict() for layer_name in self.__parent_layers__: if not isinstance(self.__parent_layers__[layer_name], collections.Sequence): v1_layer = self.__parent_layers__[layer_name].to_proto( context=context) else: v1_layer = map(lambda x: x.to_proto(context=context), self.__parent_layers__[layer_name]) kwargs[layer_name] = v1_layer if self.context_name() is None: return self.to_proto_impl(**kwargs) elif self.context_name() not in context: context[self.context_name()] = self.to_proto_impl(**kwargs) self.__contex__ = context if self.use_context_name(): return context[self.context_name()] else: return context[self.name] def to_proto_impl(self, **kwargs): raise NotImplementedError() def context_name(self): """ Context name means the context which stores `to_proto_impl` result. If multiple layer share same context_name, the `to_proto_impl` of them will be invoked only once. """ return self.name def use_context_name(self): return False def calculate_size(self): """ lazy calculate size of the layer, should be called when to_proto_impl of this layer is called. :return: """ return self.__contex__[self.context_name()].size def __convert_to_v2__(method_name, parent_names, is_default_name=True): if is_default_name: wrapper = wrap_name_default(name_prefix=method_name) else: wrapper = None class V2LayerImpl(Layer): METHOD_NAME = method_name def __init__(self, **kwargs): parent_layers = dict() other_kwargs = dict() for pname in parent_names: if kwargs.has_key(pname): parent_layers[pname] = kwargs[pname] for key in kwargs.keys(): if key not in parent_names: other_kwargs[key] = kwargs[key] name = kwargs.get('name', None) super(V2LayerImpl, self).__init__(name, parent_layers) self.__other_kwargs__ = other_kwargs if wrapper is not None: __init__ = wrapper(__init__) def to_proto_impl(self, **kwargs): args = dict() for each in kwargs: args[each] = kwargs[each] for each in self.__other_kwargs__: args[each] = self.__other_kwargs__[each] return getattr(conf_helps, method_name)(**args) return V2LayerImpl<|fim▁end|>
@staticmethod
<|file_name|>View.java<|end_file_name|><|fim▁begin|>package com.structurizr.view; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.structurizr.model.*; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; import java.util.stream.Collectors; @JsonIgnoreProperties(ignoreUnknown=true) public abstract class View implements Comparable<View> { private SoftwareSystem softwareSystem; private String softwareSystemId; private String description = ""; private PaperSize paperSize = PaperSize.A4_Portrait; private Set<ElementView> elementViews = new LinkedHashSet<>(); View() {<|fim▁hole|> } public View(SoftwareSystem softwareSystem) { this.softwareSystem = softwareSystem; } @JsonIgnore public Model getModel() { return softwareSystem.getModel(); } @JsonIgnore public SoftwareSystem getSoftwareSystem() { return softwareSystem; } public void setSoftwareSystem(SoftwareSystem softwareSystem) { this.softwareSystem = softwareSystem; } public String getSoftwareSystemId() { if (this.softwareSystem != null) { return this.softwareSystem.getId(); } else { return this.softwareSystemId; } } void setSoftwareSystemId(String softwareSystemId) { this.softwareSystemId = softwareSystemId; } public abstract ViewType getType(); public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public PaperSize getPaperSize() { return paperSize; } public void setPaperSize(PaperSize paperSize) { this.paperSize = paperSize; } /** * Adds all software systems in the model to this view. */ public void addAllSoftwareSystems() { getModel().getSoftwareSystems().forEach(this::addElement); } /** * Adds the given software system to this view. * * @param softwareSystem the SoftwareSystem to add */ public void addSoftwareSystem(SoftwareSystem softwareSystem) { addElement(softwareSystem); } /** * Adds all software systems in the model to this view. */ public void addAllPeople() { getModel().getPeople().forEach(this::addElement); } /** * Adds the given person to this view. * * @param person the Person to add */ public void addPerson(Person person) { addElement(person); } protected void addElement(Element element) { if (softwareSystem.getModel().contains(element)) { elementViews.add(new ElementView(element)); } } protected void removeElement(Element element) { ElementView elementView = new ElementView(element); elementViews.remove(elementView); } /** * Gets the set of elements in this view. * * @return a Set of ElementView objects */ public Set<ElementView> getElements() { return elementViews; } public Set<RelationshipView> getRelationships() { Set<Relationship> relationships = new HashSet<>(); Set<Element> elements = getElements().stream() .map(ElementView::getElement) .collect(Collectors.toSet()); elements.forEach(b -> relationships.addAll(b.getRelationships())); return relationships.stream() .filter(r -> elements.contains(r.getSource()) && elements.contains(r.getDestination())) .map(RelationshipView::new) .collect(Collectors.toSet()); } public void setRelationships(Set<RelationshipView> relationships) { // do nothing ... this are determined automatically } /** * Removes all elements that have no relationships * to other elements in this view. */ public void removeElementsWithNoRelationships() { Set<RelationshipView> relationships = getRelationships(); Set<String> elementIds = new HashSet<>(); relationships.forEach(rv -> elementIds.add(rv.getRelationship().getSourceId())); relationships.forEach(rv -> elementIds.add(rv.getRelationship().getDestinationId())); elementViews.removeIf(ev -> !elementIds.contains(ev.getId())); } public void removeElementsThatCantBeReachedFrom(Element element) { Set<String> elementIdsToShow = new HashSet<>(); findElementsToShow(element, elementIdsToShow, 1); elementViews.removeIf(ev -> !elementIdsToShow.contains(ev.getId())); } private void findElementsToShow(Element element, Set<String> elementIds, int depth) { if (elementViews.contains(new ElementView(element))) { elementIds.add(element.getId()); if (depth < 100) { element.getRelationships().forEach(r -> findElementsToShow(r.getDestination(), elementIds, depth + 1)); } } } public abstract String getName(); @Override public int compareTo(View view) { return getTitle().compareTo(view.getTitle()); } private String getTitle() { return getName() + " - " + getDescription(); } ElementView findElementView(Element element) { for (ElementView elementView : getElements()) { if (elementView.getElement().equals(element)) { return elementView; } } return null; } public void copyLayoutInformationFrom(View source) { this.setPaperSize(source.getPaperSize()); for (ElementView sourceElementView : source.getElements()) { ElementView destinationElementView = findElementView(sourceElementView.getElement()); if (destinationElementView != null) { destinationElementView.copyLayoutInformationFrom(sourceElementView); } } } }<|fim▁end|>
<|file_name|>ssl_server_test.cc<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. */ #include <fstream> #include <iostream> #include <pthread.h> #include <memory> #include <netinet/in.h> #include <sstream> #include <sys/types.h> #include <sys/socket.h> #include <boost/asio/deadline_timer.hpp> #include <boost/asio/placeholders.hpp> #include <boost/bind.hpp> #include "testing/gunit.h" #include "base/logging.h" #include "base/parse_object.h" #include "base/test/task_test_util.h" #include "io/event_manager.h" #include "io/ssl_server.h" #include "io/ssl_session.h" #include "io/test/event_manager_test.h" #include "io/io_log.h" using namespace std; namespace { class EchoServer; class EchoSession : public SslSession { public: EchoSession(EchoServer *server, SslSocket *socket, bool ssl_handshake_delayed); protected: virtual void OnRead(Buffer buffer) { const u_int8_t *data = BufferData(buffer); const size_t len = BufferSize(buffer); //TCP_UT_LOG_DEBUG("Received " << BufferData(buffer) << " " << len << " bytes"); Send(data, len, NULL); } private: void OnEvent(TcpSession *session, Event event) { if (event == ACCEPT) { TCP_UT_LOG_DEBUG("Accept"); } if (event == CLOSE) { TCP_UT_LOG_DEBUG("Close"); } } }; class EchoServer : public SslServer { public: EchoServer(EventManager *evm, bool ssl_handshake_delayed = false) : SslServer(evm, boost::asio::ssl::context::tlsv1_server, true, ssl_handshake_delayed), session_(NULL), ssl_handshake_delayed_(ssl_handshake_delayed), ssl_handshake_count_(0) { boost::asio::ssl::context *ctx = context(); boost::system::error_code ec; ctx->set_verify_mode((boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert), ec); assert(ec.value() == 0); ctx->use_certificate_chain_file ("controller/src/io/test/newcert.pem", ec); assert(ec.value() == 0); ctx->use_private_key_file("controller/src/io/test/privkey.pem", boost::asio::ssl::context::pem, ec); assert(ec.value() == 0); ctx->load_verify_file("controller/src/io/test/ssl_client_cert.pem", ec); assert(ec.value() == 0); } ~EchoServer() { } void set_verify_fail_certs() { boost::asio::ssl::context *ctx = context(); boost::system::error_code ec; ctx->load_verify_file("controller/src/io/test/newcert.pem", ec); assert(ec.value() == 0); } virtual SslSession *AllocSession(SslSocket *socket) { session_ = new EchoSession(this, socket, ssl_handshake_delayed_); return session_; } TcpSession *CreateSession() { TcpSession *session = SslServer::CreateSession(); Socket *socket = session->socket(); boost::system::error_code err; socket->open(boost::asio::ip::tcp::v4(), err); if (err) { TCP_SESSION_LOG_ERROR(session, TCP_DIR_OUT, "open failed: " << err.message()); } err = session->SetSocketOptions(); if (err) { TCP_SESSION_LOG_ERROR(session, TCP_DIR_OUT, "sockopt: " << err.message()); } return session; } EchoSession *GetSession() const { return session_; } int GetSslHandShakeCount() { return ssl_handshake_count_; } void ProcessSslHandShakeResponse(SslSessionPtr session, const boost::system::error_code& error) { ssl_handshake_count_++; if (!error) { session->AsyncReadStart(); } } private: EchoSession *session_; bool ssl_handshake_delayed_; int ssl_handshake_count_; }; EchoSession::EchoSession(EchoServer *server, SslSocket *socket, bool ssl_handshake_delayed) : SslSession(server, socket) { if (!ssl_handshake_delayed) { set_observer(boost::bind(&EchoSession::OnEvent, this, _1, _2)); } } static size_t sent_data_size; class SslClient; class ClientSession : public SslSession { public: ClientSession(SslClient *server, SslSocket *socket, bool ssl_handshake_delayed = false, bool large_data = false); void OnEvent(TcpSession *session, Event event) { if (event == CONNECT_COMPLETE) { if (!large_data_) { const u_int8_t *data = (const u_int8_t *)"Hello there !"; sent_data_size = strlen((const char *) data) + 1; Send(data, sent_data_size, NULL); return; } // Send a large xml file as data. ifstream ifs("controller/src/ifmap/testdata/scaled_config.xml"); stringstream s; while (ifs >> s.rdbuf()); string str = s.str(); sent_data_size = str.size() + 1; Send((const u_int8_t *) str.c_str(), sent_data_size, NULL); } } std::size_t &len() { return len_; } protected: virtual void OnRead(Buffer buffer) { const size_t len = BufferSize(buffer); //TCP_UT_LOG_DEBUG("Received " << len << " bytes"); len_ += len; } private: std::size_t len_; bool large_data_; }; class SslClient : public SslServer { public: SslClient(EventManager *evm, bool ssl_handshake_delayed = false, bool large_data = false) : SslServer(evm, boost::asio::ssl::context::tlsv1, true, ssl_handshake_delayed), session_(NULL), large_data_(large_data), ssl_handshake_delayed_(ssl_handshake_delayed), ssl_handshake_count_(0) { boost::asio::ssl::context *ctx = context(); boost::system::error_code ec; ctx->set_verify_mode(boost::asio::ssl::context::verify_none, ec); assert(ec.value() == 0); ctx->use_certificate_chain_file ("controller/src/io/test/ssl_client_cert.pem", ec); assert(ec.value() == 0); ctx->use_private_key_file("controller/src/io/test/ssl_client_privkey.pem", boost::asio::ssl::context::pem, ec); assert(ec.value() == 0); ctx->load_verify_file("controller/src/io/test/newcert.pem", ec); assert(ec.value() == 0); } ~SslClient() { } virtual SslSession *AllocSession(SslSocket *socket) { session_ = new ClientSession(this, socket, ssl_handshake_delayed_, large_data_); return session_; } void set_verify_fail_certs() { boost::asio::ssl::context *ctx = context(); boost::system::error_code ec; ctx->set_verify_mode((boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert), ec); assert(ec.value() == 0); ctx->use_certificate_chain_file ("controller/src/io/test/newcert.pem", ec); assert(ec.value() == 0); ctx->load_verify_file("controller/src/io/test/ssl_client_cert.pem", ec); assert(ec.value() == 0); } TcpSession *CreateSession() { TcpSession *session = SslServer::CreateSession(); Socket *socket = session->socket(); boost::system::error_code err; socket->open(boost::asio::ip::tcp::v4(), err); if (err) { TCP_SESSION_LOG_ERROR(session, TCP_DIR_OUT, "open failed: " << err.message()); } err = session->SetSocketOptions(); if (err) { TCP_SESSION_LOG_ERROR(session, TCP_DIR_OUT, "sockopt: " << err.message()); } return session; } ClientSession *GetSession() const { return session_; } int GetSslHandShakeCount() { return ssl_handshake_count_; } void ProcessSslHandShakeResponse(SslSessionPtr session, const boost::system::error_code& error) { ssl_handshake_count_++; if (!error) { session->AsyncReadStart(); const u_int8_t *data = (const u_int8_t *)"Encrypted Hello !"; size_t len = 18; session->Send(data, len, NULL); } } private: ClientSession *session_; bool large_data_; bool ssl_handshake_delayed_; int ssl_handshake_count_; }; ClientSession::ClientSession(SslClient *server, SslSocket *socket, bool ssl_handshake_delayed, bool large_data) : SslSession(server, socket), len_(0), large_data_(large_data) { if (!ssl_handshake_delayed) { set_observer(boost::bind(&ClientSession::OnEvent, this, _1, _2)); } } class SslEchoServerTest : public ::testing::Test { public: void OnEvent(TcpSession *session, SslSession::Event event) { boost::system::error_code ec; timer_.cancel(ec); ClientSession *client_session = static_cast<ClientSession *>(session); client_session->OnEvent(session, event); if (event == SslSession::CONNECT_FAILED) { connect_fail_++; session->Close(); } if (event == SslSession::CONNECT_COMPLETE) { connect_success_++; } } protected: SslEchoServerTest() : evm_(new EventManager()), timer_(*evm_->io_service()), connect_success_(0), connect_fail_(0), connect_abort_(0) { } void SetUpImmedidate() { server_ = new EchoServer(evm_.get()); thread_.reset(new ServerThread(evm_.get())); session_ = NULL; } void SetUpDelayedHandShake() { server_ = new EchoServer(evm_.get(), true); thread_.reset(new ServerThread(evm_.get())); session_ = NULL; } virtual void TearDown() { if (session_) session_->Close(); task_util::WaitForIdle(); server_->Shutdown(); server_->ClearSessions(); task_util::WaitForIdle(); TcpServerManager::DeleteServer(server_); server_ = NULL; evm_->Shutdown(); if (thread_.get() != NULL) { thread_->Join(); } task_util::WaitForIdle(); } void DummyTimerHandler(TcpSession *session, const boost::system::error_code &error) { if (error) { return; } if (!session->IsClosed()) { connect_abort_++; } session->Close(); } void StartConnectTimer(TcpSession *session, int sec) { boost::system::error_code ec; timer_.expires_from_now(boost::posix_time::seconds(sec), ec); timer_.async_wait( boost::bind(&SslEchoServerTest::DummyTimerHandler, this, session, boost::asio::placeholders::error)); } auto_ptr<ServerThread> thread_; auto_ptr<EventManager> evm_; EchoServer *server_; boost::asio::deadline_timer timer_; EchoSession *session_; int connect_success_; int connect_fail_; int connect_abort_; }; TEST_F(SslEchoServerTest, msg_send_recv) { SetUpImmedidate(); SslClient *client = new SslClient(evm_.get()); task_util::WaitForIdle(); server_->Initialize(0); task_util::WaitForIdle(); thread_->Start(); // Must be called after initialization connect_success_ = connect_fail_ = connect_abort_ = 0; ClientSession *session = static_cast<ClientSession *>(client->CreateSession()); session->set_observer(boost::bind(&SslEchoServerTest::OnEvent, this, _1, _2)); boost::asio::ip::tcp::endpoint endpoint; boost::system::error_code ec; endpoint.address(boost::asio::ip::address::from_string("127.0.0.1", ec)); endpoint.port(server_->GetPort()); client->Connect(session, endpoint); task_util::WaitForIdle(); StartConnectTimer(session, 10); TASK_UTIL_EXPECT_TRUE(session->IsEstablished()); TASK_UTIL_EXPECT_FALSE(session->IsClosed()); TASK_UTIL_EXPECT_EQ(1, connect_success_); TASK_UTIL_EXPECT_EQ(connect_fail_, 0); TASK_UTIL_EXPECT_EQ(connect_abort_, 0); // wait for on connect message to come back from echo server. TASK_UTIL_EXPECT_EQ(sent_data_size, session->len()); session->Close(); client->DeleteSession(session); client->Shutdown(); task_util::WaitForIdle(); TcpServerManager::DeleteServer(client); client = NULL; } TEST_F(SslEchoServerTest, large_msg_send_recv) { SetUpImmedidate(); SslClient *client = new SslClient(evm_.get(), false, true); task_util::WaitForIdle(); server_->Initialize(0); task_util::WaitForIdle(); thread_->Start(); // Must be called after initialization connect_success_ = connect_fail_ = connect_abort_ = 0; ClientSession *session = static_cast<ClientSession *>(client->CreateSession()); session->set_observer(boost::bind(&SslEchoServerTest::OnEvent, this, _1, _2)); boost::asio::ip::tcp::endpoint endpoint; boost::system::error_code ec; endpoint.address(boost::asio::ip::address::from_string("127.0.0.1", ec)); endpoint.port(server_->GetPort()); client->Connect(session, endpoint); task_util::WaitForIdle(); StartConnectTimer(session, 10); TASK_UTIL_EXPECT_TRUE(session->IsEstablished()); TASK_UTIL_EXPECT_FALSE(session->IsClosed()); TASK_UTIL_EXPECT_EQ(1, connect_success_); TASK_UTIL_EXPECT_EQ(connect_fail_, 0); TASK_UTIL_EXPECT_EQ(connect_abort_, 0); // wait for on connect message to come back from echo server. TASK_UTIL_EXPECT_EQ(sent_data_size, session->len()); session->Close(); client->DeleteSession(session); client->Shutdown(); task_util::WaitForIdle(); TcpServerManager::DeleteServer(client); client = NULL; } TEST_F(SslEchoServerTest, HandshakeFailure) { SetUpImmedidate(); SslClient *client = new SslClient(evm_.get()); SslClient *client_fail = new SslClient(evm_.get()); // set context to verify certs to fail handshake client_fail->set_verify_fail_certs(); task_util::WaitForIdle(); server_->Initialize(0); task_util::WaitForIdle(); thread_->Start(); // Must be called after initialization connect_success_ = connect_fail_ = connect_abort_ = 0; ClientSession *session = static_cast<ClientSession *>(client->CreateSession()); ClientSession *session_fail = static_cast<ClientSession *>(client_fail->CreateSession()); session->set_observer(boost::bind(&SslEchoServerTest::OnEvent, this, _1, _2)); session_fail->set_observer(boost::bind(&SslEchoServerTest::OnEvent, this, _1, _2)); boost::asio::ip::tcp::endpoint endpoint; boost::system::error_code ec; endpoint.address(boost::asio::ip::address::from_string("127.0.0.1", ec)); endpoint.port(server_->GetPort()); client->Connect(session, endpoint); task_util::WaitForIdle(); StartConnectTimer(session, 10); TASK_UTIL_EXPECT_TRUE(session->IsEstablished()); TASK_UTIL_EXPECT_FALSE(session->IsClosed()); TASK_UTIL_EXPECT_EQ(1, connect_success_); TASK_UTIL_EXPECT_EQ(connect_fail_, 0);<|fim▁hole|> client_fail->Connect(session_fail, endpoint); task_util::WaitForIdle(); TASK_UTIL_EXPECT_EQ(1, connect_success_); TASK_UTIL_EXPECT_EQ(connect_fail_, 1); TASK_UTIL_EXPECT_EQ(connect_abort_, 0); session->Close(); session_fail->Close(); client_fail->DeleteSession(session_fail); client->DeleteSession(session); task_util::WaitForIdle(); TASK_UTIL_EXPECT_EQ(1, server_->GetSessionCount()); TASK_UTIL_EXPECT_FALSE(server_->HasSessions()); client_fail->Shutdown(); client->Shutdown(); task_util::WaitForIdle(); TcpServerManager::DeleteServer(client_fail); TcpServerManager::DeleteServer(client); client_fail = NULL; client = NULL; } TEST_F(SslEchoServerTest, DISABLED_test_delayed_ssl_handshake) { SetUpDelayedHandShake(); // create a ssl client with delayed handshake = true SslClient *client = new SslClient(evm_.get(), true); task_util::WaitForIdle(); server_->Initialize(0); task_util::WaitForIdle(); thread_->Start(); // Must be called after initialization connect_success_ = connect_fail_ = connect_abort_ = 0; ClientSession *session = static_cast<ClientSession *>(client->CreateSession()); session->set_observer(boost::bind(&SslEchoServerTest::OnEvent, this, _1, _2)); boost::asio::ip::tcp::endpoint endpoint; boost::system::error_code ec; endpoint.address(boost::asio::ip::address::from_string("127.0.0.1", ec)); endpoint.port(server_->GetPort()); client->Connect(session, endpoint); task_util::WaitForIdle(); StartConnectTimer(session, 10); TASK_UTIL_EXPECT_TRUE(session->IsEstablished()); TASK_UTIL_EXPECT_FALSE(session->IsClosed()); TASK_UTIL_EXPECT_EQ(1, connect_success_); TASK_UTIL_EXPECT_EQ(connect_fail_, 0); TASK_UTIL_EXPECT_EQ(connect_abort_, 0); // wait till plain-text data is transferred TASK_UTIL_EXPECT_EQ(sent_data_size, session->len()); // Trigger delayed ssl handshake on server side server_->GetSession()->TriggerSslHandShake( boost::bind(&EchoServer::ProcessSslHandShakeResponse, server_, _1, _2)); // Trigger delayed ssl handshake on client side session->TriggerSslHandShake( boost::bind(&SslClient::ProcessSslHandShakeResponse, client, _1, _2)); task_util::WaitForIdle(); TASK_UTIL_EXPECT_EQ(client->GetSslHandShakeCount(), 1); TASK_UTIL_EXPECT_EQ(server_->GetSslHandShakeCount(), 1); // wait till encrypted data is transferred TASK_UTIL_EXPECT_EQ(session->len(), 32); session->Close(); client->DeleteSession(session); client->Shutdown(); task_util::WaitForIdle(); TcpServerManager::DeleteServer(client); client = NULL; } } // namespace int main(int argc, char **argv) { LoggingInit(); Sandesh::SetLoggingParams(true, "", SandeshLevel::UT_DEBUG); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }<|fim▁end|>
TASK_UTIL_EXPECT_EQ(connect_abort_, 0); // wait for on connect message to come back from echo server. TASK_UTIL_EXPECT_EQ(sent_data_size, session->len());
<|file_name|>passes.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::collections::HashSet; use rustc::util::nodemap::NodeSet; use std::cmp; use std::string::String; use std::uint; use syntax::ast; use syntax::ast_util; use clean; use clean::Item; use plugins; use fold; use fold::DocFolder; /// Strip items marked `#[doc(hidden)]` pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult { let mut stripped = HashSet::new(); // strip all #[doc(hidden)] items let krate = { struct Stripper<'a> { stripped: &'a mut HashSet<ast::NodeId> }; impl<'a> fold::DocFolder for Stripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { if i.is_hidden_from_doc() { debug!("found one in strip_hidden; removing"); self.stripped.insert(i.def_id.node); // use a dedicated hidden item for given item type if any match i.inner { clean::StructFieldItem(..) => { return Some(clean::Item { inner: clean::StructFieldItem(clean::HiddenStructField), ..i }); } _ => { return None; } } } self.fold_item_recur(i) } } let mut stripper = Stripper{ stripped: &mut stripped }; stripper.fold_crate(krate) }; // strip any traits implemented on stripped items let krate = { struct ImplStripper<'a> { stripped: &'a mut HashSet<ast::NodeId> }; impl<'a> fold::DocFolder for ImplStripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { if let clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ did, .. }, ref trait_, .. }) = i.inner { // Impls for stripped types don't need to exist if self.stripped.contains(&did.node) { return None; } // Impls of stripped traits also don't need to exist if let Some(clean::ResolvedPath { did, .. }) = *trait_ { if self.stripped.contains(&did.node) { return None; } } } self.fold_item_recur(i) } } let mut stripper = ImplStripper{ stripped: &mut stripped }; stripper.fold_crate(krate) }; (krate, None) } /// Strip private items from the point of view of a crate or externally from a /// crate, specified by the `xcrate` flag. pub fn strip_private(mut krate: clean::Crate) -> plugins::PluginResult { // This stripper collects all *retained* nodes. let mut retained = HashSet::new(); let analysis = super::ANALYSISKEY.with(|a| a.clone()); let analysis = analysis.borrow(); let analysis = analysis.as_ref().unwrap(); let exported_items = analysis.exported_items.clone(); // strip all private items { let mut stripper = Stripper { retained: &mut retained, exported_items: &exported_items, }; krate = stripper.fold_crate(krate); } // strip all private implementations of traits { let mut stripper = ImplStripper(&retained); krate = stripper.fold_crate(krate); } (krate, None) } struct Stripper<'a> { retained: &'a mut HashSet<ast::NodeId>, exported_items: &'a NodeSet, } impl<'a> fold::DocFolder for Stripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { match i.inner { // These items can all get re-exported clean::TypedefItem(..) | clean::StaticItem(..) | clean::StructItem(..) | clean::EnumItem(..) | clean::TraitItem(..) | clean::FunctionItem(..) | clean::VariantItem(..) | clean::MethodItem(..) | clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) => { if ast_util::is_local(i.def_id) { if !self.exported_items.contains(&i.def_id.node) { return None; } // Traits are in exported_items even when they're totally private. if i.is_trait() && i.visibility != Some(ast::Public) { return None; } } } clean::ConstantItem(..) => { if ast_util::is_local(i.def_id) && !self.exported_items.contains(&i.def_id.node) { return None; } } clean::ViewItemItem(..) => { if i.visibility != Some(ast::Public) { return None } } clean::StructFieldItem(..) => { if i.visibility != Some(ast::Public) { return Some(clean::Item { inner: clean::StructFieldItem(clean::HiddenStructField), ..i }) } } // handled below clean::ModuleItem(..) => {} // trait impls for private items should be stripped clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ did, .. }, .. }) => { if ast_util::is_local(did) && !self.exported_items.contains(&did.node) { return None; } } clean::ImplItem(..) => {} // tymethods/macros have no control over privacy clean::MacroItem(..) | clean::TyMethodItem(..) => {} // Primitives are never stripped clean::PrimitiveItem(..) => {} // Associated types are never stripped clean::AssociatedTypeItem(..) => {} } let fastreturn = match i.inner { // nothing left to do for traits (don't want to filter their // methods out, visibility controlled by the trait) clean::TraitItem(..) => true, // implementations of traits are always public. clean::ImplItem(ref imp) if imp.trait_.is_some() => true, // Struct variant fields have inherited visibility clean::VariantItem(clean::Variant { kind: clean::StructVariant(..) }) => true, _ => false, }; let i = if fastreturn { self.retained.insert(i.def_id.node); return Some(i); } else { self.fold_item_recur(i) }; <|fim▁hole|> match i.inner { // emptied modules/impls have no need to exist clean::ModuleItem(ref m) if m.items.len() == 0 && i.doc_value().is_none() => None, clean::ImplItem(ref i) if i.items.len() == 0 => None, _ => { self.retained.insert(i.def_id.node); Some(i) } } } None => None, } } } // This stripper discards all private impls of traits struct ImplStripper<'a>(&'a HashSet<ast::NodeId>); impl<'a> fold::DocFolder for ImplStripper<'a> { fn fold_item(&mut self, i: Item) -> Option<Item> { if let clean::ImplItem(ref imp) = i.inner { match imp.trait_ { Some(clean::ResolvedPath{ did, .. }) => { let ImplStripper(s) = *self; if ast_util::is_local(did) && !s.contains(&did.node) { return None; } } Some(..) | None => {} } } self.fold_item_recur(i) } } pub fn unindent_comments(krate: clean::Crate) -> plugins::PluginResult { struct CommentCleaner; impl fold::DocFolder for CommentCleaner { fn fold_item(&mut self, i: Item) -> Option<Item> { let mut i = i; let mut avec: Vec<clean::Attribute> = Vec::new(); for attr in i.attrs.iter() { match attr { &clean::NameValue(ref x, ref s) if "doc" == x.as_slice() => { avec.push(clean::NameValue("doc".to_string(), unindent(s.as_slice()))) } x => avec.push(x.clone()) } } i.attrs = avec; self.fold_item_recur(i) } } let mut cleaner = CommentCleaner; let krate = cleaner.fold_crate(krate); (krate, None) } pub fn collapse_docs(krate: clean::Crate) -> plugins::PluginResult { struct Collapser; impl fold::DocFolder for Collapser { fn fold_item(&mut self, i: Item) -> Option<Item> { let mut docstr = String::new(); let mut i = i; for attr in i.attrs.iter() { match *attr { clean::NameValue(ref x, ref s) if "doc" == x.as_slice() => { docstr.push_str(s.as_slice()); docstr.push('\n'); }, _ => () } } let mut a: Vec<clean::Attribute> = i.attrs.iter().filter(|&a| match a { &clean::NameValue(ref x, _) if "doc" == x.as_slice() => false, _ => true }).map(|x| x.clone()).collect(); if docstr.len() > 0 { a.push(clean::NameValue("doc".to_string(), docstr)); } i.attrs = a; self.fold_item_recur(i) } } let mut collapser = Collapser; let krate = collapser.fold_crate(krate); (krate, None) } pub fn unindent(s: &str) -> String { let lines = s.lines_any().collect::<Vec<&str> >(); let mut saw_first_line = false; let mut saw_second_line = false; let min_indent = lines.iter().fold(uint::MAX, |min_indent, line| { // After we see the first non-whitespace line, look at // the line we have. If it is not whitespace, and therefore // part of the first paragraph, then ignore the indentation // level of the first line let ignore_previous_indents = saw_first_line && !saw_second_line && !line.is_whitespace(); let min_indent = if ignore_previous_indents { uint::MAX } else { min_indent }; if saw_first_line { saw_second_line = true; } if line.is_whitespace() { min_indent } else { saw_first_line = true; let mut spaces = 0; line.chars().all(|char| { // Only comparing against space because I wouldn't // know what to do with mixed whitespace chars if char == ' ' { spaces += 1; true } else { false } }); cmp::min(min_indent, spaces) } }); if lines.len() >= 1 { let mut unindented = vec![ lines[0].trim().to_string() ]; unindented.push_all(lines.tail().iter().map(|&line| { if line.is_whitespace() { line.to_string() } else { assert!(line.len() >= min_indent); line.slice_from(min_indent).to_string() } }).collect::<Vec<_>>().as_slice()); unindented.connect("\n") } else { s.to_string() } } #[cfg(test)] mod unindent_tests { use super::unindent; #[test] fn should_unindent() { let s = " line1\n line2".to_string(); let r = unindent(s.as_slice()); assert_eq!(r.as_slice(), "line1\nline2"); } #[test] fn should_unindent_multiple_paragraphs() { let s = " line1\n\n line2".to_string(); let r = unindent(s.as_slice()); assert_eq!(r.as_slice(), "line1\n\nline2"); } #[test] fn should_leave_multiple_indent_levels() { // Line 2 is indented another level beyond the // base indentation and should be preserved let s = " line1\n\n line2".to_string(); let r = unindent(s.as_slice()); assert_eq!(r.as_slice(), "line1\n\n line2"); } #[test] fn should_ignore_first_line_indent() { // The first line of the first paragraph may not be indented as // far due to the way the doc string was written: // // #[doc = "Start way over here // and continue here"] let s = "line1\n line2".to_string(); let r = unindent(s.as_slice()); assert_eq!(r.as_slice(), "line1\nline2"); } #[test] fn should_not_ignore_first_line_indent_in_a_single_line_para() { let s = "line1\n\n line2".to_string(); let r = unindent(s.as_slice()); assert_eq!(r.as_slice(), "line1\n\n line2"); } }<|fim▁end|>
match i { Some(i) => {
<|file_name|>cart66-library.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($) { $('.modalClose').click(function() { $('.Cart66Unavailable').fadeOut(800); }); $('#Cart66CancelPayPalSubscription').click(function() { return confirm('Are you sure you want to cancel your subscription?\n'); }); }); var $pj = jQuery.noConflict(); function getCartButtonFormData(formId) { var theForm = $pj('#' + formId); var str = ''; $pj('input:not([type=checkbox], :radio), input[type=checkbox]:checked, input:radio:checked, select, textarea', theForm).each( function() { var name = $pj(this).attr('name'); var val = $pj(this).val();<|fim▁hole|> ); return str.substring(0, str.length-1); }<|fim▁end|>
str += name + '=' + encodeURIComponent(val) + '&'; }
<|file_name|>fetch.js<|end_file_name|><|fim▁begin|>/** * @module kat-cr/lib/fetch * @description * Wraps request in a Promise */ /** * The HTTP response class provided by request * @external HTTPResponse * @see {@link http://github.com/request/request} */ "use strict"; const request = (function loadPrivate(module) { let modulePath = require.resolve(module), cached = require.cache[modulePath]; delete require.cache[modulePath]; let retval = require(module); require.cache[modulePath] = cached; return retval; })('request'), USER_AGENTS = require('../config/user-agents'); // Not necessary as of now, but in case Kickass Torrents requires cookies enabled in the future, and in case the library user needs to use request with his or her own cookie jar, we load a private copy of request so we can use our own cookie jar instead of overriding the global one request.defaults({ jar: true }); /**<|fim▁hole|> * Wraps request in a Promise, also sets a random user agent * @param {Object} config The details of the request as if it were passed to request directly * @returns {Promise.<external:HTTPResponse>} A promise which resolves with the response, or rejects with an error * @example * // Make a request to a JSON API * require('kat-cr/lib/fetch')({ * method: 'GET', * url: 'http://server.com/json-endpoint', * }).then(function (response) { * JSON.parse(response.body); * }); */ module.exports = function fetch(config) { if (!config) config = {}; if (!config.headers) config.headers = {}; config.headers['user-agent'] = USER_AGENTS[Math.floor(Math.random()*USER_AGENTS.length)]; return new Promise(function (resolve, reject) { request(config, function (err, resp, body) { if (err) reject(err); resolve(resp); }); }); }; /** Expose private request module for debugging */ module.exports._request = request;<|fim▁end|>
* @description
<|file_name|>permission_request_id.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/permissions/permission_request_id.h" #include <inttypes.h> #include <stdint.h> #include "base/strings/stringprintf.h" #include "content/public/browser/render_frame_host.h"<|fim▁hole|>namespace permissions { PermissionRequestID::PermissionRequestID( content::RenderFrameHost* render_frame_host, RequestLocalId request_local_id) : render_process_id_(render_frame_host->GetProcess()->GetID()), render_frame_id_(render_frame_host->GetRoutingID()), request_local_id_(request_local_id) {} PermissionRequestID::PermissionRequestID(int render_process_id, int render_frame_id, RequestLocalId request_local_id) : render_process_id_(render_process_id), render_frame_id_(render_frame_id), request_local_id_(request_local_id) {} PermissionRequestID::~PermissionRequestID() {} PermissionRequestID::PermissionRequestID(const PermissionRequestID&) = default; PermissionRequestID& PermissionRequestID::operator=( const PermissionRequestID&) = default; bool PermissionRequestID::operator==(const PermissionRequestID& other) const { return render_process_id_ == other.render_process_id_ && render_frame_id_ == other.render_frame_id_ && request_local_id_ == other.request_local_id_; } bool PermissionRequestID::operator!=(const PermissionRequestID& other) const { return !operator==(other); } std::string PermissionRequestID::ToString() const { return base::StringPrintf("%d,%d,%" PRId64, render_process_id_, render_frame_id_, request_local_id_.value()); } } // namespace permissions<|fim▁end|>
#include "content/public/browser/render_process_host.h"
<|file_name|>354. Russian Doll Envelopes.py<|end_file_name|><|fim▁begin|>class Solution(object): def maxEnvelopes(self, envelopes): """ :type envelopes: List[List[int]]<|fim▁hole|> :rtype: int """<|fim▁end|>
<|file_name|>test_data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 from shutil import rmtree from os import remove, path from crawler.swiftea_bot.data import BASE_LINKS URL = "http://aetfiws.ovh" SUGGESTIONS = ['http://suggestions.ovh/page1.html', 'http://suggestions.ovh/page2.html'] CODE1 = """<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="Description" content="Moteur de recherche"> <title>Swiftea</title> <link rel="stylesheet" href="public/css/reset.css"> <link rel="icon" href="public/favicon.ico" type="image/x-icon"> </head> <body> <p>une <a href="demo">CSS Demo</a> ici!</p> <h1>Gros titre🤣 </h1> <h2>Moyen titre</h2> <h3>petit titre</h3> <p><strong>strong </strong><em>em</em></p> <a href="index"> <img src="public/themes/default/img/logo.png" alt="Swiftea"> </a> du texte au milieu <a href="about/ninf.php" rel="noindex, nofollow">Why use Swiftea ?1</a> <a href="about/ni.php" rel="noindex">Why use Swiftea ?2</a> <a href="about/nf.php" rel="nofollow">Why use Swiftea ?3</a> <img src="public/themes/default/img/github.png" alt="Github Swiftea"> <img src="public/themes/default/img/twitter.png" alt="Twitter Swiftea"> <p>&#0169;</p> <p>&gt;</p> </body> </html> """ CODE2 = """<!DOCTYPE html> <html> <head><|fim▁hole|> <link rel="shortcut icon" href="public/favicon2.ico" type="image/x-icon"> </head> <body> </body> </html> """ CODE3 = """<!DOCTYPE html> <html> <head> <meta name="language" content="fr"> </head> <body> </body> </html> """ INVERTED_INDEX = {'EN': { 'A': {'ab': {'above': {1: .3, 2: .1}, 'abort': {1: .3, 2: .1}}}, 'W': {'wo': {'word': {1: .3, 30: .4}}}}, 'FR': { 'B': {'ba': {'bateau': {1: .5}}, 'bo': {'boule': {1: .25, 2: .8}}}}} CLEANED_KEYWORDS = [ ('le', 1), ('2015', 1), ('bureau', 1), ('word', 1), ('example', 1), ('oiseau', 1), ('quoi', 1), ('epee', 1), ('clock', 1), ('çochon', 1), ('12h', 1) ] def reset(DIR_DATA): if path.exists(DIR_DATA): rmtree(DIR_DATA) else: rmtree('badwords') rmtree('stopwords') rmtree('inverted_index') rmtree('links') rmtree('config') rmtree('stats') # for global tests: if path.exists('test_redirect_output.ext'): remove('test_redirect_output.ext')<|fim▁end|>
<meta http-equiv="content-language" content="en"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-16 LE" />
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::{error, fmt, str}; use string::SafeString; /// An error object. #[repr(C)] #[derive(Clone, PartialEq)] pub struct Error { desc: SafeString, } impl Error { /// Creates a new Error. pub fn new(desc: &str) -> Error { Self { desc: SafeString::from(desc), } } } impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Error: {}", error::Error::description(self)) } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", error::Error::description(self)) } } impl error::Error for Error { fn description(&self) -> &str { &self.desc } } #[cfg(test)] mod tests { use super::*; use std::error; #[test] fn description() { let msg = "out of bounds"; let err = Error::new(msg); assert_eq!(error::Error::description(&err), msg); }<|fim▁hole|>}<|fim▁end|>
<|file_name|>axisgrid.py<|end_file_name|><|fim▁begin|>from itertools import product from inspect import signature import warnings from textwrap import dedent import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from ._core import VectorPlotter, variable_type, categorical_order from . import utils from .utils import _check_argument, adjust_legend_subtitles, _draw_figure from .palettes import color_palette, blend_palette from ._decorators import _deprecate_positional_args from ._docstrings import ( DocstringComponents, _core_docs, ) __all__ = ["FacetGrid", "PairGrid", "JointGrid", "pairplot", "jointplot"] _param_docs = DocstringComponents.from_nested_components( core=_core_docs["params"], ) class _BaseGrid: """Base class for grids of subplots.""" def set(self, **kwargs): """Set attributes on each subplot Axes.""" for ax in self.axes.flat: if ax is not None: # Handle removed axes ax.set(**kwargs) return self @property def fig(self): """DEPRECATED: prefer the `figure` property.""" # Grid.figure is preferred because it matches the Axes attribute name. # But as the maintanace burden on having this property is minimal, # let's be slow about formally deprecating it. For now just note its deprecation # in the docstring; add a warning in version 0.13, and eventually remove it. return self._figure @property def figure(self): """Access the :class:`matplotlib.figure.Figure` object underlying the grid.""" return self._figure def savefig(self, *args, **kwargs): """ Save an image of the plot. This wraps :meth:`matplotlib.figure.Figure.savefig`, using bbox_inches="tight" by default. Parameters are passed through to the matplotlib function. """ kwargs = kwargs.copy() kwargs.setdefault("bbox_inches", "tight") self.figure.savefig(*args, **kwargs) class Grid(_BaseGrid): """A grid that can have multiple subplots and an external legend.""" _margin_titles = False _legend_out = True def __init__(self): self._tight_layout_rect = [0, 0, 1, 1] self._tight_layout_pad = None # This attribute is set externally and is a hack to handle newer functions that # don't add proxy artists onto the Axes. We need an overall cleaner approach. self._extract_legend_handles = False def tight_layout(self, *args, **kwargs): """Call fig.tight_layout within rect that exclude the legend.""" kwargs = kwargs.copy() kwargs.setdefault("rect", self._tight_layout_rect) if self._tight_layout_pad is not None: kwargs.setdefault("pad", self._tight_layout_pad) self._figure.tight_layout(*args, **kwargs) def add_legend(self, legend_data=None, title=None, label_order=None, adjust_subtitles=False, **kwargs): """Draw a legend, maybe placing it outside axes and resizing the figure. Parameters ---------- legend_data : dict Dictionary mapping label names (or two-element tuples where the second element is a label name) to matplotlib artist handles. The default reads from ``self._legend_data``. title : string Title for the legend. The default reads from ``self._hue_var``. label_order : list of labels The order that the legend entries should appear in. The default reads from ``self.hue_names``. adjust_subtitles : bool If True, modify entries with invisible artists to left-align the labels and set the font size to that of a title. kwargs : key, value pairings Other keyword arguments are passed to the underlying legend methods on the Figure or Axes object. Returns ------- self : Grid instance Returns self for easy chaining. """ # Find the data for the legend if legend_data is None: legend_data = self._legend_data if label_order is None: if self.hue_names is None: label_order = list(legend_data.keys()) else: label_order = list(map(utils.to_utf8, self.hue_names)) blank_handle = mpl.patches.Patch(alpha=0, linewidth=0) handles = [legend_data.get(l, blank_handle) for l in label_order] title = self._hue_var if title is None else title title_size = mpl.rcParams["legend.title_fontsize"] # Unpack nested labels from a hierarchical legend labels = [] for entry in label_order: if isinstance(entry, tuple): _, label = entry else: label = entry labels.append(label) # Set default legend kwargs kwargs.setdefault("scatterpoints", 1) if self._legend_out: kwargs.setdefault("frameon", False) kwargs.setdefault("loc", "center right") # Draw a full-figure legend outside the grid figlegend = self._figure.legend(handles, labels, **kwargs) self._legend = figlegend figlegend.set_title(title, prop={"size": title_size}) if adjust_subtitles: adjust_legend_subtitles(figlegend) # Draw the plot to set the bounding boxes correctly _draw_figure(self._figure) # Calculate and set the new width of the figure so the legend fits legend_width = figlegend.get_window_extent().width / self._figure.dpi fig_width, fig_height = self._figure.get_size_inches() self._figure.set_size_inches(fig_width + legend_width, fig_height) # Draw the plot again to get the new transformations _draw_figure(self._figure) # Now calculate how much space we need on the right side legend_width = figlegend.get_window_extent().width / self._figure.dpi space_needed = legend_width / (fig_width + legend_width) margin = .04 if self._margin_titles else .01 self._space_needed = margin + space_needed right = 1 - self._space_needed # Place the subplot axes to give space for the legend self._figure.subplots_adjust(right=right) self._tight_layout_rect[2] = right else: # Draw a legend in the first axis ax = self.axes.flat[0] kwargs.setdefault("loc", "best") leg = ax.legend(handles, labels, **kwargs) leg.set_title(title, prop={"size": title_size}) self._legend = leg if adjust_subtitles: adjust_legend_subtitles(leg) return self def _update_legend_data(self, ax): """Extract the legend data from an axes object and save it.""" data = {} # Get data directly from the legend, which is necessary # for newer functions that don't add labeled proxy artists if ax.legend_ is not None and self._extract_legend_handles: handles = ax.legend_.legendHandles labels = [t.get_text() for t in ax.legend_.texts] data.update({l: h for h, l in zip(handles, labels)}) handles, labels = ax.get_legend_handles_labels() data.update({l: h for h, l in zip(handles, labels)}) self._legend_data.update(data) # Now clear the legend ax.legend_ = None def _get_palette(self, data, hue, hue_order, palette): """Get a list of colors for the hue variable.""" if hue is None: palette = color_palette(n_colors=1) else: hue_names = categorical_order(data[hue], hue_order) n_colors = len(hue_names) # By default use either the current color palette or HUSL if palette is None: current_palette = utils.get_color_cycle() if n_colors > len(current_palette): colors = color_palette("husl", n_colors) else: colors = color_palette(n_colors=n_colors) # Allow for palette to map from hue variable names elif isinstance(palette, dict): color_names = [palette[h] for h in hue_names] colors = color_palette(color_names, n_colors) # Otherwise act as if we just got a list of colors else: colors = color_palette(palette, n_colors) palette = color_palette(colors, n_colors) return palette @property def legend(self): """The :class:`matplotlib.legend.Legend` object, if present.""" try: return self._legend except AttributeError: return None _facet_docs = dict( data=dedent("""\ data : DataFrame Tidy ("long-form") dataframe where each column is a variable and each row is an observation.\ """), rowcol=dedent("""\ row, col : vectors or keys in ``data`` Variables that define subsets to plot on different facets.\ """), rowcol_order=dedent("""\ {row,col}_order : vector of strings Specify the order in which levels of the ``row`` and/or ``col`` variables appear in the grid of subplots.\ """), col_wrap=dedent("""\ col_wrap : int "Wrap" the column variable at this width, so that the column facets span multiple rows. Incompatible with a ``row`` facet.\ """), share_xy=dedent("""\ share{x,y} : bool, 'col', or 'row' optional If true, the facets will share y axes across columns and/or x axes across rows.\ """), height=dedent("""\ height : scalar Height (in inches) of each facet. See also: ``aspect``.\ """), aspect=dedent("""\ aspect : scalar Aspect ratio of each facet, so that ``aspect * height`` gives the width of each facet in inches.\ """), palette=dedent("""\ palette : palette name, list, or dict Colors to use for the different levels of the ``hue`` variable. Should be something that can be interpreted by :func:`color_palette`, or a dictionary mapping hue levels to matplotlib colors.\ """), legend_out=dedent("""\ legend_out : bool If ``True``, the figure size will be extended, and the legend will be drawn outside the plot on the center right.\ """), margin_titles=dedent("""\ margin_titles : bool If ``True``, the titles for the row variable are drawn to the right of the last column. This option is experimental and may not work in all cases.\ """), facet_kws=dedent("""\ facet_kws : dict Additional parameters passed to :class:`FacetGrid`. """), ) class FacetGrid(Grid): """Multi-plot grid for plotting conditional relationships.""" @_deprecate_positional_args def __init__( self, data, *, row=None, col=None, hue=None, col_wrap=None, sharex=True, sharey=True, height=3, aspect=1, palette=None, row_order=None, col_order=None, hue_order=None, hue_kws=None, dropna=False, legend_out=True, despine=True, margin_titles=False, xlim=None, ylim=None, subplot_kws=None, gridspec_kws=None, size=None ): super(FacetGrid, self).__init__() # Handle deprecations if size is not None: height = size msg = ("The `size` parameter has been renamed to `height`; " "please update your code.") warnings.warn(msg, UserWarning) # Determine the hue facet layer information hue_var = hue if hue is None: hue_names = None else: hue_names = categorical_order(data[hue], hue_order) colors = self._get_palette(data, hue, hue_order, palette) # Set up the lists of names for the row and column facet variables if row is None: row_names = [] else: row_names = categorical_order(data[row], row_order) if col is None: col_names = [] else: col_names = categorical_order(data[col], col_order) # Additional dict of kwarg -> list of values for mapping the hue var hue_kws = hue_kws if hue_kws is not None else {} # Make a boolean mask that is True anywhere there is an NA # value in one of the faceting variables, but only if dropna is True none_na = np.zeros(len(data), bool) if dropna: row_na = none_na if row is None else data[row].isnull() col_na = none_na if col is None else data[col].isnull() hue_na = none_na if hue is None else data[hue].isnull() not_na = ~(row_na | col_na | hue_na) else: not_na = ~none_na # Compute the grid shape ncol = 1 if col is None else len(col_names) nrow = 1 if row is None else len(row_names) self._n_facets = ncol * nrow self._col_wrap = col_wrap if col_wrap is not None: if row is not None: err = "Cannot use `row` and `col_wrap` together." raise ValueError(err) ncol = col_wrap nrow = int(np.ceil(len(col_names) / col_wrap)) self._ncol = ncol self._nrow = nrow # Calculate the base figure size # This can get stretched later by a legend # TODO this doesn't account for axis labels figsize = (ncol * height * aspect, nrow * height) # Validate some inputs if col_wrap is not None: margin_titles = False # Build the subplot keyword dictionary subplot_kws = {} if subplot_kws is None else subplot_kws.copy() gridspec_kws = {} if gridspec_kws is None else gridspec_kws.copy() if xlim is not None: subplot_kws["xlim"] = xlim if ylim is not None: subplot_kws["ylim"] = ylim # --- Initialize the subplot grid # Disable autolayout so legend_out works properly with mpl.rc_context({"figure.autolayout": False}): fig = plt.figure(figsize=figsize) if col_wrap is None: kwargs = dict(squeeze=False, sharex=sharex, sharey=sharey, subplot_kw=subplot_kws, gridspec_kw=gridspec_kws) axes = fig.subplots(nrow, ncol, **kwargs) if col is None and row is None: axes_dict = {} elif col is None: axes_dict = dict(zip(row_names, axes.flat)) elif row is None: axes_dict = dict(zip(col_names, axes.flat)) else: facet_product = product(row_names, col_names) axes_dict = dict(zip(facet_product, axes.flat)) else: # If wrapping the col variable we need to make the grid ourselves if gridspec_kws: warnings.warn("`gridspec_kws` ignored when using `col_wrap`") n_axes = len(col_names) axes = np.empty(n_axes, object) axes[0] = fig.add_subplot(nrow, ncol, 1, **subplot_kws) if sharex: subplot_kws["sharex"] = axes[0] if sharey: subplot_kws["sharey"] = axes[0] for i in range(1, n_axes): axes[i] = fig.add_subplot(nrow, ncol, i + 1, **subplot_kws) axes_dict = dict(zip(col_names, axes)) # --- Set up the class attributes # Attributes that are part of the public API but accessed through # a property so that Sphinx adds them to the auto class doc self._figure = fig self._axes = axes self._axes_dict = axes_dict self._legend = None # Public attributes that aren't explicitly documented # (It's not obvious that having them be public was a good idea) self.data = data self.row_names = row_names self.col_names = col_names self.hue_names = hue_names self.hue_kws = hue_kws # Next the private variables self._nrow = nrow self._row_var = row self._ncol = ncol self._col_var = col self._margin_titles = margin_titles self._margin_titles_texts = [] self._col_wrap = col_wrap self._hue_var = hue_var self._colors = colors self._legend_out = legend_out self._legend_data = {} self._x_var = None self._y_var = None self._sharex = sharex self._sharey = sharey self._dropna = dropna self._not_na = not_na # --- Make the axes look good self.set_titles() self.tight_layout() if despine: self.despine() if sharex in [True, 'col']: for ax in self._not_bottom_axes: for label in ax.get_xticklabels(): label.set_visible(False) ax.xaxis.offsetText.set_visible(False) ax.xaxis.label.set_visible(False) if sharey in [True, 'row']: for ax in self._not_left_axes: for label in ax.get_yticklabels(): label.set_visible(False) ax.yaxis.offsetText.set_visible(False) ax.yaxis.label.set_visible(False) __init__.__doc__ = dedent("""\ Initialize the matplotlib figure and FacetGrid object. This class maps a dataset onto multiple axes arrayed in a grid of rows and columns that correspond to *levels* of variables in the dataset. The plots it produces are often called "lattice", "trellis", or "small-multiple" graphics. It can also represent levels of a third variable with the ``hue`` parameter, which plots different subsets of data in different colors. This uses color to resolve elements on a third dimension, but only draws subsets on top of each other and will not tailor the ``hue`` parameter for the specific visualization the way that axes-level functions that accept ``hue`` will. The basic workflow is to initialize the :class:`FacetGrid` object with the dataset and the variables that are used to structure the grid. Then one or more plotting functions can be applied to each subset by calling :meth:`FacetGrid.map` or :meth:`FacetGrid.map_dataframe`. Finally, the plot can be tweaked with other methods to do things like change the axis labels, use different ticks, or add a legend. See the detailed code examples below for more information. .. warning:: When using seaborn functions that infer semantic mappings from a dataset, care must be taken to synchronize those mappings across facets (e.g., by defing the ``hue`` mapping with a palette dict or setting the data type of the variables to ``category``). In most cases, it will be better to use a figure-level function (e.g. :func:`relplot` or :func:`catplot`) than to use :class:`FacetGrid` directly. See the :ref:`tutorial <grid_tutorial>` for more information. Parameters ---------- {data} row, col, hue : strings Variables that define subsets of the data, which will be drawn on separate facets in the grid. See the ``{{var}}_order`` parameters to control the order of levels of this variable. {col_wrap} {share_xy} {height} {aspect} {palette} {{row,col,hue}}_order : lists Order for the levels of the faceting variables. By default, this will be the order that the levels appear in ``data`` or, if the variables are pandas categoricals, the category order. hue_kws : dictionary of param -> list of values mapping Other keyword arguments to insert into the plotting call to let other plot attributes vary across levels of the hue variable (e.g. the markers in a scatterplot). {legend_out} despine : boolean Remove the top and right spines from the plots. {margin_titles} {{x, y}}lim: tuples Limits for each of the axes on each facet (only relevant when share{{x, y}} is True). subplot_kws : dict Dictionary of keyword arguments passed to matplotlib subplot(s) methods. gridspec_kws : dict Dictionary of keyword arguments passed to :class:`matplotlib.gridspec.GridSpec` (via :meth:`matplotlib.figure.Figure.subplots`). Ignored if ``col_wrap`` is not ``None``. See Also -------- PairGrid : Subplot grid for plotting pairwise relationships relplot : Combine a relational plot and a :class:`FacetGrid` displot : Combine a distribution plot and a :class:`FacetGrid` catplot : Combine a categorical plot and a :class:`FacetGrid` lmplot : Combine a regression plot and a :class:`FacetGrid` Examples -------- .. note:: These examples use seaborn functions to demonstrate some of the advanced features of the class, but in most cases you will want to use figue-level functions (e.g. :func:`displot`, :func:`relplot`) to make the plots shown here. .. include:: ../docstrings/FacetGrid.rst """).format(**_facet_docs) def facet_data(self): """Generator for name indices and data subsets for each facet. Yields ------ (i, j, k), data_ijk : tuple of ints, DataFrame The ints provide an index into the {row, col, hue}_names attribute, and the dataframe contains a subset of the full data corresponding to each facet. The generator yields subsets that correspond with the self.axes.flat iterator, or self.axes[i, j] when `col_wrap` is None. """ data = self.data # Construct masks for the row variable if self.row_names: row_masks = [data[self._row_var] == n for n in self.row_names] else: row_masks = [np.repeat(True, len(self.data))] # Construct masks for the column variable if self.col_names: col_masks = [data[self._col_var] == n for n in self.col_names] else: col_masks = [np.repeat(True, len(self.data))] # Construct masks for the hue variable if self.hue_names: hue_masks = [data[self._hue_var] == n for n in self.hue_names] else: hue_masks = [np.repeat(True, len(self.data))] # Here is the main generator loop for (i, row), (j, col), (k, hue) in product(enumerate(row_masks), enumerate(col_masks), enumerate(hue_masks)): data_ijk = data[row & col & hue & self._not_na] yield (i, j, k), data_ijk def map(self, func, *args, **kwargs): """Apply a plotting function to each facet's subset of the data. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. It must plot to the currently active matplotlib Axes and take a `color` keyword argument. If faceting on the `hue` dimension, it must also take a `label` keyword argument. args : strings Column names in self.data that identify variables with data to plot. The data for each variable is passed to `func` in the order the variables are specified in the call. kwargs : keyword arguments All keyword arguments are passed to the plotting function. Returns ------- self : object Returns self. """ # If color was a keyword argument, grab it here kw_color = kwargs.pop("color", None) # How we use the function depends on where it comes from func_module = str(getattr(func, "__module__", "")) # Check for categorical plots without order information if func_module == "seaborn.categorical": if "order" not in kwargs: warning = ("Using the {} function without specifying " "`order` is likely to produce an incorrect " "plot.".format(func.__name__)) warnings.warn(warning) if len(args) == 3 and "hue_order" not in kwargs: warning = ("Using the {} function without specifying " "`hue_order` is likely to produce an incorrect " "plot.".format(func.__name__)) warnings.warn(warning) # Iterate over the data subsets for (row_i, col_j, hue_k), data_ijk in self.facet_data(): # If this subset is null, move on if not data_ijk.values.size: continue # Get the current axis modify_state = not func_module.startswith("seaborn") ax = self.facet_axis(row_i, col_j, modify_state) # Decide what color to plot with kwargs["color"] = self._facet_color(hue_k, kw_color) # Insert the other hue aesthetics if appropriate for kw, val_list in self.hue_kws.items(): kwargs[kw] = val_list[hue_k] # Insert a label in the keyword arguments for the legend if self._hue_var is not None: kwargs["label"] = utils.to_utf8(self.hue_names[hue_k]) # Get the actual data we are going to plot with plot_data = data_ijk[list(args)] if self._dropna: plot_data = plot_data.dropna() plot_args = [v for k, v in plot_data.iteritems()] # Some matplotlib functions don't handle pandas objects correctly if func_module.startswith("matplotlib"): plot_args = [v.values for v in plot_args] # Draw the plot self._facet_plot(func, ax, plot_args, kwargs) # Finalize the annotations and layout self._finalize_grid(args[:2]) return self def map_dataframe(self, func, *args, **kwargs): """Like ``.map`` but passes args as strings and inserts data in kwargs. This method is suitable for plotting with functions that accept a long-form DataFrame as a `data` keyword argument and access the data in that DataFrame using string variable names. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. Unlike the `map` method, a function used here must "understand" Pandas objects. It also must plot to the currently active matplotlib Axes and take a `color` keyword argument. If faceting on the `hue` dimension, it must also take a `label` keyword argument. args : strings Column names in self.data that identify variables with data to plot. The data for each variable is passed to `func` in the order the variables are specified in the call. kwargs : keyword arguments All keyword arguments are passed to the plotting function. Returns ------- self : object Returns self. """ # If color was a keyword argument, grab it here kw_color = kwargs.pop("color", None) # Iterate over the data subsets for (row_i, col_j, hue_k), data_ijk in self.facet_data(): # If this subset is null, move on if not data_ijk.values.size: continue # Get the current axis modify_state = not str(func.__module__).startswith("seaborn") ax = self.facet_axis(row_i, col_j, modify_state) # Decide what color to plot with kwargs["color"] = self._facet_color(hue_k, kw_color) # Insert the other hue aesthetics if appropriate for kw, val_list in self.hue_kws.items(): kwargs[kw] = val_list[hue_k] # Insert a label in the keyword arguments for the legend if self._hue_var is not None: kwargs["label"] = self.hue_names[hue_k] # Stick the facet dataframe into the kwargs if self._dropna: data_ijk = data_ijk.dropna() kwargs["data"] = data_ijk # Draw the plot self._facet_plot(func, ax, args, kwargs) # For axis labels, prefer to use positional args for backcompat # but also extract the x/y kwargs and use if no corresponding arg axis_labels = [kwargs.get("x", None), kwargs.get("y", None)] for i, val in enumerate(args[:2]): axis_labels[i] = val self._finalize_grid(axis_labels) return self def _facet_color(self, hue_index, kw_color): color = self._colors[hue_index] if kw_color is not None: return kw_color elif color is not None: return color def _facet_plot(self, func, ax, plot_args, plot_kwargs): # Draw the plot if str(func.__module__).startswith("seaborn"): plot_kwargs = plot_kwargs.copy() semantics = ["x", "y", "hue", "size", "style"] for key, val in zip(semantics, plot_args): plot_kwargs[key] = val plot_args = [] plot_kwargs["ax"] = ax func(*plot_args, **plot_kwargs) # Sort out the supporting information self._update_legend_data(ax) def _finalize_grid(self, axlabels): """Finalize the annotations and layout.""" self.set_axis_labels(*axlabels) self.tight_layout() def facet_axis(self, row_i, col_j, modify_state=True): """Make the axis identified by these indices active and return it.""" # Calculate the actual indices of the axes to plot on if self._col_wrap is not None: ax = self.axes.flat[col_j] else: ax = self.axes[row_i, col_j] # Get a reference to the axes object we want, and make it active if modify_state: plt.sca(ax) return ax def despine(self, **kwargs): """Remove axis spines from the facets.""" utils.despine(self._figure, **kwargs) return self def set_axis_labels(self, x_var=None, y_var=None, clear_inner=True, **kwargs): """Set axis labels on the left column and bottom row of the grid.""" if x_var is not None: self._x_var = x_var self.set_xlabels(x_var, clear_inner=clear_inner, **kwargs) if y_var is not None: self._y_var = y_var self.set_ylabels(y_var, clear_inner=clear_inner, **kwargs) return self def set_xlabels(self, label=None, clear_inner=True, **kwargs): """Label the x axis on the bottom row of the grid.""" if label is None: label = self._x_var for ax in self._bottom_axes: ax.set_xlabel(label, **kwargs) if clear_inner: for ax in self._not_bottom_axes: ax.set_xlabel("") return self def set_ylabels(self, label=None, clear_inner=True, **kwargs): """Label the y axis on the left column of the grid.""" if label is None: label = self._y_var for ax in self._left_axes: ax.set_ylabel(label, **kwargs) if clear_inner: for ax in self._not_left_axes: ax.set_ylabel("") return self def set_xticklabels(self, labels=None, step=None, **kwargs): """Set x axis tick labels of the grid.""" for ax in self.axes.flat: curr_ticks = ax.get_xticks() ax.set_xticks(curr_ticks) if labels is None: curr_labels = [l.get_text() for l in ax.get_xticklabels()] if step is not None: xticks = ax.get_xticks()[::step] curr_labels = curr_labels[::step] ax.set_xticks(xticks) ax.set_xticklabels(curr_labels, **kwargs) else: ax.set_xticklabels(labels, **kwargs) return self def set_yticklabels(self, labels=None, **kwargs): """Set y axis tick labels on the left column of the grid.""" for ax in self.axes.flat: curr_ticks = ax.get_yticks() ax.set_yticks(curr_ticks) if labels is None: curr_labels = [l.get_text() for l in ax.get_yticklabels()] ax.set_yticklabels(curr_labels, **kwargs) else: ax.set_yticklabels(labels, **kwargs) return self def set_titles(self, template=None, row_template=None, col_template=None, **kwargs): """Draw titles either above each facet or on the grid margins. Parameters ---------- template : string Template for all titles with the formatting keys {col_var} and {col_name} (if using a `col` faceting variable) and/or {row_var} and {row_name} (if using a `row` faceting variable). row_template: Template for the row variable when titles are drawn on the grid margins. Must have {row_var} and {row_name} formatting keys. col_template: Template for the row variable when titles are drawn on the grid margins. Must have {col_var} and {col_name} formatting keys. Returns ------- self: object Returns self. """ args = dict(row_var=self._row_var, col_var=self._col_var) kwargs["size"] = kwargs.pop("size", mpl.rcParams["axes.labelsize"]) # Establish default templates if row_template is None: row_template = "{row_var} = {row_name}" if col_template is None: col_template = "{col_var} = {col_name}" if template is None: if self._row_var is None: template = col_template elif self._col_var is None: template = row_template else: template = " | ".join([row_template, col_template]) row_template = utils.to_utf8(row_template) col_template = utils.to_utf8(col_template) template = utils.to_utf8(template) if self._margin_titles: # Remove any existing title texts for text in self._margin_titles_texts: text.remove() self._margin_titles_texts = [] if self.row_names is not None: # Draw the row titles on the right edge of the grid for i, row_name in enumerate(self.row_names): ax = self.axes[i, -1] args.update(dict(row_name=row_name)) title = row_template.format(**args) text = ax.annotate( title, xy=(1.02, .5), xycoords="axes fraction", rotation=270, ha="left", va="center", **kwargs ) self._margin_titles_texts.append(text) if self.col_names is not None: # Draw the column titles as normal titles for j, col_name in enumerate(self.col_names): args.update(dict(col_name=col_name)) title = col_template.format(**args) self.axes[0, j].set_title(title, **kwargs) return self # Otherwise title each facet with all the necessary information if (self._row_var is not None) and (self._col_var is not None): for i, row_name in enumerate(self.row_names): for j, col_name in enumerate(self.col_names): args.update(dict(row_name=row_name, col_name=col_name)) title = template.format(**args) self.axes[i, j].set_title(title, **kwargs) elif self.row_names is not None and len(self.row_names): for i, row_name in enumerate(self.row_names): args.update(dict(row_name=row_name)) title = template.format(**args) self.axes[i, 0].set_title(title, **kwargs) elif self.col_names is not None and len(self.col_names): for i, col_name in enumerate(self.col_names): args.update(dict(col_name=col_name)) title = template.format(**args) # Index the flat array so col_wrap works self.axes.flat[i].set_title(title, **kwargs) return self def refline(self, *, x=None, y=None, color='.5', linestyle='--', **line_kws): """Add a reference line(s) to each facet. Parameters ---------- x, y : numeric Value(s) to draw the line(s) at. color : :mod:`matplotlib color <matplotlib.colors>` Specifies the color of the reference line(s). Pass ``color=None`` to use ``hue`` mapping. linestyle : str Specifies the style of the reference line(s). line_kws : key, value mappings Other keyword arguments are passed to :meth:`matplotlib.axes.Axes.axvline` when ``x`` is not None and :meth:`matplotlib.axes.Axes.axhline` when ``y`` is not None. Returns ------- :class:`FacetGrid` instance Returns ``self`` for easy method chaining. """ line_kws['color'] = color line_kws['linestyle'] = linestyle if x is not None: self.map(plt.axvline, x=x, **line_kws) if y is not None: self.map(plt.axhline, y=y, **line_kws) # ------ Properties that are part of the public API and documented by Sphinx @property def axes(self): """An array of the :class:`matplotlib.axes.Axes` objects in the grid.""" return self._axes @property def ax(self): """The :class:`matplotlib.axes.Axes` when no faceting variables are assigned.""" if self.axes.shape == (1, 1): return self.axes[0, 0] else: err = ( "Use the `.axes` attribute when facet variables are assigned." ) raise AttributeError(err) @property def axes_dict(self): """A mapping of facet names to corresponding :class:`matplotlib.axes.Axes`. If only one of ``row`` or ``col`` is assigned, each key is a string representing a level of that variable. If both facet dimensions are assigned, each key is a ``({row_level}, {col_level})`` tuple. """ return self._axes_dict # ------ Private properties, that require some computation to get @property def _inner_axes(self): """Return a flat array of the inner axes.""" if self._col_wrap is None: return self.axes[:-1, 1:].flat else: axes = [] n_empty = self._nrow * self._ncol - self._n_facets for i, ax in enumerate(self.axes): append = ( i % self._ncol and i < (self._ncol * (self._nrow - 1)) and i < (self._ncol * (self._nrow - 1) - n_empty) ) if append: axes.append(ax) return np.array(axes, object).flat @property def _left_axes(self): """Return a flat array of the left column of axes.""" if self._col_wrap is None: return self.axes[:, 0].flat else: axes = [] for i, ax in enumerate(self.axes): if not i % self._ncol: axes.append(ax) return np.array(axes, object).flat @property def _not_left_axes(self): """Return a flat array of axes that aren't on the left column.""" if self._col_wrap is None: return self.axes[:, 1:].flat else: axes = [] for i, ax in enumerate(self.axes): if i % self._ncol: axes.append(ax) return np.array(axes, object).flat @property def _bottom_axes(self): """Return a flat array of the bottom row of axes.""" if self._col_wrap is None: return self.axes[-1, :].flat else: axes = [] n_empty = self._nrow * self._ncol - self._n_facets for i, ax in enumerate(self.axes): append = ( i >= (self._ncol * (self._nrow - 1)) or i >= (self._ncol * (self._nrow - 1) - n_empty) ) if append: axes.append(ax) return np.array(axes, object).flat @property def _not_bottom_axes(self): """Return a flat array of axes that aren't on the bottom row.""" if self._col_wrap is None: return self.axes[:-1, :].flat else: axes = [] n_empty = self._nrow * self._ncol - self._n_facets for i, ax in enumerate(self.axes): append = ( i < (self._ncol * (self._nrow - 1)) and i < (self._ncol * (self._nrow - 1) - n_empty) ) if append: axes.append(ax) return np.array(axes, object).flat class PairGrid(Grid): """Subplot grid for plotting pairwise relationships in a dataset. This object maps each variable in a dataset onto a column and row in a grid of multiple axes. Different axes-level plotting functions can be used to draw bivariate plots in the upper and lower triangles, and the the marginal distribution of each variable can be shown on the diagonal. Several different common plots can be generated in a single line using :func:`pairplot`. Use :class:`PairGrid` when you need more flexibility. See the :ref:`tutorial <grid_tutorial>` for more information. """ @_deprecate_positional_args def __init__( self, data, *, hue=None, hue_order=None, palette=None, hue_kws=None, vars=None, x_vars=None, y_vars=None, corner=False, diag_sharey=True, height=2.5, aspect=1, layout_pad=.5, despine=True, dropna=False, size=None ): """Initialize the plot figure and PairGrid object. Parameters ---------- data : DataFrame Tidy (long-form) dataframe where each column is a variable and each row is an observation. hue : string (variable name) Variable in ``data`` to map plot aspects to different colors. This variable will be excluded from the default x and y variables. hue_order : list of strings Order for the levels of the hue variable in the palette palette : dict or seaborn color palette Set of colors for mapping the ``hue`` variable. If a dict, keys should be values in the ``hue`` variable. hue_kws : dictionary of param -> list of values mapping Other keyword arguments to insert into the plotting call to let other plot attributes vary across levels of the hue variable (e.g. the markers in a scatterplot). vars : list of variable names Variables within ``data`` to use, otherwise use every column with a numeric datatype. {x, y}_vars : lists of variable names Variables within ``data`` to use separately for the rows and columns of the figure; i.e. to make a non-square plot. corner : bool If True, don't add axes to the upper (off-diagonal) triangle of the grid, making this a "corner" plot. height : scalar Height (in inches) of each facet. aspect : scalar Aspect * height gives the width (in inches) of each facet. layout_pad : scalar Padding between axes; passed to ``fig.tight_layout``. despine : boolean Remove the top and right spines from the plots. dropna : boolean Drop missing values from the data before plotting. See Also -------- pairplot : Easily drawing common uses of :class:`PairGrid`. FacetGrid : Subplot grid for plotting conditional relationships. Examples -------- .. include:: ../docstrings/PairGrid.rst """ super(PairGrid, self).__init__() # Handle deprecations if size is not None: height = size msg = ("The `size` parameter has been renamed to `height`; " "please update your code.") warnings.warn(UserWarning(msg)) # Sort out the variables that define the grid numeric_cols = self._find_numeric_cols(data) if hue in numeric_cols: numeric_cols.remove(hue) if vars is not None: x_vars = list(vars) y_vars = list(vars) if x_vars is None: x_vars = numeric_cols if y_vars is None: y_vars = numeric_cols if np.isscalar(x_vars): x_vars = [x_vars] if np.isscalar(y_vars): y_vars = [y_vars] self.x_vars = x_vars = list(x_vars) self.y_vars = y_vars = list(y_vars) self.square_grid = self.x_vars == self.y_vars if not x_vars: raise ValueError("No variables found for grid columns.") if not y_vars: raise ValueError("No variables found for grid rows.") # Create the figure and the array of subplots figsize = len(x_vars) * height * aspect, len(y_vars) * height # Disable autolayout so legend_out works with mpl.rc_context({"figure.autolayout": False}): fig = plt.figure(figsize=figsize) axes = fig.subplots(len(y_vars), len(x_vars), sharex="col", sharey="row", squeeze=False) # Possibly remove upper axes to make a corner grid # Note: setting up the axes is usually the most time-intensive part # of using the PairGrid. We are foregoing the speed improvement that # we would get by just not setting up the hidden axes so that we can # avoid implementing fig.subplots ourselves. But worth thinking about. self._corner = corner if corner: hide_indices = np.triu_indices_from(axes, 1) for i, j in zip(*hide_indices): axes[i, j].remove() axes[i, j] = None self._figure = fig self.axes = axes self.data = data # Save what we are going to do with the diagonal self.diag_sharey = diag_sharey self.diag_vars = None self.diag_axes = None self._dropna = dropna # Label the axes self._add_axis_labels() # Sort out the hue variable self._hue_var = hue if hue is None: self.hue_names = hue_order = ["_nolegend_"] self.hue_vals = pd.Series(["_nolegend_"] * len(data), index=data.index) else: # We need hue_order and hue_names because the former is used to control # the order of drawing and the latter is used to control the order of # the legend. hue_names can become string-typed while hue_order must # retain the type of the input data. This is messy but results from # the fact that PairGrid can implement the hue-mapping logic itself # (and was originally written exclusively that way) but now can delegate # to the axes-level functions, while always handling legend creation. # See GH2307 hue_names = hue_order = categorical_order(data[hue], hue_order) if dropna: # Filter NA from the list of unique hue names hue_names = list(filter(pd.notnull, hue_names)) self.hue_names = hue_names self.hue_vals = data[hue] # Additional dict of kwarg -> list of values for mapping the hue var self.hue_kws = hue_kws if hue_kws is not None else {} self._orig_palette = palette self._hue_order = hue_order self.palette = self._get_palette(data, hue, hue_order, palette) self._legend_data = {} # Make the plot look nice for ax in axes[:-1, :].flat: if ax is None: continue for label in ax.get_xticklabels(): label.set_visible(False) ax.xaxis.offsetText.set_visible(False) ax.xaxis.label.set_visible(False) for ax in axes[:, 1:].flat: if ax is None: continue for label in ax.get_yticklabels(): label.set_visible(False) ax.yaxis.offsetText.set_visible(False) ax.yaxis.label.set_visible(False) self._tight_layout_rect = [.01, .01, .99, .99] self._tight_layout_pad = layout_pad self._despine = despine if despine: utils.despine(fig=fig) self.tight_layout(pad=layout_pad) def map(self, func, **kwargs): """Plot with the same function in every subplot. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. """ row_indices, col_indices = np.indices(self.axes.shape) indices = zip(row_indices.flat, col_indices.flat) self._map_bivariate(func, indices, **kwargs) return self def map_lower(self, func, **kwargs): """Plot with a bivariate function on the lower diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. """ indices = zip(*np.tril_indices_from(self.axes, -1)) self._map_bivariate(func, indices, **kwargs) return self def map_upper(self, func, **kwargs): """Plot with a bivariate function on the upper diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. """ indices = zip(*np.triu_indices_from(self.axes, 1)) self._map_bivariate(func, indices, **kwargs) return self def map_offdiag(self, func, **kwargs): """Plot with a bivariate function on the off-diagonal subplots. Parameters ---------- func : callable plotting function Must take x, y arrays as positional arguments and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. """ if self.square_grid: self.map_lower(func, **kwargs) if not self._corner: self.map_upper(func, **kwargs) else: indices = [] for i, (y_var) in enumerate(self.y_vars): for j, (x_var) in enumerate(self.x_vars): if x_var != y_var: indices.append((i, j)) self._map_bivariate(func, indices, **kwargs) return self def map_diag(self, func, **kwargs): """Plot with a univariate function on each diagonal subplot. Parameters ---------- func : callable plotting function Must take an x array as a positional argument and draw onto the "currently active" matplotlib Axes. Also needs to accept kwargs called ``color`` and ``label``. """ # Add special diagonal axes for the univariate plot if self.diag_axes is None: diag_vars = [] diag_axes = [] for i, y_var in enumerate(self.y_vars): for j, x_var in enumerate(self.x_vars): if x_var == y_var: # Make the density axes diag_vars.append(x_var) ax = self.axes[i, j] diag_ax = ax.twinx() diag_ax.set_axis_off() diag_axes.append(diag_ax) # Work around matplotlib bug # https://github.com/matplotlib/matplotlib/issues/15188 if not plt.rcParams.get("ytick.left", True): for tick in ax.yaxis.majorTicks: tick.tick1line.set_visible(False) # Remove main y axis from density axes in a corner plot if self._corner: ax.yaxis.set_visible(False) if self._despine: utils.despine(ax=ax, left=True) # TODO add optional density ticks (on the right) # when drawing a corner plot? if self.diag_sharey and diag_axes: # This may change in future matplotlibs # See https://github.com/matplotlib/matplotlib/pull/9923 group = diag_axes[0].get_shared_y_axes() for ax in diag_axes[1:]: group.join(ax, diag_axes[0]) self.diag_vars = np.array(diag_vars, np.object_) self.diag_axes = np.array(diag_axes, np.object_) if "hue" not in signature(func).parameters: return self._map_diag_iter_hue(func, **kwargs) # Loop over diagonal variables and axes, making one plot in each for var, ax in zip(self.diag_vars, self.diag_axes): plot_kwargs = kwargs.copy() if str(func.__module__).startswith("seaborn"): plot_kwargs["ax"] = ax else: plt.sca(ax) vector = self.data[var] if self._hue_var is not None: hue = self.data[self._hue_var] else: hue = None if self._dropna: not_na = vector.notna() if hue is not None: not_na &= hue.notna() vector = vector[not_na] if hue is not None: hue = hue[not_na] plot_kwargs.setdefault("hue", hue) plot_kwargs.setdefault("hue_order", self._hue_order) plot_kwargs.setdefault("palette", self._orig_palette) func(x=vector, **plot_kwargs) ax.legend_ = None self._add_axis_labels() return self def _map_diag_iter_hue(self, func, **kwargs): """Put marginal plot on each diagonal axes, iterating over hue.""" # Plot on each of the diagonal axes fixed_color = kwargs.pop("color", None) for var, ax in zip(self.diag_vars, self.diag_axes): hue_grouped = self.data[var].groupby(self.hue_vals) plot_kwargs = kwargs.copy() if str(func.__module__).startswith("seaborn"): plot_kwargs["ax"] = ax else: plt.sca(ax) for k, label_k in enumerate(self._hue_order): # Attempt to get data for this level, allowing for empty try: data_k = hue_grouped.get_group(label_k) except KeyError: data_k = pd.Series([], dtype=float) if fixed_color is None: color = self.palette[k] else: color = fixed_color if self._dropna: data_k = utils.remove_na(data_k) if str(func.__module__).startswith("seaborn"): func(x=data_k, label=label_k, color=color, **plot_kwargs) else: func(data_k, label=label_k, color=color, **plot_kwargs) self._add_axis_labels() return self def _map_bivariate(self, func, indices, **kwargs): """Draw a bivariate plot on the indicated axes.""" # This is a hack to handle the fact that new distribution plots don't add # their artists onto the axes. This is probably superior in general, but # we'll need a better way to handle it in the axisgrid functions. from .distributions import histplot, kdeplot if func is histplot or func is kdeplot: self._extract_legend_handles = True kws = kwargs.copy() # Use copy as we insert other kwargs for i, j in indices: x_var = self.x_vars[j] y_var = self.y_vars[i] ax = self.axes[i, j] if ax is None: # i.e. we are in corner mode continue self._plot_bivariate(x_var, y_var, ax, func, **kws) self._add_axis_labels() if "hue" in signature(func).parameters: self.hue_names = list(self._legend_data) def _plot_bivariate(self, x_var, y_var, ax, func, **kwargs): """Draw a bivariate plot on the specified axes.""" if "hue" not in signature(func).parameters: self._plot_bivariate_iter_hue(x_var, y_var, ax, func, **kwargs) return kwargs = kwargs.copy() if str(func.__module__).startswith("seaborn"): kwargs["ax"] = ax else: plt.sca(ax) if x_var == y_var: axes_vars = [x_var] else: axes_vars = [x_var, y_var] if self._hue_var is not None and self._hue_var not in axes_vars: axes_vars.append(self._hue_var) data = self.data[axes_vars] if self._dropna: data = data.dropna() x = data[x_var] y = data[y_var] if self._hue_var is None: hue = None else: hue = data.get(self._hue_var) kwargs.setdefault("hue", hue) kwargs.setdefault("hue_order", self._hue_order) kwargs.setdefault("palette", self._orig_palette) func(x=x, y=y, **kwargs) self._update_legend_data(ax) def _plot_bivariate_iter_hue(self, x_var, y_var, ax, func, **kwargs): """Draw a bivariate plot while iterating over hue subsets.""" kwargs = kwargs.copy() if str(func.__module__).startswith("seaborn"): kwargs["ax"] = ax else: plt.sca(ax) if x_var == y_var: axes_vars = [x_var] else: axes_vars = [x_var, y_var] hue_grouped = self.data.groupby(self.hue_vals) for k, label_k in enumerate(self._hue_order): kws = kwargs.copy() # Attempt to get data for this level, allowing for empty try: data_k = hue_grouped.get_group(label_k) except KeyError: data_k = pd.DataFrame(columns=axes_vars, dtype=float) if self._dropna: data_k = data_k[axes_vars].dropna() x = data_k[x_var] y = data_k[y_var] for kw, val_list in self.hue_kws.items(): kws[kw] = val_list[k] kws.setdefault("color", self.palette[k]) if self._hue_var is not None: kws["label"] = label_k if str(func.__module__).startswith("seaborn"): func(x=x, y=y, **kws) else: func(x, y, **kws) self._update_legend_data(ax) def _add_axis_labels(self): """Add labels to the left and bottom Axes.""" for ax, label in zip(self.axes[-1, :], self.x_vars): ax.set_xlabel(label) for ax, label in zip(self.axes[:, 0], self.y_vars): ax.set_ylabel(label) if self._corner: self.axes[0, 0].set_ylabel("") def _find_numeric_cols(self, data): """Find which variables in a DataFrame are numeric.""" numeric_cols = [] for col in data: if variable_type(data[col]) == "numeric": numeric_cols.append(col) return numeric_cols class JointGrid(_BaseGrid): """Grid for drawing a bivariate plot with marginal univariate plots. Many plots can be drawn by using the figure-level interface :func:`jointplot`. Use this class directly when you need more flexibility. """ @_deprecate_positional_args def __init__( self, *, x=None, y=None, data=None, height=6, ratio=5, space=.2, dropna=False, xlim=None, ylim=None, size=None, marginal_ticks=False, hue=None, palette=None, hue_order=None, hue_norm=None, ): # Handle deprecations if size is not None: height = size msg = ("The `size` parameter has been renamed to `height`; " "please update your code.") warnings.warn(msg, UserWarning) # Set up the subplot grid f = plt.figure(figsize=(height, height)) gs = plt.GridSpec(ratio + 1, ratio + 1) ax_joint = f.add_subplot(gs[1:, :-1]) ax_marg_x = f.add_subplot(gs[0, :-1], sharex=ax_joint) ax_marg_y = f.add_subplot(gs[1:, -1], sharey=ax_joint) self._figure = f self.ax_joint = ax_joint self.ax_marg_x = ax_marg_x self.ax_marg_y = ax_marg_y # Turn off tick visibility for the measure axis on the marginal plots plt.setp(ax_marg_x.get_xticklabels(), visible=False) plt.setp(ax_marg_y.get_yticklabels(), visible=False) plt.setp(ax_marg_x.get_xticklabels(minor=True), visible=False) plt.setp(ax_marg_y.get_yticklabels(minor=True), visible=False) # Turn off the ticks on the density axis for the marginal plots if not marginal_ticks: plt.setp(ax_marg_x.yaxis.get_majorticklines(), visible=False) plt.setp(ax_marg_x.yaxis.get_minorticklines(), visible=False) plt.setp(ax_marg_y.xaxis.get_majorticklines(), visible=False) plt.setp(ax_marg_y.xaxis.get_minorticklines(), visible=False) plt.setp(ax_marg_x.get_yticklabels(), visible=False) plt.setp(ax_marg_y.get_xticklabels(), visible=False) plt.setp(ax_marg_x.get_yticklabels(minor=True), visible=False) plt.setp(ax_marg_y.get_xticklabels(minor=True), visible=False) ax_marg_x.yaxis.grid(False) ax_marg_y.xaxis.grid(False) # Process the input variables p = VectorPlotter(data=data, variables=dict(x=x, y=y, hue=hue)) plot_data = p.plot_data.loc[:, p.plot_data.notna().any()] # Possibly drop NA if dropna: plot_data = plot_data.dropna() def get_var(var): vector = plot_data.get(var, None) if vector is not None: vector = vector.rename(p.variables.get(var, None)) return vector self.x = get_var("x") self.y = get_var("y") self.hue = get_var("hue") for axis in "xy": name = p.variables.get(axis, None) if name is not None: getattr(ax_joint, f"set_{axis}label")(name) if xlim is not None: ax_joint.set_xlim(xlim) if ylim is not None: ax_joint.set_ylim(ylim) # Store the semantic mapping parameters for axes-level functions self._hue_params = dict(palette=palette, hue_order=hue_order, hue_norm=hue_norm) # Make the grid look nice utils.despine(f) if not marginal_ticks: utils.despine(ax=ax_marg_x, left=True) utils.despine(ax=ax_marg_y, bottom=True) for axes in [ax_marg_x, ax_marg_y]: for axis in [axes.xaxis, axes.yaxis]: axis.label.set_visible(False) f.tight_layout() f.subplots_adjust(hspace=space, wspace=space) def _inject_kwargs(self, func, kws, params): """Add params to kws if they are accepted by func.""" func_params = signature(func).parameters for key, val in params.items(): if key in func_params: kws.setdefault(key, val) def plot(self, joint_func, marginal_func, **kwargs): """Draw the plot by passing functions for joint and marginal axes. This method passes the ``kwargs`` dictionary to both functions. If you need more control, call :meth:`JointGrid.plot_joint` and :meth:`JointGrid.plot_marginals` directly with specific parameters. Parameters ---------- joint_func, marginal_func : callables Functions to draw the bivariate and univariate plots. See methods referenced above for information about the required characteristics of these functions. kwargs Additional keyword arguments are passed to both functions. Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. """ self.plot_marginals(marginal_func, **kwargs) self.plot_joint(joint_func, **kwargs) return self def plot_joint(self, func, **kwargs): """Draw a bivariate plot on the joint axes of the grid. Parameters ---------- func : plotting callable If a seaborn function, it should accept ``x`` and ``y``. Otherwise, it must accept ``x`` and ``y`` vectors of data as the first two positional arguments, and it must plot on the "current" axes. If ``hue`` was defined in the class constructor, the function must accept ``hue`` as a parameter. kwargs Keyword argument are passed to the plotting function. Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. """ kwargs = kwargs.copy() if str(func.__module__).startswith("seaborn"): kwargs["ax"] = self.ax_joint else: plt.sca(self.ax_joint) if self.hue is not None: kwargs["hue"] = self.hue self._inject_kwargs(func, kwargs, self._hue_params) if str(func.__module__).startswith("seaborn"): func(x=self.x, y=self.y, **kwargs) else: func(self.x, self.y, **kwargs) return self def plot_marginals(self, func, **kwargs): """Draw univariate plots on each marginal axes. Parameters ---------- func : plotting callable If a seaborn function, it should accept ``x`` and ``y`` and plot when only one of them is defined. Otherwise, it must accept a vector of data as the first positional argument and determine its orientation using the ``vertical`` parameter, and it must plot on the "current" axes. If ``hue`` was defined in the class constructor, it must accept ``hue`` as a parameter. kwargs Keyword argument are passed to the plotting function. Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. """ seaborn_func = ( str(func.__module__).startswith("seaborn") # deprecated distplot has a legacy API, special case it and not func.__name__ == "distplot" ) func_params = signature(func).parameters kwargs = kwargs.copy() if self.hue is not None: kwargs["hue"] = self.hue self._inject_kwargs(func, kwargs, self._hue_params) if "legend" in func_params: kwargs.setdefault("legend", False) if "orientation" in func_params: # e.g. plt.hist orient_kw_x = {"orientation": "vertical"} orient_kw_y = {"orientation": "horizontal"} elif "vertical" in func_params: # e.g. sns.distplot (also how did this get backwards?) orient_kw_x = {"vertical": False} orient_kw_y = {"vertical": True} if seaborn_func: func(x=self.x, ax=self.ax_marg_x, **kwargs) else: plt.sca(self.ax_marg_x) func(self.x, **orient_kw_x, **kwargs) if seaborn_func: func(y=self.y, ax=self.ax_marg_y, **kwargs) else: plt.sca(self.ax_marg_y) func(self.y, **orient_kw_y, **kwargs) self.ax_marg_x.yaxis.get_label().set_visible(False) self.ax_marg_y.xaxis.get_label().set_visible(False) return self def refline( self, *, x=None, y=None, joint=True, marginal=True, color='.5', linestyle='--', **line_kws ): """Add a reference line(s) to joint and/or marginal axes. Parameters ---------- x, y : numeric Value(s) to draw the line(s) at. joint, marginal : bools Whether to add the reference line(s) to the joint/marginal axes. color : :mod:`matplotlib color <matplotlib.colors>` Specifies the color of the reference line(s). linestyle : str Specifies the style of the reference line(s). line_kws : key, value mappings Other keyword arguments are passed to :meth:`matplotlib.axes.Axes.axvline` when ``x`` is not None and :meth:`matplotlib.axes.Axes.axhline` when ``y`` is not None. Returns ------- :class:`JointGrid` instance<|fim▁hole|> """ line_kws['color'] = color line_kws['linestyle'] = linestyle if x is not None: if joint: self.ax_joint.axvline(x, **line_kws) if marginal: self.ax_marg_x.axvline(x, **line_kws) if y is not None: if joint: self.ax_joint.axhline(y, **line_kws) if marginal: self.ax_marg_y.axhline(y, **line_kws) return self def set_axis_labels(self, xlabel="", ylabel="", **kwargs): """Set axis labels on the bivariate axes. Parameters ---------- xlabel, ylabel : strings Label names for the x and y variables. kwargs : key, value mappings Other keyword arguments are passed to the following functions: - :meth:`matplotlib.axes.Axes.set_xlabel` - :meth:`matplotlib.axes.Axes.set_ylabel` Returns ------- :class:`JointGrid` instance Returns ``self`` for easy method chaining. """ self.ax_joint.set_xlabel(xlabel, **kwargs) self.ax_joint.set_ylabel(ylabel, **kwargs) return self JointGrid.__init__.__doc__ = """\ Set up the grid of subplots and store data internally for easy plotting. Parameters ---------- {params.core.xy} {params.core.data} height : number Size of each side of the figure in inches (it will be square). ratio : number Ratio of joint axes height to marginal axes height. space : number Space between the joint and marginal axes dropna : bool If True, remove missing observations before plotting. {{x, y}}lim : pairs of numbers Set axis limits to these values before plotting. marginal_ticks : bool If False, suppress ticks on the count/density axis of the marginal plots. {params.core.hue} Note: unlike in :class:`FacetGrid` or :class:`PairGrid`, the axes-level functions must support ``hue`` to use it in :class:`JointGrid`. {params.core.palette} {params.core.hue_order} {params.core.hue_norm} See Also -------- {seealso.jointplot} {seealso.pairgrid} {seealso.pairplot} Examples -------- .. include:: ../docstrings/JointGrid.rst """.format( params=_param_docs, returns=_core_docs["returns"], seealso=_core_docs["seealso"], ) @_deprecate_positional_args def pairplot( data, *, hue=None, hue_order=None, palette=None, vars=None, x_vars=None, y_vars=None, kind="scatter", diag_kind="auto", markers=None, height=2.5, aspect=1, corner=False, dropna=False, plot_kws=None, diag_kws=None, grid_kws=None, size=None, ): """Plot pairwise relationships in a dataset. By default, this function will create a grid of Axes such that each numeric variable in ``data`` will by shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots are treated differently: a univariate distribution plot is drawn to show the marginal distribution of the data in each column. It is also possible to show a subset of variables or plot different variables on the rows and columns. This is a high-level interface for :class:`PairGrid` that is intended to make it easy to draw a few common styles. You should use :class:`PairGrid` directly if you need more flexibility. Parameters ---------- data : `pandas.DataFrame` Tidy (long-form) dataframe where each column is a variable and each row is an observation. hue : name of variable in ``data`` Variable in ``data`` to map plot aspects to different colors. hue_order : list of strings Order for the levels of the hue variable in the palette palette : dict or seaborn color palette Set of colors for mapping the ``hue`` variable. If a dict, keys should be values in the ``hue`` variable. vars : list of variable names Variables within ``data`` to use, otherwise use every column with a numeric datatype. {x, y}_vars : lists of variable names Variables within ``data`` to use separately for the rows and columns of the figure; i.e. to make a non-square plot. kind : {'scatter', 'kde', 'hist', 'reg'} Kind of plot to make. diag_kind : {'auto', 'hist', 'kde', None} Kind of plot for the diagonal subplots. If 'auto', choose based on whether or not ``hue`` is used. markers : single matplotlib marker code or list Either the marker to use for all scatterplot points or a list of markers with a length the same as the number of levels in the hue variable so that differently colored points will also have different scatterplot markers. height : scalar Height (in inches) of each facet. aspect : scalar Aspect * height gives the width (in inches) of each facet. corner : bool If True, don't add axes to the upper (off-diagonal) triangle of the grid, making this a "corner" plot. dropna : boolean Drop missing values from the data before plotting. {plot, diag, grid}_kws : dicts Dictionaries of keyword arguments. ``plot_kws`` are passed to the bivariate plotting function, ``diag_kws`` are passed to the univariate plotting function, and ``grid_kws`` are passed to the :class:`PairGrid` constructor. Returns ------- grid : :class:`PairGrid` Returns the underlying :class:`PairGrid` instance for further tweaking. See Also -------- PairGrid : Subplot grid for more flexible plotting of pairwise relationships. JointGrid : Grid for plotting joint and marginal distributions of two variables. Examples -------- .. include:: ../docstrings/pairplot.rst """ # Avoid circular import from .distributions import histplot, kdeplot # Handle deprecations if size is not None: height = size msg = ("The `size` parameter has been renamed to `height`; " "please update your code.") warnings.warn(msg, UserWarning) if not isinstance(data, pd.DataFrame): raise TypeError( "'data' must be pandas DataFrame object, not: {typefound}".format( typefound=type(data))) plot_kws = {} if plot_kws is None else plot_kws.copy() diag_kws = {} if diag_kws is None else diag_kws.copy() grid_kws = {} if grid_kws is None else grid_kws.copy() # Resolve "auto" diag kind if diag_kind == "auto": if hue is None: diag_kind = "kde" if kind == "kde" else "hist" else: diag_kind = "hist" if kind == "hist" else "kde" # Set up the PairGrid grid_kws.setdefault("diag_sharey", diag_kind == "hist") grid = PairGrid(data, vars=vars, x_vars=x_vars, y_vars=y_vars, hue=hue, hue_order=hue_order, palette=palette, corner=corner, height=height, aspect=aspect, dropna=dropna, **grid_kws) # Add the markers here as PairGrid has figured out how many levels of the # hue variable are needed and we don't want to duplicate that process if markers is not None: if kind == "reg": # Needed until regplot supports style if grid.hue_names is None: n_markers = 1 else: n_markers = len(grid.hue_names) if not isinstance(markers, list): markers = [markers] * n_markers if len(markers) != n_markers: raise ValueError(("markers must be a singleton or a list of " "markers for each level of the hue variable")) grid.hue_kws = {"marker": markers} elif kind == "scatter": if isinstance(markers, str): plot_kws["marker"] = markers elif hue is not None: plot_kws["style"] = data[hue] plot_kws["markers"] = markers # Draw the marginal plots on the diagonal diag_kws = diag_kws.copy() diag_kws.setdefault("legend", False) if diag_kind == "hist": grid.map_diag(histplot, **diag_kws) elif diag_kind == "kde": diag_kws.setdefault("fill", True) diag_kws.setdefault("warn_singular", False) grid.map_diag(kdeplot, **diag_kws) # Maybe plot on the off-diagonals if diag_kind is not None: plotter = grid.map_offdiag else: plotter = grid.map if kind == "scatter": from .relational import scatterplot # Avoid circular import plotter(scatterplot, **plot_kws) elif kind == "reg": from .regression import regplot # Avoid circular import plotter(regplot, **plot_kws) elif kind == "kde": from .distributions import kdeplot # Avoid circular import plot_kws.setdefault("warn_singular", False) plotter(kdeplot, **plot_kws) elif kind == "hist": from .distributions import histplot # Avoid circular import plotter(histplot, **plot_kws) # Add a legend if hue is not None: grid.add_legend() grid.tight_layout() return grid @_deprecate_positional_args def jointplot( *, x=None, y=None, data=None, kind="scatter", color=None, height=6, ratio=5, space=.2, dropna=False, xlim=None, ylim=None, marginal_ticks=False, joint_kws=None, marginal_kws=None, hue=None, palette=None, hue_order=None, hue_norm=None, **kwargs ): # Avoid circular imports from .relational import scatterplot from .regression import regplot, residplot from .distributions import histplot, kdeplot, _freedman_diaconis_bins # Handle deprecations if "size" in kwargs: height = kwargs.pop("size") msg = ("The `size` parameter has been renamed to `height`; " "please update your code.") warnings.warn(msg, UserWarning) # Set up empty default kwarg dicts joint_kws = {} if joint_kws is None else joint_kws.copy() joint_kws.update(kwargs) marginal_kws = {} if marginal_kws is None else marginal_kws.copy() # Handle deprecations of distplot-specific kwargs distplot_keys = [ "rug", "fit", "hist_kws", "norm_hist" "hist_kws", "rug_kws", ] unused_keys = [] for key in distplot_keys: if key in marginal_kws: unused_keys.append(key) marginal_kws.pop(key) if unused_keys and kind != "kde": msg = ( "The marginal plotting function has changed to `histplot`," " which does not accept the following argument(s): {}." ).format(", ".join(unused_keys)) warnings.warn(msg, UserWarning) # Validate the plot kind plot_kinds = ["scatter", "hist", "hex", "kde", "reg", "resid"] _check_argument("kind", plot_kinds, kind) # Raise early if using `hue` with a kind that does not support it if hue is not None and kind in ["hex", "reg", "resid"]: msg = ( f"Use of `hue` with `kind='{kind}'` is not currently supported." ) raise ValueError(msg) # Make a colormap based off the plot color # (Currently used only for kind="hex") if color is None: color = "C0" color_rgb = mpl.colors.colorConverter.to_rgb(color) colors = [utils.set_hls_values(color_rgb, l=l) # noqa for l in np.linspace(1, 0, 12)] cmap = blend_palette(colors, as_cmap=True) # Matplotlib's hexbin plot is not na-robust if kind == "hex": dropna = True # Initialize the JointGrid object grid = JointGrid( data=data, x=x, y=y, hue=hue, palette=palette, hue_order=hue_order, hue_norm=hue_norm, dropna=dropna, height=height, ratio=ratio, space=space, xlim=xlim, ylim=ylim, marginal_ticks=marginal_ticks, ) if grid.hue is not None: marginal_kws.setdefault("legend", False) # Plot the data using the grid if kind.startswith("scatter"): joint_kws.setdefault("color", color) grid.plot_joint(scatterplot, **joint_kws) if grid.hue is None: marg_func = histplot else: marg_func = kdeplot marginal_kws.setdefault("warn_singular", False) marginal_kws.setdefault("fill", True) marginal_kws.setdefault("color", color) grid.plot_marginals(marg_func, **marginal_kws) elif kind.startswith("hist"): # TODO process pair parameters for bins, etc. and pass # to both jount and marginal plots joint_kws.setdefault("color", color) grid.plot_joint(histplot, **joint_kws) marginal_kws.setdefault("kde", False) marginal_kws.setdefault("color", color) marg_x_kws = marginal_kws.copy() marg_y_kws = marginal_kws.copy() pair_keys = "bins", "binwidth", "binrange" for key in pair_keys: if isinstance(joint_kws.get(key), tuple): x_val, y_val = joint_kws[key] marg_x_kws.setdefault(key, x_val) marg_y_kws.setdefault(key, y_val) histplot(data=data, x=x, hue=hue, **marg_x_kws, ax=grid.ax_marg_x) histplot(data=data, y=y, hue=hue, **marg_y_kws, ax=grid.ax_marg_y) elif kind.startswith("kde"): joint_kws.setdefault("color", color) joint_kws.setdefault("warn_singular", False) grid.plot_joint(kdeplot, **joint_kws) marginal_kws.setdefault("color", color) if "fill" in joint_kws: marginal_kws.setdefault("fill", joint_kws["fill"]) grid.plot_marginals(kdeplot, **marginal_kws) elif kind.startswith("hex"): x_bins = min(_freedman_diaconis_bins(grid.x), 50) y_bins = min(_freedman_diaconis_bins(grid.y), 50) gridsize = int(np.mean([x_bins, y_bins])) joint_kws.setdefault("gridsize", gridsize) joint_kws.setdefault("cmap", cmap) grid.plot_joint(plt.hexbin, **joint_kws) marginal_kws.setdefault("kde", False) marginal_kws.setdefault("color", color) grid.plot_marginals(histplot, **marginal_kws) elif kind.startswith("reg"): marginal_kws.setdefault("color", color) marginal_kws.setdefault("kde", True) grid.plot_marginals(histplot, **marginal_kws) joint_kws.setdefault("color", color) grid.plot_joint(regplot, **joint_kws) elif kind.startswith("resid"): joint_kws.setdefault("color", color) grid.plot_joint(residplot, **joint_kws) x, y = grid.ax_joint.collections[0].get_offsets().T marginal_kws.setdefault("color", color) histplot(x=x, hue=hue, ax=grid.ax_marg_x, **marginal_kws) histplot(y=y, hue=hue, ax=grid.ax_marg_y, **marginal_kws) return grid jointplot.__doc__ = """\ Draw a plot of two variables with bivariate and univariate graphs. This function provides a convenient interface to the :class:`JointGrid` class, with several canned plot kinds. This is intended to be a fairly lightweight wrapper; if you need more flexibility, you should use :class:`JointGrid` directly. Parameters ---------- {params.core.xy} {params.core.data} kind : {{ "scatter" | "kde" | "hist" | "hex" | "reg" | "resid" }} Kind of plot to draw. See the examples for references to the underlying functions. {params.core.color} height : numeric Size of the figure (it will be square). ratio : numeric Ratio of joint axes height to marginal axes height. space : numeric Space between the joint and marginal axes dropna : bool If True, remove observations that are missing from ``x`` and ``y``. {{x, y}}lim : pairs of numbers Axis limits to set before plotting. marginal_ticks : bool If False, suppress ticks on the count/density axis of the marginal plots. {{joint, marginal}}_kws : dicts Additional keyword arguments for the plot components. {params.core.hue} Semantic variable that is mapped to determine the color of plot elements. {params.core.palette} {params.core.hue_order} {params.core.hue_norm} kwargs Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the ``joint_kws`` dictionary. Returns ------- {returns.jointgrid} See Also -------- {seealso.jointgrid} {seealso.pairgrid} {seealso.pairplot} Examples -------- .. include:: ../docstrings/jointplot.rst """.format( params=_param_docs, returns=_core_docs["returns"], seealso=_core_docs["seealso"], )<|fim▁end|>
Returns ``self`` for easy method chaining.
<|file_name|>CommandParser.java<|end_file_name|><|fim▁begin|>package seedu.ezdo.logic.parser; <|fim▁hole|> /** * An interface for the command parsers in ezDo. */ public interface CommandParser { /** Parses the given string */ Command parse(String args); }<|fim▁end|>
import seedu.ezdo.logic.commands.Command;
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # from distutils.core import setup from spacewalk.common.rhnConfig import CFG, initCFG initCFG('web') setup(name = "rhnclient", version = "5.5.9", description = CFG.PRODUCT_NAME + " Client Utilities and Libraries", long_description = CFG.PRODUCT_NAME + """\<|fim▁hole|> Client Utilities Includes: rhn_check, action handler, and modules to allow client packages to communicate with RHN.""", author = 'Joel Martin', author_email = '[email protected]', url = 'http://rhn.redhat.com', packages = ["rhn.actions", "rhn.client"], license = "GPL", )<|fim▁end|>
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box; use schemes::{Result, KScheme, Resource, Url}; use syscall::{Error, O_CREAT, ENOENT}; pub use self::dsdt::DSDT; pub use self::fadt::FADT; pub use self::madt::MADT; pub use self::rsdt::RSDT; pub use self::sdt::SDTHeader; pub use self::ssdt::SSDT; pub mod aml; pub mod dsdt; pub mod fadt; pub mod madt; pub mod rsdt; pub mod sdt; pub mod ssdt; #[derive(Clone, Debug, Default)] pub struct Acpi { rsdt: RSDT, fadt: Option<FADT>, dsdt: Option<DSDT>, ssdt: Option<SSDT>, madt: Option<MADT>, } impl Acpi { pub fn new() -> Option<Box<Self>> { match RSDT::new() { Ok(rsdt) => { // debugln!("{:#?}", rsdt);<|fim▁hole|> dsdt: None, ssdt: None, madt: None, }; for addr in acpi.rsdt.addrs.iter() { let header = unsafe { &*(*addr as *const SDTHeader) }; if let Some(fadt) = FADT::new(header) { // Why does this hang? debugln!("{:#?}", fadt); if let Some(dsdt) = DSDT::new(unsafe { &*(fadt.dsdt as *const SDTHeader) }) { // debugln!("DSDT:"); // aml::parse(dsdt.data); acpi.dsdt = Some(dsdt); } acpi.fadt = Some(fadt); } else if let Some(ssdt) = SSDT::new(header) { // debugln!("SSDT:"); // aml::parse(ssdt.data); acpi.ssdt = Some(ssdt); } else if let Some(madt) = MADT::new(header) { acpi.madt = Some(madt); } else { for b in header.signature.iter() { debug!("{}", *b as char); } debugln!(": Unknown Table"); } } Some(acpi) } Err(e) => { debugln!("{}", e); None } } } } impl KScheme for Acpi { fn scheme(&self) -> &str { "acpi" } fn open(&mut self, url: &Url, flags: usize) -> Result<Box<Resource>> { if url.reference() == "off" && flags & O_CREAT == O_CREAT { match self.fadt { Some(fadt) => { debugln!("Powering Off"); unsafe { asm!("out dx, ax" : : "{edx}"(fadt.pm1a_control_block), "{ax}"(0 | 1 << 13) : : "intel", "volatile") }; } None => { debugln!("Unable to power off: No FADT"); } } } Err(Error::new(ENOENT)) } }<|fim▁end|>
let mut acpi = box Acpi { rsdt: rsdt, fadt: None,
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.conf import settings from django.contrib.comments.managers import CommentManager from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.core import urlresolvers from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible COMMENT_MAX_LENGTH = getattr(settings, 'COMMENT_MAX_LENGTH', 3000) class BaseCommentAbstractModel(models.Model): """ An abstract base class that any custom comment models probably should subclass. """ # Content-object field content_type = models.ForeignKey(ContentType, verbose_name=_('content type'), related_name="content_type_set_for_%(class)s") object_pk = models.TextField(_('object ID')) content_object = generic.GenericForeignKey(ct_field="content_type", fk_field="object_pk") # Metadata about the comment site = models.ForeignKey(Site) class Meta: abstract = True def get_content_object_url(self): """ Get a URL suitable for redirecting to the content object. """ return urlresolvers.reverse( "comments-url-redirect", args=(self.content_type_id, self.object_pk) ) @python_2_unicode_compatible class Comment(BaseCommentAbstractModel): """ A user comment about some object. """ # Who posted this comment? If ``user`` is set then it was an authenticated # user; otherwise at least user_name should have been set and the comment # was posted by a non-authenticated user. user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'), blank=True, null=True, related_name="%(class)s_comments") user_name = models.CharField(_("user's name"), max_length=50, blank=True) user_email = models.EmailField(_("user's email address"), blank=True) user_url = models.URLField(_("user's URL"), blank=True) comment = models.TextField(_('comment'), max_length=COMMENT_MAX_LENGTH) # Metadata about the comment submit_date = models.DateTimeField(_('date/time submitted'), default=None) ip_address = models.IPAddressField(_('IP address'), blank=True, null=True) is_public = models.BooleanField(_('is public'), default=True, help_text=_('Uncheck this box to make the comment effectively ' \ 'disappear from the site.')) is_removed = models.BooleanField(_('is removed'), default=False, help_text=_('Check this box if the comment is inappropriate. ' \ 'A "This comment has been removed" message will ' \ 'be displayed instead.')) # Manager objects = CommentManager() class Meta: db_table = "django_comments" ordering = ('submit_date',) permissions = [("can_moderate", "Can moderate comments")] verbose_name = _('comment') verbose_name_plural = _('comments') def __str__(self): return "%s: %s..." % (self.name, self.comment[:50]) def save(self, *args, **kwargs): if self.submit_date is None: self.submit_date = timezone.now() super(Comment, self).save(*args, **kwargs) def _get_userinfo(self): """ Get a dictionary that pulls together information about the poster safely for both authenticated and non-authenticated comments. This dict will have ``name``, ``email``, and ``url`` fields. """ if not hasattr(self, "_userinfo"): userinfo = { "name" : self.user_name, "email" : self.user_email, "url" : self.user_url } if self.user_id: u = self.user if u.email: userinfo["email"] = u.email # If the user has a full name, use that for the user name. # However, a given user_name overrides the raw user.username, # so only use that if this comment has no associated name. if u.get_full_name(): userinfo["name"] = self.user.get_full_name() elif not self.user_name: userinfo["name"] = u.username self._userinfo = userinfo return self._userinfo userinfo = property(_get_userinfo, doc=_get_userinfo.__doc__) def _get_name(self): return self.userinfo["name"] def _set_name(self, val): if self.user_id: raise AttributeError(_("This comment was posted by an authenticated "\ "user and thus the name is read-only.")) self.user_name = val name = property(_get_name, _set_name, doc="The name of the user who posted this comment") def _get_email(self): return self.userinfo["email"] def _set_email(self, val): if self.user_id: raise AttributeError(_("This comment was posted by an authenticated "\ "user and thus the email is read-only.")) self.user_email = val email = property(_get_email, _set_email, doc="The email of the user who posted this comment") def _get_url(self): return self.userinfo["url"] def _set_url(self, val): self.user_url = val url = property(_get_url, _set_url, doc="The URL given by the user who posted this comment") def get_absolute_url(self, anchor_pattern="#c%(id)s"): return self.get_content_object_url() + (anchor_pattern % self.__dict__) def get_as_text(self): """ Return this comment as plain text. Useful for emails. """ d = { 'user': self.user or self.name, 'date': self.submit_date, 'comment': self.comment, 'domain': self.site.domain, 'url': self.get_absolute_url() } return _('Posted by %(user)s at %(date)s\n\n%(comment)s\n\nhttp://%(domain)s%(url)s') % d @python_2_unicode_compatible class CommentFlag(models.Model): """ Records a flag on a comment. This is intentionally flexible; right now, a flag could be: * A "removal suggestion" -- where a user suggests a comment for (potential) removal. * A "moderator deletion" -- used when a moderator deletes a comment. You can (ab)use this model to add other flags, if needed. However, by design users are only allowed to flag a comment with a given flag once; if you want rating look elsewhere. """ user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'), related_name="comment_flags") comment = models.ForeignKey(Comment, verbose_name=_('comment'), related_name="flags") flag = models.CharField(_('flag'), max_length=30, db_index=True) flag_date = models.DateTimeField(_('date'), default=None) # Constants for flag types SUGGEST_REMOVAL = "removal suggestion" MODERATOR_DELETION = "moderator deletion" MODERATOR_APPROVAL = "moderator approval" class Meta: db_table = 'django_comment_flags' unique_together = [('user', 'comment', 'flag')] verbose_name = _('comment flag') verbose_name_plural = _('comment flags') def __str__(self): return "%s flag of comment ID %s by %s" % \ (self.flag, self.comment_id, self.user.username)<|fim▁hole|> super(CommentFlag, self).save(*args, **kwargs)<|fim▁end|>
def save(self, *args, **kwargs): if self.flag_date is None: self.flag_date = timezone.now()
<|file_name|>AlarmTrap.java<|end_file_name|><|fim▁begin|>/* * Pixel Dungeon * Copyright (C) 2012-2015 Oleg Dolya * * Yet Another Pixel Dungeon * Copyright (C) 2015-2016 Considered Hamster * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ package com.consideredhamster.yetanotherpixeldungeon.levels.traps; import com.consideredhamster.yetanotherpixeldungeon.actors.Actor; import com.consideredhamster.yetanotherpixeldungeon.actors.Char;<|fim▁hole|>import com.watabou.noosa.audio.Sample; import com.consideredhamster.yetanotherpixeldungeon.visuals.Assets; import com.consideredhamster.yetanotherpixeldungeon.Dungeon; import com.consideredhamster.yetanotherpixeldungeon.actors.mobs.Mob; import com.consideredhamster.yetanotherpixeldungeon.visuals.effects.CellEmitter; import com.consideredhamster.yetanotherpixeldungeon.visuals.effects.Speck; import com.consideredhamster.yetanotherpixeldungeon.misc.utils.GLog; public class AlarmTrap extends Trap { // 0xDD3333 public static void trigger( int pos, Char ch ) { for (Mob mob : Dungeon.level.mobs) { if (mob.pos != pos) { mob.beckon( pos ); } } if (Dungeon.visible[pos]) { GLog.w( "The trap emits a piercing sound that echoes throughout the dungeon!" ); CellEmitter.center( pos ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); } Sample.INSTANCE.play( Assets.SND_ALERT ); } }<|fim▁end|>
<|file_name|>routefilterrules.go<|end_file_name|><|fim▁begin|>package network // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) // RouteFilterRulesClient is the network Client type RouteFilterRulesClient struct { BaseClient } // NewRouteFilterRulesClient creates an instance of the RouteFilterRulesClient client. func NewRouteFilterRulesClient(subscriptionID string) RouteFilterRulesClient { return NewRouteFilterRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewRouteFilterRulesClientWithBaseURI creates an instance of the RouteFilterRulesClient client. func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) RouteFilterRulesClient { return RouteFilterRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates or updates a route in the specified route filter. // Parameters: // resourceGroupName - the name of the resource group. // routeFilterName - the name of the route filter. // ruleName - the name of the route filter rule. // routeFilterRuleParameters - parameters supplied to the create or update route filter rule operation. func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.CreateOrUpdate") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } if err := validation.Validate([]validation.Validation{ {TargetValue: routeFilterRuleParameters, Constraints: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.RouteFilterRuleType", Name: validation.Null, Rule: true, Chain: nil}, {Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.Communities", Name: validation.Null, Rule: true, Chain: nil}, }}}}}); err != nil { return result, validation.NewError("network.RouteFilterRulesClient", "CreateOrUpdate", err.Error()) } req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", nil, "Failure preparing request") return } result, err = client.CreateOrUpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "routeFilterName": autorest.Encode("path", routeFilterName), "ruleName": autorest.Encode("path", ruleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } routeFilterRuleParameters.Etag = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithJSON(routeFilterRuleParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (future RouteFilterRulesCreateOrUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // Delete deletes the specified rule from a route filter. // Parameters: // resourceGroupName - the name of the resource group. // routeFilterName - the name of the route filter. // ruleName - the name of the rule. func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Delete") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", nil, "Failure preparing request") return } result, err = client.DeleteSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", result.Response(), "Failure sending request") return } return } // DeletePreparer prepares the Delete request. func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "routeFilterName": autorest.Encode("path", routeFilterName), "ruleName": autorest.Encode("path", ruleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future RouteFilterRulesDeleteFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return } // Get gets the specified rule from a route filter. // Parameters: // resourceGroupName - the name of the resource group. // routeFilterName - the name of the route filter. // ruleName - the name of the rule. func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Get") defer func() { sc := -1 if result.Response.Response != nil { sc = result.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "routeFilterName": autorest.Encode("path", routeFilterName), "ruleName": autorest.Encode("path", ruleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client RouteFilterRulesClient) GetSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // ListByRouteFilter gets all RouteFilterRules in a route filter. // Parameters: // resourceGroupName - the name of the resource group. // routeFilterName - the name of the route filter. func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") defer func() { sc := -1 if result.rfrlr.Response.Response != nil { sc = result.rfrlr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listByRouteFilterNextResults req, err := client.ListByRouteFilterPreparer(ctx, resourceGroupName, routeFilterName) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", nil, "Failure preparing request") return } resp, err := client.ListByRouteFilterSender(req) if err != nil { result.rfrlr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure sending request") return } result.rfrlr, err = client.ListByRouteFilterResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure responding to request") } return } // ListByRouteFilterPreparer prepares the ListByRouteFilter request. func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Context, resourceGroupName string, routeFilterName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "routeFilterName": autorest.Encode("path", routeFilterName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByRouteFilterSender sends the ListByRouteFilter request. The method will close the // http.Response Body if it receives an error. func (client RouteFilterRulesClient) ListByRouteFilterSender(req *http.Request) (*http.Response, error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) return autorest.SendWithSender(client, req, sd...) } // ListByRouteFilterResponder handles the response to the ListByRouteFilter request. The method always // closes the http.Response Body. func (client RouteFilterRulesClient) ListByRouteFilterResponder(resp *http.Response) (result RouteFilterRuleListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listByRouteFilterNextResults retrieves the next set of results, if any. func (client RouteFilterRulesClient) listByRouteFilterNextResults(ctx context.Context, lastResults RouteFilterRuleListResult) (result RouteFilterRuleListResult, err error) { req, err := lastResults.routeFilterRuleListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListByRouteFilterSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure sending next results request") } result, err = client.ListByRouteFilterResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure responding to next results request") } return } // ListByRouteFilterComplete enumerates all values, automatically crossing page boundaries as required. func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.ListByRouteFilter(ctx, resourceGroupName, routeFilterName) return } // Update updates a route in the specified route filter. // Parameters: // resourceGroupName - the name of the resource group. // routeFilterName - the name of the route filter. // ruleName - the name of the route filter rule. // routeFilterRuleParameters - parameters supplied to the update route filter rule operation. func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule) (result RouteFilterRulesUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Update") defer func() { sc := -1 if result.Response() != nil { sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() } req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Update", nil, "Failure preparing request") return } result, err = client.UpdateSender(req) if err != nil { err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Update", result.Response(), "Failure sending request") return } return } // UpdatePreparer prepares the Update request. func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "routeFilterName": autorest.Encode("path", routeFilterName), "ruleName": autorest.Encode("path", ruleName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } const APIVersion = "2019-04-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, }<|fim▁hole|> routeFilterRuleParameters.Name = nil routeFilterRuleParameters.Etag = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithJSON(routeFilterRuleParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future RouteFilterRulesUpdateFuture, err error) { sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) var resp *http.Response resp, err = autorest.SendWithSender(client, req, sd...) if err != nil { return } future.Future, err = azure.NewFutureFromResponse(resp) return } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. func (client RouteFilterRulesClient) UpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return }<|fim▁end|>
<|file_name|>iterable.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import inspect class Iterable: # Jinja2 wants to iterate over all properties; __dict__ doesn't return the @property ones def __iter__(self): for attr, value in inspect.getmembers(self): if not attr.startswith('_'):<|fim▁hole|><|fim▁end|>
yield attr, value
<|file_name|>lint_stability_fields.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(staged_api)] #![staged_api] #![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] pub struct Stable { #[stable(feature = "rust1", since = "1.0.0")] pub inherit: u8, // it's a lie (stable doesn't inherit) #[unstable(feature = "test_feature", issue = "0")] pub override1: u8, #[deprecated(since = "1.0.0")] #[unstable(feature = "test_feature", issue = "0")] pub override2: u8, } #[stable(feature = "rust1", since = "1.0.0")]<|fim▁hole|> #[deprecated(since = "1.0.0")] pub u8); #[unstable(feature = "test_feature", issue = "0")] pub struct Unstable { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, #[deprecated(since = "1.0.0")] #[unstable(feature = "test_feature", issue = "0")] pub override2: u8, } #[unstable(feature = "test_feature", issue = "0")] pub struct Unstable2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, #[unstable(feature = "test_feature", issue = "0")] #[deprecated(since = "1.0.0")] pub u8); #[unstable(feature = "test_feature", issue = "0")] #[deprecated(feature = "rust1", since = "1.0.0")] pub struct Deprecated { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, #[unstable(feature = "test_feature", issue = "0")] pub override2: u8, } #[unstable(feature = "test_feature", issue = "0")] #[deprecated(feature = "rust1", since = "1.0.0")] pub struct Deprecated2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, #[unstable(feature = "test_feature", issue = "0")] pub u8);<|fim▁end|>
pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8, #[unstable(feature = "test_feature", issue = "0")] pub u8, #[unstable(feature = "test_feature", issue = "0")]
<|file_name|>gak_spider.py<|end_file_name|><|fim▁begin|>from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.url import urljoin_rfc from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader class GakSpider(BaseSpider): name = 'gak.co.uk' allowed_domains = ['gak.co.uk'] start_urls = ['http://www.gak.co.uk/'] def parse(self, response): hxs = HtmlXPathSelector(response) relative_urls = hxs.select('//div[@class="tabs_menu"]/ul/li/a/@href').extract() for relative_url in relative_urls: url = urljoin_rfc('http://www.gak.co.uk/', relative_url, response.encoding) yield Request(url, callback=self.parse_products) <|fim▁hole|> def parse_products(self, response): hxs = HtmlXPathSelector(response) products = hxs.select('//div[@class="snapshot"]') for product in products: loader = ProductLoader(item=Product(), selector=product) loader.add_xpath('name', 'div/a/text()') relative_url = product.select('div[@class="dsc"]/a/@href').extract()[0] url = urljoin_rfc('http://www.gak.co.uk/', relative_url, response.encoding) loader.add_value('url', url) price = 0.0 if product.select('div/div/span/text()'): price = product.select('div/div/span/text()').extract()[0] loader.add_value('price', price) yield loader.load_item()<|fim▁end|>
<|file_name|>AbstractCopyrightFilestoreFilter.java<|end_file_name|><|fim▁begin|>/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * The Apereo Foundation licenses this file to you under the Apache License, * Version 2.0, (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tle.web.copyright; import com.tle.beans.item.Item; import com.tle.beans.item.ItemId; import com.tle.beans.item.ItemKey; import com.tle.beans.item.attachments.Attachment; import com.tle.beans.item.attachments.IAttachment; import com.tle.core.activation.ActivationConstants; import com.tle.core.copyright.Holding; import com.tle.core.copyright.Portion; import com.tle.core.copyright.Section; import com.tle.core.copyright.service.AgreementStatus; import com.tle.core.copyright.service.CopyrightService; import com.tle.core.security.TLEAclManager; import com.tle.web.viewitem.FilestoreContentFilter; import com.tle.web.viewitem.FilestoreContentStream; import com.tle.web.viewurl.ViewAttachmentUrl; import com.tle.web.viewurl.ViewItemUrl; import com.tle.web.viewurl.ViewItemUrlFactory; import java.io.IOException; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public abstract class AbstractCopyrightFilestoreFilter< H extends Holding, P extends Portion, S extends Section> implements FilestoreContentFilter { private static final Log LOGGER = LogFactory.getLog(AbstractCopyrightFilestoreFilter.class); @Inject private ViewItemUrlFactory urlFactory; @Inject private TLEAclManager aclService; @Override public FilestoreContentStream filter( FilestoreContentStream contentStream, HttpServletRequest request, HttpServletResponse response) throws IOException { String filepath = contentStream.getFilepath(); ItemKey itemKey = contentStream.getItemId(); CopyrightService<H, P, S> copyrightService = getCopyrightService(); ItemId itemId = ItemId.fromKey(itemKey); Item item = copyrightService.getCopyrightedItem(itemId); if (item != null) { Attachment attachment = copyrightService.getSectionAttachmentForFilepath(item, filepath); if (attachment == null) { return contentStream; } AgreementStatus status; try { status = copyrightService.getAgreementStatus(item, attachment); } catch (IllegalStateException bad) { LOGGER.error("Error getting AgreementStatus", bad); // $NON-NLS-1$ return contentStream; } if (status.isInactive() && aclService .filterNonGrantedPrivileges(ActivationConstants.VIEW_INACTIVE_PORTIONS) .isEmpty()) { throw copyrightService.createViolation(item); } <|fim▁hole|> if (status.isNeedsAgreement()) { // FIXME: This creates /items/ urls, what if they came from // /integ/ ? ViewItemUrl vurl = urlFactory.createFullItemUrl(itemKey); vurl.add(new ViewAttachmentUrl(attachment.getUuid())); response.sendRedirect(vurl.getHref()); return null; } } return contentStream; } @Override public boolean canView(Item i, IAttachment attach) { CopyrightService<H, P, S> copyrightService = getCopyrightService(); Item item = copyrightService.getCopyrightedItem(i.getItemId()); if (item != null) { AgreementStatus status; try { status = copyrightService.getAgreementStatus(item, attach); } catch (IllegalStateException bad) { return false; } if (status.isNeedsAgreement()) { return false; } } return true; } protected abstract CopyrightService<H, P, S> getCopyrightService(); }<|fim▁end|>
<|file_name|>Card.tsx<|end_file_name|><|fim▁begin|>import { forwardRef, useImperativeHandle, useRef } from 'react' import { ConnectDropTarget, ConnectDragSource, DropTargetMonitor, DragSourceMonitor, } from 'react-dnd' import { DragSource, DropTarget, DropTargetConnector, DragSourceConnector, } from 'react-dnd' import { ItemTypes } from './ItemTypes' import { XYCoord } from 'dnd-core' import { CardDragObject } from './ItemTypes' const style = { border: '1px dashed gray', padding: '0.5rem 1rem', marginBottom: '.5rem', backgroundColor: 'white', cursor: 'move', } export interface CardProps { id: any text: string index: number moveCard: (dragIndex: number, hoverIndex: number) => void isDragging: boolean connectDragSource: ConnectDragSource connectDropTarget: ConnectDropTarget } interface CardInstance { getNode(): HTMLDivElement | null } const Card = forwardRef<HTMLDivElement, CardProps>(function Card( { text, isDragging, connectDragSource, connectDropTarget }, ref, ) { const elementRef = useRef(null) connectDragSource(elementRef) connectDropTarget(elementRef) const opacity = isDragging ? 0 : 1 useImperativeHandle<any, CardInstance>(ref, () => ({ getNode: () => elementRef.current, })) return ( <div ref={elementRef} style={{ ...style, opacity }}> {text} </div> ) }) export default DropTarget( ItemTypes.CARD, { hover( props: CardProps, monitor: DropTargetMonitor, component: CardInstance, ) { if (!component) { return null } // node = HTML Div element from imperative API const node = component.getNode() if (!node) { return null } const dragIndex = monitor.getItem<CardDragObject>().index const hoverIndex = props.index // Don't replace items with themselves if (dragIndex === hoverIndex) { return } // Determine rectangle on screen const hoverBoundingRect = node.getBoundingClientRect() // Get vertical middle const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2 // Determine mouse position const clientOffset = monitor.getClientOffset() // Get pixels to the top const hoverClientY = (clientOffset as XYCoord).y - hoverBoundingRect.top // Only perform the move when the mouse has crossed half of the items height // When dragging downwards, only move when the cursor is below 50% // When dragging upwards, only move when the cursor is above 50% // Dragging downwards if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) { return } // Dragging upwards if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) { return } // Time to actually perform the action props.moveCard(dragIndex, hoverIndex) // Note: we're mutating the monitor item here! // Generally it's better to avoid mutations, // but it's good here for the sake of performance // to avoid expensive index searches. monitor.getItem<CardDragObject>().index = hoverIndex }, }, (connect: DropTargetConnector) => ({ connectDropTarget: connect.dropTarget(), }), )( DragSource( ItemTypes.CARD, { beginDrag: (props: CardProps) => ({ id: props.id, index: props.index, }), }, (connect: DragSourceConnector, monitor: DragSourceMonitor) => ({ connectDragSource: connect.dragSource(),<|fim▁hole|> )(Card), )<|fim▁end|>
isDragging: monitor.isDragging(), }),
<|file_name|>series-column-coverage.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
version https://git-lfs.github.com/spec/v1 oid sha256:ad911cfe35ed2702a6023f24dac7e20b7b1d64e5583cd53411e87b5c10fa0c35 size 16080
<|file_name|>notfollow_flake8.py<|end_file_name|><|fim▁begin|># Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md x = { 'a':37,'b':42, 'c':927} y = 'hello ''world' z = 'hello '+'world' a = 'hello {}'.format('world') class foo ( object ): def f (self ): return 37*-+2 def g(self, x,y=42): return y<|fim▁hole|><|fim▁end|>
def f ( a ) : return 37+-+a[42-x : y**3]
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.views.decorators.csrf import csrf_exempt from django.contrib.auth import authenticate, login from django.contrib.auth import logout from django.contrib.auth.decorators import login_required import time from ControlUsuarios.forms import * from ControlUsuarios.models import UserProfile # Create your views here. from django.http import HttpResponse from django.http import JsonResponse from django.shortcuts import render from django.shortcuts import redirect from django import forms from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.views.generic.base import View from datetime import datetime from bson import Binary, Code from bson.json_util import dumps from bson.json_util import loads from clase import * gestorClase=ClaseDriver() @csrf_exempt def index(request): if request.method == 'GET': session_num=gestorClase.database.sesion.find({}).count() session_tag="default" if session_num>0: session_tag=gestorClase.database.sesion.find({}) lista=[] for i in session_tag: print i lista.append(i) print lista[0]["clave_sesion"] return render(request, 'ControlUsuarios/session_android.html',{"qr":lista[0]["clave_sesion"],"fecha":lista[0]["fecha_sesion"]}) #return render(request, 'registration/login.html',{}) @csrf_exempt def sesion(request): clase=gestorClase.database.clase.find() if request.method == 'POST': print "entrando por post" form = SessionForm(request.POST) if form.is_valid(): session_tag=form.data['session_tag'] print session_tag gestorClase.createSesion(session_tag) return render(request, 'ControlUsuarios/sessions.html',{'form': form,"qr":session_tag,"clase":clase} ) else: session_num=gestorClase.database.sesion.find({}).count() session_tag="default" if session_num>0: session_tag=gestorClase.database.sesion.find({}) lista=[] for i in session_tag: print i lista.append(i) print lista[0]["clave_sesion"] form=SessionForm() return render(request, 'ControlUsuarios/sessions.html',{'form': form,"qr":lista[0]["clave_sesion"],"clase":clase} ) class Preferencias(View): def get(self, request): print "Entrando por el get" form=FormEntrada() return render(request, 'ControlUsuarios/preferencias.html', {'form': form}) def post(self, request): print "Entrando por el post" reader_clase=None form = FormEntrada(request.POST, request.FILES) if form.is_valid(): fichero1=request.FILES.get('file_clase',None) if fichero1 is not None: fieldnames = ("NOMBRE","DNI") reader_clase = csv.DictReader(request.FILES['file_clase'], fieldnames) gestorClase.createClaseFromReader(reader_clase) return redirect('/Preferencias',{'form':form}) else: print "formulario invalido" #form = FormEntrada() return render(request, 'noinventory/Preferencias.html', {'form': form}) @csrf_exempt def borrarTodo(request): if request.method == 'GET': gestorClase.database.clase.remove() cl={"Alumnos": [{"NOMBRE": "Hugo Barzano Cruz","DNI": "77138361"}, {"NOMBRE": "Mariano Palomo Villafranca","DNI": "66666666z"}]} for i in cl["Alumnos"]: i["assitencia"]="False" print i gestorClase.database.clase.insert(i) aux3=[] respuesta={} lista_alumnos=gestorClase.database.clase.find({}) for a in lista_alumnos: print a["NOMBRE"] aux4={"NOMBRE":a["NOMBRE"],"DNI":a["DNI"],"assitencia":a["assitencia"]} aux3.append(aux4) respuesta={"alumnos":aux3} return JsonResponse(respuesta,safe=False) else: gestorClase.database.clase.remove() gestorClase.database.sesion.remove() default={"NOMBRE":"Nombre","DNI":"Dni","assitencia":"asistencia"} aux7=[] aux7.append(default) respuesta={"alumnos":aux7} return JsonResponse(respuesta,safe=False) @csrf_exempt def inicializarClase(request): if request.method == 'GET': gestorClase.database.clase.remove() cl={"Alumnos": [{"NOMBRE": "Hugo Barzano Cruz","DNI": "77138361"}, {"NOMBRE": "Mariano Palomo Villafranca","DNI": "66666666z"}]} for i in cl["Alumnos"]: i["assitencia"]="False" print i gestorClase.database.clase.insert(i) aux3=[] respuesta={} lista_alumnos=gestorClase.database.clase.find({}) for a in lista_alumnos: print a["NOMBRE"] aux4={"NOMBRE":a["NOMBRE"],"DNI":a["DNI"],"assitencia":a["assitencia"]} aux3.append(aux4) respuesta={"alumnos":aux3} return JsonResponse(respuesta,safe=False) else: gestorClase.database.clase.remove() cl={"Alumnos": [{"NOMBRE": "Hugo Barzano Cruz","DNI": "77138361"}, {"NOMBRE": "Mariano Palomo Villafranca","DNI": "66666666z"}]} for i in cl["Alumnos"]: i["assitencia"]="False" print i gestorClase.database.clase.insert(i) aux3=[] respuesta={} lista_alumnos=gestorClase.database.clase.find({}) for a in lista_alumnos: print a["NOMBRE"] aux4={"NOMBRE":a["NOMBRE"],"DNI":a["DNI"],"assitencia":a["assitencia"]} aux3.append(aux4) print respuesta respuesta={"alumnos":aux3} #return JsonResponse(respuesta,safe=False) return JsonResponse(respuesta,safe=False) @csrf_exempt def setClaveAndroid(request): if request.method == 'POST': mydic=dict(request.POST) print mydic["clave"][0] if mydic["clave"][0] == "": gestorClase.createSesion("default") else: gestorClase.createSesion(mydic["clave"][0]) return HttpResponse("Ok") @csrf_exempt def alumnosJson(request): if request.method == 'GET': default={"NOMBRE":"Nombre","DNI":"Dni","assitencia":"asistencia"} aux7=[] aux7.append(default) respuesta={"alumnos":aux7} aux=[] aux3=[] numero_alumnos=gestorClase.database.clase.find({}).count() if numero_alumnos>0: lista_alumnos=gestorClase.database.clase.find({}) for a in lista_alumnos: print a["NOMBRE"] aux4={"NOMBRE":a["NOMBRE"],"DNI":a["DNI"],"assitencia":a["assitencia"]} aux3.append(aux4) print respuesta respuesta={"alumnos":aux3} return JsonResponse(respuesta,safe=False) else: return JsonResponse(respuesta,safe=False) else: default={"NOMBRE":"Nombre","DNI":"Dni","assitencia":"asistencia"} aux7=[] aux7.append(default) respuesta={"alumnos":aux7} aux=[] aux3=[] print "entrado por post" numero_alumnos=gestorClase.database.clase.find({}).count() if numero_alumnos>0: lista_alumnos=gestorClase.database.clase.find({}) for a in lista_alumnos: print a["NOMBRE"] aux4={"NOMBRE":a["NOMBRE"],"DNI":a["DNI"],"assitencia":a["assitencia"]} aux3.append(aux4) print respuesta respuesta={"alumnos":aux3} return JsonResponse(respuesta,safe=False) else: return JsonResponse(respuesta,safe=False) @csrf_exempt def CheckFromQr(request): if request.method == 'POST': mydic=dict(request.POST) print mydic dni=mydic["dni"][0] aux=mydic["scaner"][0] alumno=None alumno=gestorClase.database.clase.find({"DNI":str(dni)}) print alumno[0] sesion=gestorClase.database.sesion.find({"fecha_sesion":datetime.now().strftime('%Y-%m-%d')}) print "superado alumno y fecha" if alumno != None: if sesion[0]["clave_sesion"]==aux: gestorClase.database.clase.update({"_id" :alumno[0]["_id"] },{"$set" : {"assitencia" : "True"}}) else: print "Clave de assitencia incorrecta" else: print "Usuario no forma parte de la clase" print "Dni: "+dni print "Clave sesion:"+aux return HttpResponse("OK") else: print "recibido get" return HttpResponse("gettttttt") @csrf_exempt def CheckFromNfc(request): if request.method == 'POST': mydic=dict(request.POST) print mydic dni=mydic["dni"][0] aux=mydic["nfc"][0] alumno=None alumno=gestorClase.database.clase.find({"DNI":str(dni)}) print alumno[0] sesion=gestorClase.database.sesion.find({"fecha_sesion":datetime.now().strftime('%Y-%m-%d')}) print "superado alumno y fecha" if alumno != None: if sesion[0]["clave_sesion"]==aux: gestorClase.database.clase.update({"_id" :alumno[0]["_id"] },{"$set" : {"assitencia" : "True"}}) else: print "Clave de assitencia incorrecta" else: print "Usuario no forma parte de la clase" print "Dni: "+dni print "Clave sesion:"+aux return HttpResponse("OK") else: print "recibido get" # print request.GET['contenido_scaner'] return HttpResponse("gettttttt") ######################### REGISTRO DE USUARIOS ############################################ @csrf_exempt def androidLogin(request): if request.method=='POST': username = request.POST["username"]<|fim▁hole|> if user: # Is the account active? It could have been disabled. if user.is_active: u=User.objects.get(username=user.username) user_profile = UserProfile.objects.get(user=user) login(request, user) #data="nombre_usuario :"+username return HttpResponse(user_profile.__dni__()) else: return HttpResponse("Your account is disabled.") else: print "Invalid login details: {0}, {1}".format(username, password) return HttpResponse("Invalid login details supplied.") else: print "entrando por get" return HttpResponse() @csrf_exempt def androidRegister(request): if request.method=='POST': user_form = UserForm(data=request.POST) profile_form = UserProfileForm(data=request.POST) if user_form.is_valid(): if profile_form.is_valid(): user = user_form.save() user.set_password(user.password) user.save() profile = profile_form.save(commit=False) profile.user = user profile.save() return HttpResponse("success") else: return HttpResponse("Invalid User or Dni") else: return HttpResponse("Username exist or Invalid Email") else: print "entrando por get" return HttpResponse() def register(request): # A boolean value for telling the template whether the registration was successful. # Set to False initially. Code changes value to True when registration succeeds. registered = False # If it's a HTTP POST, we're interested in processing form data. if request.method == 'POST': # Attempt to grab information from the raw form information. # Note that we make use of both UserForm and UserProfileForm. user_form = UserForm(data=request.POST) profile_form = UserProfileForm(data=request.POST) # If the two forms are valid... if user_form.is_valid() and profile_form.is_valid(): # Save the user's form data to the database. user = user_form.save() # Now we hash the password with the set_password method. # Once hashed, we can update the user object. user.set_password(user.password) user.save() # Now sort out the UserProfile instance. # Since we need to set the user attribute ourselves, we set commit=False. # This delays saving the model until we're ready to avoid integrity problems. profile = profile_form.save(commit=False) profile.user = user # Now we save the UserProfile model instance. profile.save() # Update our variable to tell the template registration was successful. registered = True #else: #return HttpResponseRedirect('/') # Invalid form or forms - mistakes or something else? # Print problems to the terminal. # They'll also be shown to the user. else: print user_form.errors, profile_form.errors #return redirect('registration/register.html',{'user_form': user_form, 'profile_form': profile_form, 'registered': registered} ) #print user_form.errors, profile_form.errors # Not a HTTP POST, so we render our form using two ModelForm instances. # These forms will be blank, ready for user input. else: user_form = UserForm() profile_form = UserProfileForm() # Render the template depending on the context. return render(request, 'registration/register.html',{'user_form': user_form, 'profile_form': profile_form, 'registered': registered} ) @csrf_exempt def user_login(request): # If the request is a HTTP POST, try to pull out the relevant information. if request.method == 'POST': # Gather the username and password provided by the user. # This information is obtained from the login form. # We use request.POST.get('<variable>') as opposed to request.POST['<variable>'], # because the request.POST.get('<variable>') returns None, if the value does not exist, # while the request.POST['<variable>'] will raise key error exception username = request.POST.get('username') password = request.POST.get('password') # Use Django's machinery to attempt to see if the username/password # combination is valid - a User object is returned if it is. user = authenticate(username=username, password=password) # If we have a User object, the details are correct. # If None (Python's way of representing the absence of a value), no user # with matching credentials was found. if user: # Is the account active? It could have been disabled. if user.is_active: u=User.objects.get(username=user.username) request.session['username'] = u.username user_profile = UserProfile.objects.get(user=user) #print user_profile.__organizacion__() request.session['dni'] = user_profile.__dni__() login(request, user) return HttpResponseRedirect('/sesion/') else: # An inactive account was used - no logging in! return HttpResponse("Your account is disabled.") else: # Bad login details were provided. So we can't log the user in. print "Invalid login details: {0}, {1}".format(username, password) return HttpResponse("Invalid login details supplied.") # The request is not a HTTP POST, so display the login form. # This scenario would most likely be a HTTP GET. else: # No context variables to pass to the template system, hence the # blank dictionary object... return render(request, 'registration/login.html', {}) @login_required def user_logout(request): # Since we know the user is logged in, we can now just log them out. del request.session['username'] del request.session['dni'] logout(request) # Take the user back to the homepage. return HttpResponseRedirect('/')<|fim▁end|>
password = request.POST["password"] user = authenticate(username=username, password=password)
<|file_name|>labels.js<|end_file_name|><|fim▁begin|>const labels = { collectionFilterLabels: { edit: { name: 'Event name',<|fim▁hole|> event_type: 'Type of event', address_country: 'Country', uk_region: 'UK Region', organiser: 'Organiser', start_date_after: 'From', start_date_before: 'To', }, }, } module.exports = labels<|fim▁end|>
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Kam Y. Tse // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // See the License for the specific language governing permissions and // limitations under the License. #![deny(warnings)] #![cfg_attr(feature = "clippy", feature(plugin))] #![cfg_attr(feature = "clippy", plugin(clippy))] extern crate uuid; extern crate serde; extern crate chrono; extern crate reqwest; #[macro_use] extern crate serde_json;<|fim▁hole|>extern crate error_chain; #[macro_use] extern crate serde_derive; mod account; mod pomo; mod todo; mod client; pub use self::account::Account; pub use self::pomo::{Pomo, PomoBuilder, PomoParameter}; pub use self::todo::{Todo, SubTodo, TodoBuilder, SubTodoBuilder, TodoParameter}; pub use self::client::Client; /// The Errors that may occur when communicating with Pomotodo server. pub mod errors { error_chain! { types { Error, ErrorKind, ResultExt; } foreign_links { ReqError(::reqwest::Error); } } }<|fim▁end|>
#[macro_use]
<|file_name|>polyfills.js<|end_file_name|><|fim▁begin|>// Polyfills // (these modules are what are in 'angular2/bundles/angular2-polyfills' so don't use that here) // import 'ie-shim'; // Internet Explorer // import 'es6-shim'; // import 'es6-promise'; // import 'es7-reflect-metadata'; // Prefer CoreJS over the polyfills above require('core-js'); require('zone.js/dist/zone'); if ('production' === ENV) { } else {<|fim▁hole|>} //# sourceMappingURL=polyfills.js.map<|fim▁end|>
// Development Error.stackTraceLimit = Infinity; require('zone.js/dist/long-stack-trace-zone');
<|file_name|>CommonController.go<|end_file_name|><|fim▁begin|>package Admin import ( "github.com/jesusslim/slimgo" ) type CommonController struct { slimgo.Controller } func (this *CommonController) Show() { this.Data["json"] = "show it" this.ServeJson(nil)<|fim▁hole|><|fim▁end|>
}
<|file_name|>network_dialog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys, time, datetime, re, threading from electrum_creditbit.i18n import _ from electrum_creditbit.util import print_error, print_msg import os.path, json, ast, traceback from PyQt4.QtGui import * from PyQt4.QtCore import * from electrum_creditbit import DEFAULT_SERVERS, DEFAULT_PORTS from util import * #protocol_names = ['TCP', 'HTTP', 'SSL', 'HTTPS'] #protocol_letters = 'thsg' protocol_names = ['TCP', 'SSL'] protocol_letters = 'ts' class NetworkDialog(QDialog): def __init__(self, network, config, parent): QDialog.__init__(self,parent) self.setModal(1) self.setWindowTitle(_('Network')) self.setMinimumSize(375, 20) self.network = network self.config = config self.protocol = None self.servers = network.get_servers() host, port, protocol, proxy_config, auto_connect = network.get_parameters() if not proxy_config: proxy_config = { "mode":"none", "host":"localhost", "port":"9050"} if parent: n = len(network.get_interfaces()) if n: status = _("Blockchain") + ": " + "%d "%(network.get_local_height()) + _("blocks") + ".\n" + _("Getting block headers from %d nodes.")%n else: status = _("Not connected") if network.is_connected(): status += "\n" + _("Server") + ": %s"%(host) else: status += "\n" + _("Disconnected from server") else: status = _("Please choose a server.") + "\n" + _("Select 'Cancel' if you are offline.") vbox = QVBoxLayout() vbox.setSpacing(30) hbox = QHBoxLayout() l = QLabel() l.setPixmap(QPixmap(":icons/network.png")) hbox.addStretch(10) hbox.addWidget(l) hbox.addWidget(QLabel(status)) hbox.addStretch(50) msg = _("Electrum sends your wallet addresses to a single server, in order to receive your transaction history.") + "\n\n" \ + _("In addition, Electrum connects to several nodes in order to download block headers and find out the longest blockchain.") + " " \ + _("This blockchain is used to verify the transactions sent by the address server.") hbox.addWidget(HelpButton(msg)) vbox.addLayout(hbox) # grid layout grid = QGridLayout() grid.setSpacing(8) vbox.addLayout(grid) <|fim▁hole|> self.server_host.setFixedWidth(200) self.server_port = QLineEdit() self.server_port.setFixedWidth(60) grid.addWidget(QLabel(_('Server') + ':'), 0, 0) # use SSL self.ssl_cb = QCheckBox(_('Use SSL')) self.ssl_cb.setChecked(auto_connect) grid.addWidget(self.ssl_cb, 3, 1) self.ssl_cb.stateChanged.connect(self.change_protocol) # auto connect self.autocycle_cb = QCheckBox(_('Auto-connect')) self.autocycle_cb.setChecked(auto_connect) grid.addWidget(self.autocycle_cb, 0, 1) if not self.config.is_modifiable('auto_cycle'): self.autocycle_cb.setEnabled(False) msg = _("If auto-connect is enabled, Electrum will always use a server that is on the longest blockchain.") + " " \ + _("If it is disabled, Electrum will warn you if your server is lagging.") grid.addWidget(HelpButton(msg), 0, 4) grid.addWidget(self.server_host, 0, 2, 1, 2) grid.addWidget(self.server_port, 0, 3) label = _('Active Servers') if network.is_connected() else _('Default Servers') self.servers_list_widget = QTreeWidget(parent) self.servers_list_widget.setHeaderLabels( [ label, _('Limit') ] ) self.servers_list_widget.setMaximumHeight(150) self.servers_list_widget.setColumnWidth(0, 240) self.change_server(host, protocol) self.set_protocol(protocol) self.servers_list_widget.connect(self.servers_list_widget, SIGNAL('currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)'), lambda x,y: self.server_changed(x)) grid.addWidget(self.servers_list_widget, 1, 1, 1, 3) def enable_set_server(): if config.is_modifiable('server'): enabled = not self.autocycle_cb.isChecked() self.server_host.setEnabled(enabled) self.server_port.setEnabled(enabled) self.servers_list_widget.setEnabled(enabled) else: for w in [self.autocycle_cb, self.server_host, self.server_port, self.ssl_cb, self.servers_list_widget]: w.setEnabled(False) self.autocycle_cb.clicked.connect(enable_set_server) enable_set_server() # proxy setting self.proxy_mode = QComboBox() self.proxy_host = QLineEdit() self.proxy_host.setFixedWidth(200) self.proxy_port = QLineEdit() self.proxy_port.setFixedWidth(60) self.proxy_mode.addItems(['NONE', 'SOCKS4', 'SOCKS5', 'HTTP']) def check_for_disable(index = False): if self.config.is_modifiable('proxy'): if self.proxy_mode.currentText() != 'NONE': self.proxy_host.setEnabled(True) self.proxy_port.setEnabled(True) else: self.proxy_host.setEnabled(False) self.proxy_port.setEnabled(False) else: for w in [self.proxy_host, self.proxy_port, self.proxy_mode]: w.setEnabled(False) check_for_disable() self.proxy_mode.connect(self.proxy_mode, SIGNAL('currentIndexChanged(int)'), check_for_disable) self.proxy_mode.setCurrentIndex(self.proxy_mode.findText(str(proxy_config.get("mode").upper()))) self.proxy_host.setText(proxy_config.get("host")) self.proxy_port.setText(proxy_config.get("port")) grid.addWidget(QLabel(_('Proxy') + ':'), 4, 0) grid.addWidget(self.proxy_mode, 4, 1) grid.addWidget(self.proxy_host, 4, 2) grid.addWidget(self.proxy_port, 4, 3) # buttons vbox.addLayout(Buttons(CancelButton(self), OkButton(self))) self.setLayout(vbox) def init_servers_list(self): self.servers_list_widget.clear() for _host, d in sorted(self.servers.items()): if d.get(self.protocol): pruning_level = d.get('pruning','') self.servers_list_widget.addTopLevelItem(QTreeWidgetItem( [ _host, pruning_level ] )) def set_protocol(self, protocol): if protocol != self.protocol: self.protocol = protocol self.init_servers_list() def change_protocol(self, use_ssl): p = 's' if use_ssl else 't' host = unicode(self.server_host.text()) pp = self.servers.get(host, DEFAULT_PORTS) if p not in pp.keys(): p = pp.keys()[0] port = pp[p] self.server_host.setText( host ) self.server_port.setText( port ) self.set_protocol(p) def server_changed(self, x): if x: self.change_server(str(x.text(0)), self.protocol) def change_server(self, host, protocol): pp = self.servers.get(host, DEFAULT_PORTS) if protocol and protocol not in protocol_letters: protocol = None if protocol: port = pp.get(protocol) if port is None: protocol = None if not protocol: if 's' in pp.keys(): protocol = 's' port = pp.get(protocol) else: protocol = pp.keys()[0] port = pp.get(protocol) self.server_host.setText( host ) self.server_port.setText( port ) self.ssl_cb.setChecked(protocol=='s') def do_exec(self): if not self.exec_(): return host = str( self.server_host.text() ) port = str( self.server_port.text() ) protocol = 's' if self.ssl_cb.isChecked() else 't' if self.proxy_mode.currentText() != 'NONE': proxy = { 'mode':str(self.proxy_mode.currentText()).lower(), 'host':str(self.proxy_host.text()), 'port':str(self.proxy_port.text()) } else: proxy = None auto_connect = self.autocycle_cb.isChecked() self.network.set_parameters(host, port, protocol, proxy, auto_connect) return True<|fim▁end|>
# server self.server_host = QLineEdit()
<|file_name|>filter-input.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { Filter, FilterType } from 'lib/filter'; @Component({ selector: 'iw-filter-input', templateUrl: './filter-input.component.html', styleUrls: ['./filter-input.component.css'] }) export class FilterInputComponent implements OnInit { @Input() filter: Filter; @Output() change = new EventEmitter<Filter>(); constructor() { } ngOnInit() { } get FilterType() { return FilterType;<|fim▁hole|> applyFilter(filter: Filter, value: string) { filter.value = value; this.change.emit(filter); } itemsForField(filter: Filter) { if (filter.options) { return filter.options; } // put to initialization // if (!this.rows) { return []; } // const items = []; // this.rows.forEach((r) => { // if (items.indexOf(r[filter.key]) < 0) { // items.push(r[filter.key]); // } // }); // return items; } } /* filterData(key: string, value: any) { let filter: Filter = this.filters .find((f) => f.key === key); if (!filter) { filter = { type: FilterType.String, key, value }; this.filters.push(filter); } else { // overwritte previous value filter.value = value; } this.filterChange.emit(); } } */<|fim▁end|>
}
<|file_name|>preview.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 from gimpfu import * import time import re def preview (image, delay, loops, force_delay, ignore_hidden, restore_hide): if not image: raise "No image given." layers = image.layers nlayers = len (layers) visible = [] length = [] i = 0 while i < nlayers: visible += [pdb.gimp_item_get_visible (layers [i])] if visible [i]: pdb.gimp_item_set_visible (layers [i], False) name = pdb.gimp_item_get_name (layers [i]) l = None if not force_delay: l = re.search ("\([0-9]+ms\)", name) if l: l = tuple (map (sum, zip (l.span (), tuple ([+1, -3])))) l = name [slice (*l)] if not l: l = delay length += [float (l) / 1000.0] i += 1 j = 0 while j < loops: while i > 0: i -= 1 if (not ignore_hidden) or visible [i]: pdb.gimp_item_set_visible (layers [i], True) pdb.gimp_displays_flush () time.sleep (length [i]) j += 1 # unhides everything for optimized if j < loops: while i < nlayers: if (not ignore_hidden) or visible [i]: pdb.gimp_item_set_visible (layers [i], False) i += 1 else: i = nlayers i = nlayers if restore_hide:<|fim▁hole|> if visible [i]: pdb.gimp_item_set_visible (layers [i], True) register( "preview", "preview", "Preview the animation of a gif", "Roger Bongers", "Roger Bongers", "2016", "Preview...", "*", [ (PF_IMAGE, "image", "The image to modify", None), (PF_INT32, "delay", "The default length in ms of each frame", 100), (PF_INT32, "loops", "The number of times to loop the animation", 1), (PF_BOOL, "force-delay", "Force the default length on every frame", 0), (PF_BOOL, "ignore-hidden", "Ignore currently hidden items", 0), (PF_BOOL, "restore-hide", "Restore the hidden status after preview", 0), ], [], preview, menu = "<Image>/Filters/Animation") main()<|fim▁end|>
while i > 0: i -= 1
<|file_name|>mazeOfPacman.py<|end_file_name|><|fim▁begin|>import os import random import pygame import sys from util import utils from time import sleep square_l = 10 pacman_r, pacman_c = None, None food_r, food_c = None, None r,c = None, None visited = [] fPath = [] def dfs(grid, start, end, path = []): #print(start) global visited global fPath fPath.append(start) stack = list() path = path + [start] if start == end: #path.append(len(path)) return path up = (start[0]-1, start[1]) left = (start[0], start[1]-1) right = (start[0], start[1]+1) down = (start[0]+1, start[1]) if (grid[up[0]][up[1]] != '%') and (not up in visited): stack.append(up) visited.append(up) if (grid[left[0]][left[1]] != '%') and (not left in visited): stack.append(left) visited.append(left) if (grid[right[0]][right[1]] != '%') and (not right in visited): stack.append(right) visited.append(right) if (grid[down[0]][down[1]] != '%') and (not down in visited): stack.append(down) visited.append(down) while len(stack) > 0: node = stack.pop() newpath = dfs(grid, node, end, path) if newpath: return newpath return None def bfs(grid, start, end, path = []): #print(start) global visited global fPath stack = list() stack.append(start) while len(stack) > 0: node = stack.pop(0) fPath.append((node[0], node[1])) if (node[0], node[1]) == end: while True: path.insert(0, node) node = node[2] #print(node) if ((node[0], node[1]) == start): path.insert(0, start) return path up = (node[0]-1, node[1]) left = (node[0], node[1]-1) right = (node[0], node[1]+1) down = (node[0]+1, node[1]) if (grid[up[0]][up[1]] != '%') and (not up in visited): stack.append((up[0], up[1], node)) visited.append(up) <|fim▁hole|> if (grid[left[0]][left[1]] != '%') and (not left in visited): stack.append((left[0], left[1], node)) visited.append(left) if (grid[right[0]][right[1]] != '%') and (not right in visited): stack.append((right[0], right[1], node)) visited.append(right) if (grid[down[0]][down[1]] != '%') and (not down in visited): stack.append((down[0], down[1], node)) visited.append(down) return None def astar(grid, start, end): frontier = list() costs = {} explored = list() path = {} frontier.append(start) costs[start] = manDistance(start, end) while len(frontier) > 0: #take cheapest one. Implement with priority queue index = 0 minv = costs[frontier[index]] for i in range(len(frontier)): if costs[frontier[i]] < minv: minv = costs[frontier[i]] index = i node = frontier.pop(index) if node == end: respath = [node] while True: respath.insert(0, path[node]) node = path[node] if node == start: return respath explored.append(node) stack = [] up = (node[0]-1, node[1]) left = (node[0], node[1]-1) right = (node[0], node[1]+1) down = (node[0]+1, node[1]) if (grid[up[0]][up[1]] != '%'): cost = 1 if (grid[up[0]][up[1]] == '-') else 0 stack.append(((up[0], up[1]), cost)) if (grid[left[0]][left[1]] != '%'): cost = 1 if (grid[left[0]][left[1]] == '-') else 0 stack.append(((left[0], left[1]), cost)) if (grid[right[0]][right[1]] != '%'): cost = 1 if (grid[right[0]][right[1]] == '-') else 0 stack.append(((right[0], right[1]), cost)) if (grid[down[0]][down[1]] != '%'): cost = 1 if (grid[down[0]][down[1]] == '-') else 0 stack.append(((down[0], down[1]), cost)) for child in stack: if not child[0] in explored or not child[0] in frontier: path[child[0]] = node frontier.append(child[0]) costs[child[0]] = (costs[node] + child[1] + abs(manDistance(child[0], end) - manDistance(node, end))) elif costs[child[0]] > (costs[node] + child[1] + abs(manDistance(child[0], end) - manDistance(node, end))): path[child[0]] = node costs[child[0]] = costs[node] + child[1] + abs(manDistance(child[0], end) - manDistance(node, end)) return None def manDistance(node, goal): x = abs(node[0] - goal[0]) y = abs(node[1] - goal[1]) return x+y def readMaze(filename): global pacman_r, pacman_c global food_r, food_c global r,c filePath = os.path.join(utils.getResourcesPath(), filename) f = open(filePath, 'r') pacman_r, pacman_c = [ int(i) for i in f.readline().strip().split() ] food_r, food_c = [ int(i) for i in f.readline().strip().split() ] r,c = [ int(i) for i in f.readline().strip().split() ] grid = [] for i in range(0, r): grid.append(f.readline().strip()) return grid def renderMaze(window, m, pos): window.fill((255, 255, 255)) global r, c for y in range(r): for x in range(c): if m[y][x] == '%': box = pygame.Rect(x*square_l, y*square_l, square_l, square_l) pygame.draw.rect(window, (0, 0, 0), box, 0) box = pygame.Rect(pos[1]*square_l, pos[0]*square_l, square_l, square_l) pygame.draw.rect(window, (255, 0, 0), box, 0) pygame.display.update() pygame.time.delay(10) def main(): #pygame.init() maze = readMaze('hackerrank\pacman.txt') #window = pygame.display.set_mode((c * square_l, r * square_l)) #visited.append((pacman_r, pacman_c)) res = dfs(maze, (pacman_r, pacman_c), (food_r, food_c)) print(len(res)) #renderMaze(window, maze, (pacman_c, pacman_r)) for line in res: #renderMaze(window, maze, line) print(line[0], line[1]) #sleep(0.5) # print(len(fPath)) # for line in fPath: # #renderMaze(window, maze, line) # print(line[0], line[1]) # #sleep(0.5) # while True: # for event in pygame.event.get(): # if event.type == pygame.QUIT: # sys.exit(0) main()<|fim▁end|>
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>use crate::core::counter::Counter; use crate::iterators::{HistogramIterator, PickMetadata, PickyIterator}; use crate::Histogram; /// An iterator that will yield at log-size steps through the histogram's value range. pub struct Iter<'a, T: 'a + Counter> { hist: &'a Histogram<T>, // > 1.0 next_value_reporting_level: f64, // > 1.0 log_base: f64, current_step_lowest_value_reporting_level: u64, current_step_highest_value_reporting_level: u64, } impl<'a, T: 'a + Counter> Iter<'a, T> { /// Construct a new logarithmic iterator. See `Histogram::iter_log` for details. pub fn new( hist: &'a Histogram<T>, value_units_in_first_bucket: u64, log_base: f64, ) -> HistogramIterator<'a, T, Iter<'a, T>> { assert!( value_units_in_first_bucket > 0, "value_units_per_bucket must be > 0"<|fim▁hole|> let new_lowest = hist.lowest_equivalent(value_units_in_first_bucket - 1); HistogramIterator::new( hist, Iter { hist, log_base, next_value_reporting_level: value_units_in_first_bucket as f64, current_step_highest_value_reporting_level: value_units_in_first_bucket - 1, current_step_lowest_value_reporting_level: new_lowest, }, ) } } impl<'a, T: 'a + Counter> PickyIterator<T> for Iter<'a, T> { fn pick(&mut self, index: usize, _: u64, _: T) -> Option<PickMetadata> { let val = self.hist.value_for(index); if val >= self.current_step_lowest_value_reporting_level || index == self.hist.last_index() { let metadata = PickMetadata::new(None, Some(self.current_step_highest_value_reporting_level)); // implies log_base must be > 1.0 self.next_value_reporting_level *= self.log_base; // won't underflow since next_value_reporting_level starts > 0 and only grows self.current_step_highest_value_reporting_level = self.next_value_reporting_level as u64 - 1; self.current_step_lowest_value_reporting_level = self .hist .lowest_equivalent(self.current_step_highest_value_reporting_level); Some(metadata) } else { None } } fn more(&mut self, index_to_pick: usize) -> bool { // If the next iterate will not move to the next sub bucket index (which is empty if if we // reached this point), then we are not yet done iterating (we want to iterate until we are // no longer on a value that has a count, rather than util we first reach the last value // that has a count. The difference is subtle but important)... self.hist .lowest_equivalent(self.next_value_reporting_level as u64) < self.hist.value_for(index_to_pick) } }<|fim▁end|>
); assert!(log_base > 1.0, "log_base must be > 1.0");
<|file_name|>disorder.js<|end_file_name|><|fim▁begin|>/* * Disorder is a class for storing genetic disorder info and loading it from the * the OMIM database. These disorders can be attributed to an individual in the Pedigree. * * @param disorderID the id number for the disorder, taken from the OMIM database * @param name a string representing the name of the disorder e.g. "Down Syndrome" */ var Disorder = Class.create( { initialize: function(disorderID, name, callWhenReady) { // user-defined disorders if (name == null && !isInt(disorderID)) { name = disorderID; } this._disorderID = disorderID; this._name = name ? name : "loading..."; if (!name && callWhenReady) this.load(callWhenReady); }, /* * Returns the disorderID of the disorder */ getDisorderID: function() { return this._disorderID; }, /* * Returns the name of the disorder */ getName: function() { return this._name; }, load: function(callWhenReady) { var baseOMIMServiceURL = Disorder.getOMIMServiceURL(); var queryURL = baseOMIMServiceURL + "&q=id:" + this._disorderID; //console.log("queryURL: " + queryURL); new Ajax.Request(queryURL, { method: "GET", onSuccess: this.onDataReady.bind(this), //onComplete: complete.bind(this) onComplete: callWhenReady ? callWhenReady : {} }); }, onDataReady : function(response) { try { var parsed = JSON.parse(response.responseText); //console.log(stringifyObject(parsed)); console.log("LOADED DISORDER: disorder id = " + this._disorderID + ", name = " + parsed.rows[0].name); this._name = parsed.rows[0].name; } catch (err) { console.log("[LOAD DISORDER] Error: " + err); } } }); <|fim▁hole|> Disorder.getOMIMServiceURL = function() { return new XWiki.Document('OmimService', 'PhenoTips').getURL("get", "outputSyntax=plain"); }<|fim▁end|>
<|file_name|>ovs_cleanup.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_config import cfg from oslo_log import log as logging from neutron.agent.common import ovs_lib from neutron.common import config from neutron.conf.agent import cmd from neutron.conf.agent import common as agent_config from neutron.conf.agent.l3 import config as l3_config from neutron.conf.plugins.ml2.drivers import ovs_conf from neutron.conf import service as service_config LOG = logging.getLogger(__name__)<|fim▁hole|># It allows to clean bridges with even thousands of ports. CLEANUP_OVSDB_TIMEOUT = 600 def setup_conf(): """Setup the cfg for the clean up utility. Use separate setup_conf for the utility because there are many options from the main config that do not apply during clean-up. """ conf = cfg.CONF cmd.register_cmd_opts(cmd.ovs_opts, conf) l3_config.register_l3_agent_config_opts(l3_config.OPTS, conf) agent_config.register_interface_driver_opts_helper(conf) agent_config.register_interface_opts() service_config.register_service_opts(service_config.RPC_EXTRA_OPTS, conf) ovs_conf.register_ovs_agent_opts(conf) conf.set_default("ovsdb_timeout", CLEANUP_OVSDB_TIMEOUT, "OVS") return conf def main(): """Main method for cleaning up OVS bridges. The utility cleans up the integration bridges used by Neutron. """ conf = setup_conf() conf() config.setup_logging() agent_config.setup_privsep() do_main(conf) def do_main(conf): configuration_bridges = set([conf.OVS.integration_bridge]) ovs = ovs_lib.BaseOVS() ovs_bridges = set(ovs.get_bridges()) available_configuration_bridges = configuration_bridges & ovs_bridges if conf.ovs_all_ports: bridges = ovs_bridges else: bridges = available_configuration_bridges for bridge in bridges: LOG.info("Cleaning bridge: %s", bridge) ovs.ovsdb.ovs_cleanup(bridge, conf.ovs_all_ports).execute(check_error=True) LOG.info("OVS cleanup completed successfully")<|fim▁end|>
# Default ovsdb_timeout value for this script.
<|file_name|>ItemmappingMapper.java<|end_file_name|><|fim▁begin|>package com.healthcare.db.client; import com.healthcare.db.model.Itemmapping; import com.healthcare.db.model.ItemmappingExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface ItemmappingMapper { /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ int countByExample(ItemmappingExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ int deleteByExample(ItemmappingExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ <|fim▁hole|> * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ int insertSelective(Itemmapping record); /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ List<Itemmapping> selectByExample(ItemmappingExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ int updateByExampleSelective(@Param("record") Itemmapping record, @Param("example") ItemmappingExample example); /** * This method was generated by MyBatis Generator. This method corresponds to the database table itemmapping * @mbggenerated Mon Jul 27 06:41:29 ICT 2015 */ int updateByExample(@Param("record") Itemmapping record, @Param("example") ItemmappingExample example); }<|fim▁end|>
int insert(Itemmapping record); /**
<|file_name|>math.js<|end_file_name|><|fim▁begin|>var Vector; (function (Vector) { function clean(n) { var vector = []; for (var i = 0; i < n; i++) { vector[i] = 0; } return vector; } Vector.clean = clean; function create() { var values = []; for (var _i = 0; _i < arguments.length; _i++) { values[_i - 0] = arguments[_i]; } var vector = []; for (var i = 0; i < values.length; i++) { vector[i] = values[i]; } return vector; } Vector.create = create; function dot(vec1, vec2) { var dot = 0; for (var i = 0; i < vec1.length; i++) { dot += vec1[i] * vec2[i]; } return dot; } Vector.dot = dot; function magnitude(vec) { return Math.sqrt(Vector.dot(vec, vec)); } Vector.magnitude = magnitude; function angle(vec1, vec2) { return Math.acos(Vector.dot(vec1, vec2) / (Vector.magnitude(vec1) * Vector.magnitude(vec2))); } Vector.angle = angle; var Vec2; (function (Vec2) { function clean() { return [0, 0]; } Vec2.clean = clean; function create(x, y) { return [x, y]; } Vec2.create = create; function dot(vec1, vec2) { return vec1[0] * vec2[0] + vec1[1] * vec2[1]; } Vec2.dot = dot; })(Vec2 = Vector.Vec2 || (Vector.Vec2 = {})); var Vec3; (function (Vec3) { function clean() { return [0, 0, 0]; } Vec3.clean = clean; function create(x, y, z) { return [x, y, z]; } Vec3.create = create; function dot(vec1, vec2) { return vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2]; } Vec3.dot = dot; })(Vec3 = Vector.Vec3 || (Vector.Vec3 = {})); var Vec4; (function (Vec4) { function clean() { return [0, 0, 0, 0]; } Vec4.clean = clean; function create(x, y, z, w) { return [x, y, z, w]; } Vec4.create = create; function dot(vec1, vec2) { return vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2] + vec1[3] * vec2[3]; } Vec4.dot = dot; })(Vec4 = Vector.Vec4 || (Vector.Vec4 = {})); })(Vector || (Vector = {})); var Matrix; (function (Matrix) { function clean(size) { return Vector.clean(size * size); } Matrix.clean = clean; function identity(size) { var mat = []; for (var i = 0; i < size * size; i++) { mat[i] = (Math.floor(i / size) - i % size) == 0 ? 1 : 0; } return mat; } Matrix.identity = identity; function copy(mat) { return mat.slice(); } Matrix.copy = copy; function getRow(mat, row) { var size = Matrix.size(mat); var vec = []; for (var i = 0; i < size; i++) { vec[i] = mat[row + i * size]; } return vec; } Matrix.getRow = getRow; function getColom(mat, colom) { var size = Matrix.size(mat); var vec = []; for (var i = 0; i < size; i++) { vec[i] = mat[colom * size + i]; } return vec; } Matrix.getColom = getColom; function getValue(mat, row, colom) { var size = Matrix.size(mat); return mat[row + colom * size]; } Matrix.getValue = getValue; function setRow(mat, row, value) { var size = Matrix.size(mat); for (var i = 0; i < size; i++) { mat[row + i * size] = value[i]; } return mat; } Matrix.setRow = setRow; function setColom(mat, colom, value) { var size = Matrix.size(mat); for (var i = 0; i < size; i++) { mat[colom * size + i] = value[i]; } return mat; } Matrix.setColom = setColom; function setvalue(mat, row, colom, value) { var size = Matrix.size(mat); mat[row + colom * size] = value; return mat; } Matrix.setvalue = setvalue; function size(mat) { return Math.sqrt(mat.length); } Matrix.size = size; function getTranspose(mat) { var size = Matrix.size(mat); var matOut = Matrix.clean(size); for (var i = 0; i < size; i++) { Matrix.setColom(matOut, i, Matrix.getRow(mat, i)); } return matOut; } Matrix.getTranspose = getTranspose; var Mat4; (function (Mat4) { function identity() { return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } Mat4.identity = identity; function mul(mat1, mat2) { return [ mat1[0] * mat2[0] + mat1[4] * mat2[1] + mat1[8] * mat2[2] + mat1[12] * mat2[3], mat1[1] * mat2[0] + mat1[5] * mat2[1] + mat1[9] * mat2[2] + mat1[13] * mat2[3], mat1[2] * mat2[0] + mat1[6] * mat2[1] + mat1[10] * mat2[2] + mat1[14] * mat2[3], mat1[3] * mat2[0] + mat1[7] * mat2[1] + mat1[11] * mat2[2] + mat1[15] * mat2[3], mat1[0] * mat2[4] + mat1[4] * mat2[5] + mat1[8] * mat2[6] + mat1[12] * mat2[7], mat1[1] * mat2[4] + mat1[5] * mat2[5] + mat1[9] * mat2[6] + mat1[13] * mat2[7], mat1[2] * mat2[4] + mat1[6] * mat2[5] + mat1[10] * mat2[6] + mat1[14] * mat2[7], mat1[3] * mat2[4] + mat1[7] * mat2[5] + mat1[11] * mat2[6] + mat1[15] * mat2[7], mat1[0] * mat2[8] + mat1[4] * mat2[9] + mat1[8] * mat2[10] + mat1[12] * mat2[11], mat1[1] * mat2[8] + mat1[5] * mat2[9] + mat1[9] * mat2[10] + mat1[13] * mat2[11], mat1[2] * mat2[8] + mat1[6] * mat2[9] + mat1[10] * mat2[10] + mat1[14] * mat2[11], mat1[3] * mat2[8] + mat1[7] * mat2[9] + mat1[11] * mat2[10] + mat1[15] * mat2[11], mat1[0] * mat2[12] + mat1[4] * mat2[13] + mat1[8] * mat2[14] + mat1[12] * mat2[15], mat1[1] * mat2[12] + mat1[5] * mat2[13] + mat1[9] * mat2[14] + mat1[13] * mat2[15], mat1[2] * mat2[12] + mat1[6] * mat2[13] + mat1[10] * mat2[14] + mat1[14] * mat2[15], mat1[3] * mat2[12] + mat1[7] * mat2[13] + mat1[11] * mat2[14] + mat1[15] * mat2[15] ]; } Mat4.mul = mul; function translate(p1, p2, p3) { if (typeof p3 == "number") { var x = p2; var y = p3; var mat = p1; var newColom = Vector.Vec4.create(mat[0] * x + mat[4] * y + mat[12], mat[1] * x + mat[5] * y + mat[13], mat[2] * x + mat[6] * y + mat[14], mat[3] * x + mat[7] * y + mat[15]); return setColom(mat, 3, newColom); } else { var x = p1; var y = p2; return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1]; } } Mat4.translate = translate; function scale(p1, p2, p3) { if (typeof p3 == "number") { var width = p2; var height = p3; var mat = p1; var newColom1 = Vector.Vec4.create(mat[0] * width, mat[1] * width, mat[2] * width, mat[3] * width); var newColom2 = Vector.Vec4.create(mat[4] * height, mat[5] * height, mat[6] * height, mat[7] * height); setColom(mat, 0, newColom1); setColom(mat, 1, newColom2); return mat; } else { var width = p1; var height = p2; return [width, 0, 0, 0, 0, height, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } } Mat4.scale = scale; function rotate(p1, p2) { if (typeof p2 == "number") { var rad = p2; var mat = p1; var newColom1 = Vector.Vec4.create(mat[0] * Math.cos(rad) + mat[4] * Math.sin(rad), mat[1] * Math.cos(rad) + mat[5] * Math.sin(rad), mat[2] * Math.cos(rad) + mat[6] * Math.sin(rad), mat[3] * Math.cos(rad) + mat[7] * Math.sin(rad)); var newColom2 = Vector.Vec4.create(mat[0] * -Math.sin(rad) + mat[4] * Math.cos(rad), mat[1] * -Math.sin(rad) + mat[5] * Math.cos(rad), mat[2] * -Math.sin(rad) + mat[6] * Math.cos(rad), mat[3] * -Math.sin(rad) + mat[7] * Math.cos(rad)); setColom(mat, 0, newColom1); setColom(mat, 1, newColom2); return mat; } else { var rad = p1; return [Math.cos(rad), Math.sin(rad), 0, 0, -Math.sin(rad), Math.cos(rad), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } } Mat4.rotate = rotate; function ortho(left, right, bottom, top) { return [2 / (right - left), 0, 0, 0, 0, 2 / (top - bottom), 0, 0, 0, 0, -2 / (-1 - 1), 0, -(right + left) / (right - left), -(top + bottom) / (top - bottom), -(-1 + 1) / (-1 - 1), 1]; } Mat4.ortho = ortho; })(Mat4 = Matrix.Mat4 || (Matrix.Mat4 = {})); var Mat3; (function (Mat3) { function identity() { return [1, 0, 0, 0, 1, 0, 0, 0, 1]; } Mat3.identity = identity; function mul(mat1, mat2) { return [ mat1[0] * mat2[0] + mat1[3] * mat2[1] + mat1[6] * mat2[2], mat1[1] * mat2[0] + mat1[4] * mat2[1] + mat1[7] * mat2[2], mat1[2] * mat2[0] + mat1[5] * mat2[1] + mat1[8] * mat2[2], mat1[0] * mat2[3] + mat1[3] * mat2[4] + mat1[6] * mat2[5], mat1[1] * mat2[3] + mat1[4] * mat2[4] + mat1[7] * mat2[5], mat1[2] * mat2[3] + mat1[5] * mat2[4] + mat1[8] * mat2[5], mat1[0] * mat2[6] + mat1[3] * mat2[7] + mat1[6] * mat2[8], mat1[1] * mat2[6] + mat1[4] * mat2[7] + mat1[7] * mat2[8], mat1[2] * mat2[6] + mat1[5] * mat2[7] + mat1[8] * mat2[8], ]; } Mat3.mul = mul; })(Mat3 = Matrix.Mat3 || (Matrix.Mat3 = {})); var Mat2; (function (Mat2) { function identity() { return [1, 0, 0, 1]; } Mat2.identity = identity; function mul(mat1, mat2) { return [ mat1[0] * mat2[0] + mat1[2] * mat2[1], mat1[1] * mat2[0] + mat1[3] * mat2[1], mat1[0] * mat2[2] + mat1[2] * mat2[3], mat1[1] * mat2[2] + mat1[3] * mat2[3],<|fim▁hole|> } Mat2.mul = mul; })(Mat2 = Matrix.Mat2 || (Matrix.Mat2 = {})); })(Matrix || (Matrix = {})); var MMath; (function (MMath) { var SEED = 0; var TO_RAD = (Math.PI * 2) / 360; var TO_DEG = 360 / (Math.PI * 2); function setRandomSeed(seed) { SEED = seed; } MMath.setRandomSeed = setRandomSeed; function random(min, max) { if (min === void 0) { min = 0; } if (max === void 0) { max = 1; } SEED = (SEED * 9301 + 49297) % 233280; var rnd = SEED / 233280; return min + rnd * (max - min); } MMath.random = random; function toRad(deg) { return deg * TO_RAD; } MMath.toRad = toRad; function toDeg(rad) { return rad * TO_DEG; } MMath.toDeg = toDeg; function mod(num, max) { return ((num % max) + max) % max; } MMath.mod = mod; function logN(base, num) { return Math.log(num) / Math.log(base); } MMath.logN = logN; function isPowerOf2(n) { if (n == 0) return false; else return (n & (n - 1)) == 0; } MMath.isPowerOf2 = isPowerOf2; })(MMath || (MMath = {})); //# sourceMappingURL=math.js.map<|fim▁end|>
];
<|file_name|>TableConnectableBlokk.ts<|end_file_name|><|fim▁begin|>import { gql } from '@apollo/client' import { connectableContextMenuConnectableFragment } from 'v2/components/ConnectableContextMenu/fragments/connectableContextMenu' export const channelTableContentsConnectableFragment = gql` fragment ChannelTableContentsConnectable on Konnectable { __typename ...ConnectableContextMenuConnectable ... on Model { id } ... on Block { counts { public_channels } } ... on Channel { visibility title counts { connected_to_channels contents } } ... on Model {<|fim▁hole|> ... on Attachment { file_url image_url(size: THUMB) created_at file_url image_url source { url provider_url } } ... on Embed { embed_html image_url(size: THUMB) source { url provider_url } } ... on Link { image_url(size: THUMB) source { url provider_url } } ... on Image { image_url(size: THUMB) source { url provider_url } } ... on Text { content(format: MARKDOWN) html: content(format: HTML) source { url } } ... on ConnectableInterface { title user { name } connection { __typename position selected id created_at(relative: true) can { manage } user { name } } } } ${connectableContextMenuConnectableFragment} `<|fim▁end|>
created_at(relative: true) updated_at(relative: true) }
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::all)] mod channel; mod guild; use std::sync::Arc; use async_trait::async_trait; use parking_lot::RwLock; use rendezvous_common::{ anyhow, futures::prelude::*, proto::{ bouncer_service_client::BouncerServiceClient, event, ClientType, Event, Header, MessageCreated, UserRenamed, }, tokio, tonic::transport, tracing::{self, debug, error, info, info_span, warn}, }; use serenity::{ http::Http, model::{ self, channel::{ChannelType, GuildChannel, Message, MessageType}, guild::{Guild, Member}, id::GuildId, }, prelude::*, }; use crate::{ channel::{Channel, ChannelList}, guild::{author_name, GuildData, GuildMap, UserData}, }; #[tokio::main] async fn main() -> anyhow::Result<()> { tracing::init()?; let mut rpc_client = BouncerServiceClient::connect("http://[::1]:49252").await?; let token = std::env::var("RENDEZVOUS_DISCORD_BOT_TOKEN")?; let handler = Handler::new(rpc_client.clone()); let channels = Arc::clone(&handler.channels); let mut discord_client = Client::builder(&token).event_handler(handler).await?; let http = Arc::clone(&discord_client.cache_and_http.http); let mut resp = rpc_client .subscribe(Header { client_type: ClientType::Discord.into(), }) .await?; let handle_rpc_stream = async move { let stream = resp.get_mut(); while let Some(m) = stream.try_next().await? { handle_ipc_event(&http, &channels, m).await?; } Ok::<_, anyhow::Error>(()) }; let handle_discord_events = discord_client .start_autosharded() .err_into::<anyhow::Error>(); tokio::try_join!(handle_rpc_stream, handle_discord_events,)?; Ok(()) } async fn handle_ipc_event( http: &Http, channels: &RwLock<ChannelList>, e: Event, ) -> anyhow::Result<()> { match e.body { Some(event::Body::MessageCreated(MessageCreated { nickname, channel, content, .. })) => { if !channel.starts_with("#") { return Ok(()); } let channels = channels.read(); debug!( "channels: {:?}", channels.iter().map(|ch| ch.name()).collect::<Vec<_>>() ); if let Some(ch) = channels.get_by_name(&channel[1..]) { debug!("{:?}", ch); ch.id() .send_message(http, |m| m.content(format!("<{}> {}", nickname, content))) .await?; } else { warn!("unknown channel: {:?}", channel); } } _ => {} } Ok(()) } struct Handler { guilds: RwLock<GuildMap>, channels: Arc<RwLock<ChannelList>>, current_user: RwLock<Option<model::user::CurrentUser>>, rpc_client: BouncerServiceClient<transport::Channel>, } impl Handler { fn new(rpc_client: BouncerServiceClient<transport::Channel>) -> Self { Handler { guilds: Default::default(), channels: Default::default(), current_user: Default::default(), rpc_client, } } fn insert_guild(&self, guild: Guild) -> Option<GuildData> { let mut lock = self.guilds.write(); lock.insert(guild.id, guild.into()) } fn register_guild_channel<'a>(&'a self, channel: &GuildChannel) -> bool { if channel.kind != ChannelType::Text { return false; } self.channels .write() .get_or_insert_with(channel.id, || Channel::Guild(channel.clone())); true } } #[async_trait] impl EventHandler for Handler { async fn ready( &self, _ctx: Context, model::gateway::Ready { user, guilds, private_channels, .. }: model::gateway::Ready, ) { use model::guild::GuildStatus::*; *self.current_user.write() = Some(user); self.guilds .write() .extend(guilds.into_iter().filter_map(|g| match g { OnlineGuild(g) => Some((g.id, g.into())), _ => None, })); self.channels.write().extend( private_channels .into_iter() .filter_map(|(_, ch)| Channel::from_discord(ch)), ); } async fn guild_create(&self, _ctx: Context, guild: Guild) { let mut new_channels = vec![]; for chan in guild.channels.values() { if self.register_guild_channel(&chan) { new_channels.push(chan.name.clone()); } } self.insert_guild(guild); } async fn guild_member_addition(&self, _ctx: Context, guild_id: GuildId, new_member: Member) { if let Some(g) = self.guilds.write().get_mut(&guild_id) { let id = new_member.user.id;<|fim▁hole|> async fn guild_member_removal( &self, _ctx: Context, guild_id: GuildId, user: model::user::User, ) { if let Some(g) = self.guilds.write().get_mut(&guild_id) { g.members.remove(&user.id); } } async fn guild_member_update(&self, _ctx: Context, new: model::event::GuildMemberUpdateEvent) { let guild_id = new.guild_id; let new = UserData::from(new); let mut event = None; if let Some(m) = self .guilds .write() .get_mut(&guild_id) .and_then(|g| g.members.get_mut(&new.id)) { if m.name != new.name { event = Some(Event { header: Some(Header { client_type: ClientType::Discord.into(), }), body: Some(event::Body::UserRenamed(UserRenamed { old: m.name.clone(), new: new.name.clone(), })), }); } *m = new; } if let Some(req) = event { if let Err(e) = self.rpc_client.clone().post(req).await { error!("failed to send event: {:?}", e); } } } async fn message(&self, _ctx: Context, new_message: Message) { let span = info_span!("message"); let _enter = span.enter(); info!("entered"); if new_message.kind != MessageType::Regular || self .current_user .read() .as_ref() .map(|u| u.id == new_message.author.id) .unwrap_or(false) { return; } let mut event = None; if let Some(ch) = self.channels.read().get_by_id(new_message.channel_id) { event = Some(Event { header: Some(Header { client_type: ClientType::Discord.into(), }), body: Some(event::Body::MessageCreated(MessageCreated { nickname: author_name(&self.guilds.read(), &new_message).to_owned(), channel: format!("#{}", ch.name()), content: new_message.content, origin: "".to_owned(), })), }); } else { info!("channel not found: {}", new_message.channel_id); } if let Some(req) = event { if let Err(e) = self.rpc_client.clone().post(req).await { error!("failed to send event: {:?}", e); } } } }<|fim▁end|>
g.members.insert(id, new_member.into()); } }
<|file_name|>test_view.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from mock import patch from django.conf import settings from django.test import TestCase from django_any.models import any_model from django.utils import unittest from django.contrib.auth.models import User from django.test.client import Client from django.test.client import RequestFactory from django.test.utils import override_settings from w3af_webui.models import ScanTask from w3af_webui.models import Target from w3af_webui.models import ScanProfile from w3af_webui.models import Scan from w3af_webui.models import Vulnerability from w3af_webui.views import get_select_code from w3af_webui.views import show_report from w3af_webui.views import show_report_txt from w3af_webui.views import user_settings class TestGetCode(TestCase): def test_get_select_code(self): list_per_page_values = ( ('10', '10'), ('30', '30'), ('50', '50'), ('70', '70'), ('90', '90'), ('100', '100'), ) select_code = get_select_code('50', list_per_page_values, 'list_per_page') self.assertIn('select', select_code) self.assertIn('</select>', select_code) self.assertIn('</option>', select_code) self.assertIn('selected', select_code) self.assertIn('list_per_page', select_code) class TestView(unittest.TestCase): def setUp(self): User.objects.all().delete() # Every test needs a client. self.user = User.objects.create_user('new_unittest1', '[email protected]', 'new_test_password') self.user.save() self.client = Client() self.client.login(username='new_unittest1', password='new_test_password') self.profile = any_model(ScanProfile) self.target = any_model(Target) self.scan_task = any_model(ScanTask, status=settings.TASK_STATUS['free'], target=self.target, last_updated='0',) self.scan = Scan.objects.create(scan_task=self.scan_task, user=self.user,) self.vuln = any_model(Vulnerability, scan=self.scan, ) # Every test needs access to the request factory. self.factory = RequestFactory() def test_user_settings_get(self): # Issue a GET request. request = self.factory.get('/user_settings/',) request.user = self.user request.yauser = self.user response = user_settings(request) # Check that the response is 200 OK. self.assertEqual(response.status_code, 200) return #self.assertIn(response.status_code,[200, 302]) response = self.client.post('/user_settings/', {'list_per_page': '90', 'iface_lang': 'RU', 'notification': '0', }) self.assertIn('selected', response.context.__getitem__('form').notification) def test_show_report_get(self): request = self.factory.get('/show_report/%s/' % self.scan.id) request.user = self.user request.yauser = self.user request.follow = True response = show_report(request, self.scan.id) self.assertEqual(response.status_code, 200) @patch('django.contrib.messages.success') @patch('django.contrib.messages.error') @patch('w3af_webui.views.get_vulnerability_module') def test_show_report_post(self, mock_import, mock_err_msg, mock_succ_msg): request = self.factory.post( '/show_report/%s/' % self.scan.id, {'vuln_id': self.vuln.id,} ) request.user = self.user request.yauser = self.user mock_import.return_value = '' response = show_report(request, self.scan.id) self.assertEqual(response.status_code, 403) # CSRF! self.assertFalse(mock_err_msg.called) self.assertFalse(mock_succ_msg.called) def test_show_report_txt(self): # Issue a GET request. request = self.factory.get('/show_report_txt/%s/' % self.scan.id) request.user = self.user request.yauser = self.user response = show_report_txt(request, self.scan.id) # Check that the response is 200 OK. self.assertEqual(response.status_code, 200) @patch('w3af_webui.tasks.scan_start.delay') @patch('w3af_webui.models.ScanTask.create_scan') def test_run_now_200(self, mock_create_scan, mock_delay): self.assertFalse(mock_create_scan.called) self.assertFalse(mock_delay.called) response = self.client.get('/run_now/', {'id': self.scan.id}, follow=True, ) self.assertEqual(response.status_code, 200) self.assertTrue(mock_create_scan.called, 'create_scan does not call') self.assertTrue(mock_delay.called, 'delay function does not call') @patch('w3af_webui.tasks.scan_start.delay') @patch('w3af_webui.models.ScanTask.create_scan') def test_run_now_404(self, mock_create_scan, mock_delay): # bad request (404) response = self.client.get('run_now/') self.assertFalse(mock_create_scan.called) self.assertFalse(mock_delay.called) self.assertEqual(response.status_code, 404, 'Must return 404') def test_check_url(self): # Issue a GET request. response = self.client.get('/check_url/',<|fim▁hole|> # Check that the response is 200 OK. self.assertEqual(response.status_code, 200) response = self.client.get('/check_url/', {'url': 'test.test'}) self.assertEqual(response.status_code, 404) def test_stop_scan(self): # Issue a GET request. #self.client.META['HTTP_REFERER'] = '/w3af_webui/scan/' #response = self.client.get('/stop_scan/', { 'id': self.scan.id}) # Check that the response is 200 OK. #self.assertEqual(response.status_code, 302) # Issue a GET request without id in queryset. response = self.client.get('/stop_scan/') # Check that redirect done. self.assertEqual(response.status_code, 404)<|fim▁end|>
{'url': 'http://w3af.sourceforge.net/'})
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import {Component, ViewChild} from '@angular/core'; import { Platform, MenuController, NavController} from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; import { HomeComponent } from './pages/home-page/home.component'; import {CityListPage} from './pages/city-list/city-list'; import {ClausePage} from './pages/clause/clause'; @Component({ templateUrl: './app.component.html' }) export class AppComponent { @ViewChild('content') content: NavController; // make HelloIonicPage the root (or first) page rootPage: any = HomeComponent; pages: Array<{title: string, component: any}>; // stroage: Storage; constructor( private platform: Platform, private menu: MenuController, private splashScreen: SplashScreen ) { this.initializeApp();<|fim▁hole|> this.pages = [ { title: '首页', component: HomeComponent }, { title: '城市', component: CityListPage }, { title: '许可条款', component: ClausePage } ]; } initializeApp() { this.platform.ready().then(() => { this.splashScreen.hide(); }); } ionViewDidLoad(){ } openPage(page) { // close the menu when clicking a link from the menu this.menu.close(); // navigate to the new page if it is not the current page this.content.setRoot(page.component); } }<|fim▁end|>
// set our app's pages
<|file_name|>readerApi.interface.ts<|end_file_name|><|fim▁begin|>// ==LICENSE-BEGIN== // Copyright 2017 European Digital Reading Lab. All rights reserved. // Licensed to the Readium Foundation under one or more contributor license agreements. // Use of this source code is governed by a BSD-style license<|fim▁hole|>import { IEventPayload_R2_EVENT_CLIPBOARD_COPY } from "@r2-navigator-js/electron/common/events"; export interface IReaderApi { clipboardCopy: ( publicationIdentifier: string, clipboardData: IEventPayload_R2_EVENT_CLIPBOARD_COPY) => Promise<boolean>; } export interface IReaderModuleApi { "reader/clipboardCopy": IReaderApi["clipboardCopy"]; }<|fim▁end|>
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. // ==LICENSE-END==
<|file_name|>test_statistics.cpp<|end_file_name|><|fim▁begin|>// ========================================================================== // SeqAn - The Library for Sequence Analysis // ========================================================================== // Copyright (c) 2006-2015, Knut Reinert, FU Berlin // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of Knut Reinert or the FU Berlin nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. // // ========================================================================== // Author: Jonathan Goeke <[email protected]> // ========================================================================== // Tests for SeqAn's module statistics (markov model) // ========================================================================== #include <seqan/basic.h> #include <seqan/file.h> #include <seqan/statistics.h> // The module under test. #include "test_statistics_markov_model.h" #include "test_statistics_base.h" SEQAN_BEGIN_TESTSUITE(test_statistics) {<|fim▁hole|> SEQAN_CALL_TEST(test_statistics_statistics); } SEQAN_END_TESTSUITE<|fim▁end|>
// Call Tests. SEQAN_CALL_TEST(test_statistics_markov_model);
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this<|fim▁hole|> //! Calculate [specified][specified] and [computed values][computed] from a //! tree of DOM nodes and a set of stylesheets. //! //! [computed]: https://drafts.csswg.org/css-cascade/#computed //! [specified]: https://drafts.csswg.org/css-cascade/#specified //! //! In particular, this crate contains the definitions of supported properties, //! the code to parse them into specified values and calculate the computed //! values based on the specified values, as well as the code to serialize both //! specified and computed values. //! //! The main entry point is [`recalc_style_at`][recalc_style_at]. //! //! [recalc_style_at]: traversal/fn.recalc_style_at.html //! //! Major dependencies are the [cssparser][cssparser] and [selectors][selectors] //! crates. //! //! [cssparser]: ../cssparser/index.html //! [selectors]: ../selectors/index.html #![deny(warnings)] #![deny(missing_docs)] // FIXME(bholley): We need to blanket-allow unsafe code in order to make the // gecko atom!() macro work. When Rust 1.14 is released [1], we can uncomment // the commented-out attributes in regen_atoms.py and go back to denying unsafe // code by default. // // [1] https://github.com/rust-lang/rust/issues/15701#issuecomment-251900615 //#![deny(unsafe_code)] #![allow(unused_unsafe)] #![recursion_limit = "500"] // For define_css_keyword_enum! in -moz-appearance extern crate app_units; extern crate arrayvec; extern crate atomic_refcell; extern crate bit_vec; #[macro_use] extern crate bitflags; #[allow(unused_extern_crates)] extern crate byteorder; #[cfg(feature = "gecko")] #[macro_use] #[no_link] extern crate cfg_if; #[macro_use] extern crate cssparser; extern crate euclid; extern crate fnv; #[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache; extern crate hashglobe; #[cfg(feature = "servo")] extern crate heapsize; #[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; extern crate itertools; extern crate itoa; #[cfg(feature = "servo")] #[macro_use] extern crate html5ever; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; #[allow(unused_extern_crates)] #[macro_use] extern crate matches; #[cfg(feature = "gecko")] #[macro_use] pub extern crate nsstring_vendor as nsstring; #[cfg(feature = "gecko")] extern crate num_cpus; extern crate num_integer; extern crate num_traits; extern crate ordered_float; extern crate owning_ref; extern crate parking_lot; extern crate pdqsort; extern crate precomputed_hash; extern crate rayon; extern crate selectors; #[cfg(feature = "servo")] #[macro_use] extern crate serde; pub extern crate servo_arc; #[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms; #[cfg(feature = "servo")] extern crate servo_config; #[cfg(feature = "servo")] extern crate servo_url; extern crate smallvec; #[macro_use] extern crate style_derive; #[macro_use] extern crate style_traits; extern crate time; extern crate unicode_bidi; #[allow(unused_extern_crates)] extern crate unicode_segmentation; #[macro_use] mod macros; #[cfg(feature = "servo")] pub mod animation; pub mod applicable_declarations; #[allow(missing_docs)] // TODO. #[cfg(feature = "servo")] pub mod attr; pub mod bezier; pub mod bloom; pub mod cache; pub mod context; pub mod counter_style; pub mod custom_properties; pub mod data; pub mod dom; pub mod driver; pub mod element_state; #[cfg(feature = "servo")] mod encoding_support; pub mod error_reporting; pub mod font_face; pub mod font_metrics; #[cfg(feature = "gecko")] #[allow(unsafe_code)] pub mod gecko; #[cfg(feature = "gecko")] #[allow(unsafe_code)] pub mod gecko_bindings; pub mod hash; pub mod invalidation; #[allow(missing_docs)] // TODO. pub mod logical_geometry; pub mod matching; pub mod media_queries; pub mod parallel; pub mod parser; pub mod rule_tree; pub mod scoped_tls; pub mod selector_map; pub mod selector_parser; pub mod shared_lock; pub mod sharing; pub mod style_resolver; pub mod stylist; #[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod servo; pub mod str; pub mod style_adjuster; pub mod stylesheet_set; pub mod stylesheets; pub mod thread_state; pub mod timer; pub mod traversal; pub mod traversal_flags; #[macro_use] #[allow(non_camel_case_types)] pub mod values; use std::fmt; use style_traits::ToCss; #[cfg(feature = "gecko")] pub use gecko_string_cache as string_cache; #[cfg(feature = "gecko")] pub use gecko_string_cache::Atom; #[cfg(feature = "gecko")] pub use gecko_string_cache::Namespace; #[cfg(feature = "gecko")] pub use gecko_string_cache::Atom as Prefix; #[cfg(feature = "gecko")] pub use gecko_string_cache::Atom as LocalName; #[cfg(feature = "servo")] pub use servo_atoms::Atom; #[cfg(feature = "servo")] pub use html5ever::Prefix; #[cfg(feature = "servo")] pub use html5ever::LocalName; #[cfg(feature = "servo")] pub use html5ever::Namespace; /// The CSS properties supported by the style system. /// Generated from the properties.mako.rs template by build.rs #[macro_use] #[allow(unsafe_code)] #[deny(missing_docs)] pub mod properties { include!(concat!(env!("OUT_DIR"), "/properties.rs")); } #[cfg(feature = "gecko")] #[allow(unsafe_code, missing_docs)] pub mod gecko_properties { include!(concat!(env!("OUT_DIR"), "/gecko_properties.rs")); } macro_rules! reexport_computed_values { ( $( { $name: ident, $boxed: expr } )+ ) => { /// Types for [computed values][computed]. /// /// [computed]: https://drafts.csswg.org/css-cascade/#computed pub mod computed_values { $( pub use properties::longhands::$name::computed_value as $name; )+ // Don't use a side-specific name needlessly: pub use properties::longhands::border_top_style::computed_value as border_style; } } } longhand_properties_idents!(reexport_computed_values); /// Serializes as CSS a comma-separated list of any `T` that supports being /// serialized as CSS. pub fn serialize_comma_separated_list<W, T>(dest: &mut W, list: &[T]) -> fmt::Result where W: fmt::Write, T: ToCss, { if list.is_empty() { return Ok(()); } list[0].to_css(dest)?; for item in list.iter().skip(1) { dest.write_str(", ")?; item.to_css(dest)?; } Ok(()) } #[cfg(feature = "gecko")] use gecko_string_cache::WeakAtom; #[cfg(feature = "servo")] use servo_atoms::Atom as WeakAtom; /// Extension methods for selectors::attr::CaseSensitivity pub trait CaseSensitivityExt { /// Return whether two atoms compare equal according to this case sensitivity. fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool; } impl CaseSensitivityExt for selectors::attr::CaseSensitivity { fn eq_atom(self, a: &WeakAtom, b: &WeakAtom) -> bool { match self { selectors::attr::CaseSensitivity::CaseSensitive => a == b, selectors::attr::CaseSensitivity::AsciiCaseInsensitive => a.eq_ignore_ascii_case(b), } } }<|fim▁end|>
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<|file_name|>ErrorReporting.py<|end_file_name|><|fim▁begin|># xVector Engine Client # Copyright (c) 2011 James Buchwald # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ Contains code for nicely reporting errors to the user. """ import logging import traceback from PyQt4 import QtGui from xVClient import ClientGlobals mainlog = logging.getLogger("") # Severity constants FatalError = 1 """Fatal error, forces termination of application.""" NormalError = 2 """Normal error, this has impact but does not crash the program.""" WarningError = 3 """Warning, this does not affect function but should cause concern.""" NoticeError = 4 """General information.""" def ShowError(message, severity=NormalError, parent=None): """ Displays an error message to the user and waits for a response. """ dlg = QtGui.QMessageBox(parent) dlg.setText(message)<|fim▁hole|> dlg.setWindowTitle("Fatal Error") elif severity == NormalError: dlg.setIcon(QtGui.QMessageBox.Critical) dlg.setWindowTitle("Error") elif severity == WarningError: dlg.setIcon(QtGui.QMessageBox.Warning) dlg.setWindowTitle("Warning") elif severity == NoticeError: dlg.setIcon(QtGui.QMessageBox.Information) dlg.setWindowTitle("Notice") else: dlg.setIcon(QtGui.QMessageBox.NoIcon) dlg.setWindowTitle("Message") dlg.exec_() def ShowException(severity=NormalError, start_msg='An error has occurred!', parent=None): ''' Displays the currently-handled exception in an error box. ''' msg = start_msg + "\n\n" + traceback.format_exc() ShowError(msg, severity, parent) class ErrorMessageHandler(logging.Handler): ''' Logging handler that displays messages in Qt message boxes. ''' def __init__(self, parent=None): ''' Creates a new handler. @type parent: QtGui.QWidget @param parent: Parent widget for errors to be displayed under. ''' super(ErrorMessageHandler,self).__init__() self.Parent = parent '''Parent widget for errors to be displayed under.''' def _ShowError(self, message): ''' Shows an error message and returns immediately. @type message: string @param message: Message to display. ''' app = ClientGlobals.Application wnd = QtGui.QMessageBox(parent=self.Parent) wnd.setIcon(QtGui.QMessageBox.Critical) wnd.setWindowTitle("Error") wnd.setStandardButtons(QtGui.QMessageBox.Ok) wnd.setText(message) wnd.exec_() def emit(self, record): self._ShowError(record.getMessage()) def ConfigureLogging(parent=None): ''' Configures the logging mechanism to report errors as dialog boxes. @type parent: QtGui.QWidget @param parent: Parent widget for errors to be displayed under. ''' # Set up the error handler (output to a message box). handler = ErrorMessageHandler(parent) formatter = logging.Formatter("%(message)s") handler.setFormatter(formatter) handler.setLevel(logging.ERROR) mainlog.addHandler(handler) # Send lower-level messages to stderr. lowhandler = logging.StreamHandler() lowhandler.setFormatter(formatter) lowhandler.setLevel(logging.DEBUG) mainlog.addHandler(lowhandler) # Make sure that the logger catches all levels of messages. mainlog.setLevel(logging.DEBUG)<|fim▁end|>
if severity == FatalError: dlg.setIcon(QtGui.QMessageBox.Critical)
<|file_name|>print-tickets.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){ // removing some column headers when there is at least one product if ( $('#lines tbody tr.product').length > 0 ) { $('#lines').addClass('with-product'); $('body').addClass('with-product'); } if ( $('#lines tbody tr.ticket').length > 0 ) { $('#lines').addClass('with-ticket'); $('body').addClass('with-ticket'); } window.print(); // update the parent window's content if ( window.opener != undefined && typeof window.opener.li === 'object' ) window.opener.li.initContent(); <|fim▁hole|> window.location = $('#options #print-again a').prop('href'); // close if ( $('#options #close').length > 0 && $('#options #print-again').length == 0 ) window.close(); });<|fim▁end|>
// print again if ( $('#options #print-again').length > 0 )
<|file_name|>setup_metrics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2014 IBM Corp # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # this script will create a set of metrics at the endpoint specified as the # program parameter # # import json import random import requests import string import sys import time MOLD = {"name": "name1", "timestamp": '2014-12-01', "value": 100 }<|fim▁hole|> def setup_metrics(argv): for a in range(100): MOLD_DIMENSIONS['key1'] = ( ''.join(random.sample(string.ascii_uppercase * 6, 6))) MOLD_DIMENSIONS['key2'] = ( ''.join(random.sample(string.ascii_uppercase * 6, 6))) MOLD_DIMENSIONS['key_' + str(a)] = ( ''.join(random.sample(string.ascii_uppercase * 6, 6))) """ import hashlib key_str = json.dumps(MOLD_DIMENSIONS, sort_keys=True, indent=None, separators=(',', ':')) key = hashlib.md5(key_str).hexdigest() MOLD['dimensions_hash'] = key """ MOLD['dimensions'] = MOLD_DIMENSIONS print('starting round %s' % a) # Generate unique 100 metrics for i in range(100): MOLD['name'] = ''.join(random.sample(string.ascii_uppercase * 6, 6)) for j in range(10): MOLD['value'] = round((i + 1) * j * random.random(), 2) the_time = time.time() # single messages for k in range(10): factor = round(random.random(), 2) * 100 MOLD['timestamp'] = the_time + k * 50000 * factor MOLD['value'] = i * j * k * random.random() res = requests.post(argv[1], data=json.dumps(MOLD)) if res.status_code != 201 and res.status_code != 204: print(json.dumps(MOLD)) exit(0) # multiple messages for k in range(3): msg = "[" factor = round(random.random(), 2) * 100 MOLD['timestamp'] = the_time + k * 50000 * factor MOLD['value'] = i * j * k * random.random() msg += json.dumps(MOLD) for l in range(9): factor = round(random.random(), 2) * 100 MOLD['timestamp'] = the_time + k * 50000 * factor MOLD['value'] = i * j * k * random.random() msg += ',' + json.dumps(MOLD) msg += "]" res = requests.post(argv[1], data=msg) if res.status_code != 201 and res.status_code != 204: print(json.dumps(MOLD)) exit(0) del MOLD_DIMENSIONS['key_' + str(a)] print('round finished %s' % a) if __name__ == '__main__': if len(sys.argv) == 2: setup_metrics(sys.argv) else: print('Usage: setup_metrics endpoint. For example:') print(' setup_metrics http://host:9000/data_2015')<|fim▁end|>
MOLD_DIMENSIONS = {"key1": None}
<|file_name|>AddCommentPayload.java<|end_file_name|><|fim▁begin|>package com.vaguehope.onosendai.payload; import android.content.Context; import android.content.Intent; import com.vaguehope.onosendai.config.Account; import com.vaguehope.onosendai.model.Meta; import com.vaguehope.onosendai.model.MetaType; import com.vaguehope.onosendai.model.Tweet; import com.vaguehope.onosendai.ui.PostActivity; import com.vaguehope.onosendai.util.EqualHelper; public class AddCommentPayload extends Payload { private final Account account; public AddCommentPayload (final Account account, final Tweet ownerTweet) { super(ownerTweet, null, PayloadType.COMMENT); this.account = account; } @Override public String getTitle () { return "Add Comment"; //ES } @Override public boolean intentable () { return true; } @Override public Intent toIntent (final Context context) { final Intent intent = new Intent(context, PostActivity.class); intent.putExtra(PostActivity.ARG_ACCOUNT_ID, this.account.getId()); intent.putExtra(PostActivity.ARG_IN_REPLY_TO_UID, getOwnerTweet().getUid());<|fim▁hole|> if (replyToId != null) intent.putExtra(PostActivity.ARG_ALT_REPLY_TO_SID, replyToId.getData()); return intent; } @Override public int hashCode () { return this.account != null ? this.account.getId() != null ? this.account.getId().hashCode() : 0 : 0; } @Override public boolean equals (final Object o) { if (o == null) return false; if (o == this) return true; if (!(o instanceof AddCommentPayload)) return false; final AddCommentPayload that = (AddCommentPayload) o; return EqualHelper.equal(this.getOwnerTweet(), that.getOwnerTweet()) && EqualHelper.equal(this.account, that.account); } }<|fim▁end|>
intent.putExtra(PostActivity.ARG_IN_REPLY_TO_SID, getOwnerTweet().getSid()); final Meta replyToId = getOwnerTweet().getFirstMetaOfType(MetaType.REPLYTO);
<|file_name|>0003_set_site_domain_and_name.py<|end_file_name|><|fim▁begin|>""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ from django.conf import settings from django.db import migrations def update_site_forward(apps, schema_editor): """Set site domain and name.""" Site = apps.get_model('sites', 'Site') Site.objects.update_or_create( id=settings.SITE_ID, defaults={ 'domain': 'example.com', 'name': 'BAC' }<|fim▁hole|> def update_site_backward(apps, schema_editor): """Revert site domain and name to default.""" Site = apps.get_model('sites', 'Site') Site.objects.update_or_create( id=settings.SITE_ID, defaults={ 'domain': 'example.com', 'name': 'example.com' } ) class Migration(migrations.Migration): dependencies = [ ('sites', '0002_alter_domain_unique'), ] operations = [ migrations.RunPython(update_site_forward, update_site_backward), ]<|fim▁end|>
)
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|># Copyright 2019 Tecnativa - David # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import logging from odoo import SUPERUSER_ID, api _logger = logging.getLogger(__name__) def pre_init_hook(cr): """Speed up the installation of the module on an existing Odoo instance""" cr.execute( """ SELECT column_name FROM information_schema.columns WHERE table_name='stock_move' AND column_name='qty_returnable' """ ) if not cr.fetchone(): _logger.info("Creating field qty_returnable on stock_move")<|fim▁hole|> ) cr.execute( """ UPDATE stock_move SET qty_returnable = 0 WHERE state IN ('draft', 'cancel') """ ) cr.execute( """ UPDATE stock_move SET qty_returnable = product_uom_qty WHERE state = 'done' """ ) def post_init_hook(cr, registry): """Set moves returnable qty on hand""" with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) moves_draft = env["stock.move"].search([("state", "in", ["draft", "cancel"])]) moves_no_return_pendant = env["stock.move"].search( [ ("returned_move_ids", "=", False), ("state", "not in", ["draft", "cancel", "done"]), ] ) moves_by_reserved_availability = {} for move in moves_no_return_pendant: moves_by_reserved_availability.setdefault(move.reserved_availability, []) moves_by_reserved_availability[move.reserved_availability].append(move.id) for qty, ids in moves_by_reserved_availability.items(): cr.execute( "UPDATE stock_move SET qty_returnable = %s " "WHERE id IN %s", (qty, tuple(ids)), ) moves_no_return_done = env["stock.move"].search( [ ("returned_move_ids", "=", False), ("state", "=", "done"), ] ) # Recursively solve quantities updated_moves = moves_no_return_done + moves_draft + moves_no_return_pendant remaining_moves = env["stock.move"].search( [ ("returned_move_ids", "!=", False), ("state", "=", "done"), ] ) while remaining_moves: _logger.info("{} moves left...".format(len(remaining_moves))) remaining_moves, updated_moves = update_qty_returnable( cr, remaining_moves, updated_moves ) def update_qty_returnable(cr, remaining_moves, updated_moves): for move in remaining_moves: if all([x in updated_moves for x in move.returned_move_ids]): quantity_returned = sum(move.returned_move_ids.mapped("qty_returnable")) quantity = move.product_uom_qty - quantity_returned cr.execute( "UPDATE stock_move SET qty_returnable = %s " "WHERE id = %s", (quantity, move.id), ) remaining_moves -= move updated_moves += move return remaining_moves, updated_moves<|fim▁end|>
cr.execute( """ ALTER TABLE stock_move ADD COLUMN qty_returnable float; """
<|file_name|>fontgen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Very basic tool to generate a binary font from a TTF. Currently # hardcodes a lot of things, so it's only really suitable for this demo. # # Assumes every glyph fits in an 8x8 box. Each glyph is encoded as # an uncompressed 8-byte bitmap, preceeded by a one-byte escapement. # import ImageFont, ImageDraw, Image FONT = "04B_03__.TTF" font = ImageFont.truetype(FONT, 8) glyphs = map(chr, range(ord(' '), ord('z')+1)) print """/* * 8x8 variable-width binary font, AUTOMATICALLY GENERATED<|fim▁hole|> for g in glyphs: width, height = font.getsize(g) assert width <= 8 assert height <= 8 im = Image.new("RGB", (8,8)) draw = ImageDraw.Draw(im) draw.text((0, 0), g, font=font) bytes = [width] for y in range(8): byte = 0 for x in range(8): if im.getpixel((x,y))[0]: byte = byte | (1 << x) bytes.append(byte) print " %s" % "".join(["0x%02x," % x for x in bytes]) print "};"<|fim▁end|>
* by fontgen.py from %s */ static const uint8_t font_data[] = {""" % FONT
<|file_name|>ServiceComm.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2011 Matthias Jordan <[email protected]> * * This file is part of piRSS. * * piRSS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * piRSS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with piRSS. If not, see <http://www.gnu.org/licenses/>. */ package de.codefu.android.rss.updateservice; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.util.Log; import de.codefu.android.rss.CursorChangedReceiver; import de.codefu.android.rss.db.ItemProvider; /** * Helper that defines the communication between the Activities and Services. * <p> * One important thing covered here are insert intents. An insert intent is an * intent whose receiver is the {@link InsertService} and that communicates that * some RSS feed data should be inserted into the database. This intent has two * different forms: * <ul> * <li>One uses the {@link #CONTENT}</li> extra whose value is the data that was * downloaded from the RSS feed. </li> * <li>The other form uses the {@link #CONTENT_REF} extra whose value is the ID * of a row in an auxiliary database table that has the data that was downloaded * from the RSS feed.</li> * </ul> * The reason for this intent having two different kinds of behavior is that * normally passing the RSS feed data directly is better in terms of CPU cycles. * But an intent is passed using RPC and for RPC data there is a maximum size. * So whenever feed data is larger than that maximum size {@link ServiceComm} * stores it in the database and passes the ID of that database entry using the * {@link #CONTENT_REF} extra. * * @author mj */ public class ServiceComm { /** * The key for the extra hat has the ID of the feed whose data is attached * or referenced. */ public static final String FEED_ID = "feedid"; /** * The key for the extra that has the RSS feed data. */ private static final String CONTENT = "content"; /** * The key for the extra that has the ID of the row in the auxiliary table * where the RSS feed data is stored. */ private static final String CONTENT_REF = "contentid"; /** * Wrapper for the information extracted from the insert intent. */ public static class IntentContent { /** * The data to insert. */ public String content; /** * The ID of the feed for which to insert the data. */ public long feedId; } /** * The maximum size of data that can be stored in an intent. */ // TODO: Get correct max size private static final int MAX_RPC_SIZE = 50 * 1024; /** * Name of a broadcast that is sent when polling starts. */ public static final String POLLING_STARTED = "pollingstarted"; /** * Name of a broadcast that is sent when there are problems during polling. */ public static final String POLLING_PROBLEM = "pollingproblem"; /** * Creates an insert intent. * <p> * If the data given is too large for the RPC system (larger than * {@link #MAX_RPC_SIZE}) the data is stored in a database and the ID of * that data in the database is stored in the intent. Otherwise the data * itself is stored in the intent. * * @param c * the context to create the intent for * @param feedId * the ID of the feed whose data is in body * @param body * the data of the RSS feed * @return an intent object ready for sending */ public static Intent createInsertIntent(Context c, long feedId, String body) { final Intent i = new Intent(c, InsertService.class); if (body.length() > MAX_RPC_SIZE) { final Uri uri = ItemProvider.CONTENT_URI_AUX; final ContentValues cv = new ContentValues(); cv.put("content", body); final Uri id = c.getContentResolver().insert(uri, cv); i.putExtra(CONTENT_REF, id); } else { i.putExtra(CONTENT, body); } i.putExtra(FEED_ID, feedId); Log.d("ServComm", "Created " + i); return i; } /** * Takes an insert intent created with * {@link #createInsertIntent(Context, long, String)} and retrieves the data * in it. * <p> * The handling of the data in the intent (reference or directly attached * data) is totally transparent. The caller also does not have to care about * the maintenance of the auxiliary table. * * @param c * the content to use for a possible database access * @param intent * the intent to read from * @return the object with the data and feed ID read from the intent. */ public static IntentContent getInsertContent(Context c, Intent intent) { final IntentContent ic = new IntentContent(); final Bundle extras = intent.getExtras(); final Object contentRefO = extras.get(CONTENT_REF);<|fim▁hole|> if (contentRefO instanceof Uri) { final Uri contentRef = (Uri) contentRefO; final Cursor cursor = c.getContentResolver().query(contentRef, null, null, null, null); if (cursor != null) { if (cursor.moveToFirst()) { ic.content = cursor.getString(cursor.getColumnIndex(ItemProvider.AUX_COL_CONTENT)); } cursor.close(); } c.getContentResolver().delete(contentRef, null, null); } Log.i("ServComm", "Read intent for feed " + ic.feedId + " from aux table"); } else { ic.content = extras.getString(CONTENT); Log.i("ServComm", "Read intent for feed " + ic.feedId); } return ic; } private static void sendBroadcast(Context context, String action) { final Intent intent = new Intent(action); intent.setPackage(CursorChangedReceiver.PACKAGE_NAME); context.sendBroadcast(intent); } /** * Sends a broadcast to announce that the data in the DB has changed. * * @param context * the content to use for sending the intent */ public static void sendDataChangedBroadcast(Context context) { sendBroadcast(context, CursorChangedReceiver.DATA_CHANGED); } /** * Sends a broadcast to announce that polling has stated. * * @param context * the content to use for sending the intent */ public static void sendPollingStartedBroadcast(Context context) { sendBroadcast(context, POLLING_STARTED); } /** * Sends a broadcast to announce that there was a problem during the * download for a given feed. * * @param context * the content to use for sending the intent * @param feedId * the ID of the feed that was attempted to poll */ public static void sendPollingProblemBroadcast(Context context, long feedId) { final Intent intent = new Intent(POLLING_PROBLEM); intent.setPackage(CursorChangedReceiver.PACKAGE_NAME); intent.putExtra(FEED_ID, feedId); context.sendBroadcast(intent); } public static void sendPollIntent(Context context, long feedId) { final Intent i = new Intent(context, UpdateService.class); i.putExtra(ServiceComm.FEED_ID, feedId); context.startService(i); } /** * Sends an intent to the {@link AutoPollService} to trigger polling the * feeds for which automatic polling is configured. * * @param context * the context to use for sending the intent */ public static void sendAutoPollIntent(Context context) { final Intent i = new Intent(context, AutoPollService.class); context.startService(i); } }<|fim▁end|>
ic.feedId = extras.getLong(FEED_ID); if (contentRefO != null) {
<|file_name|>mailbox.py<|end_file_name|><|fim▁begin|># *- coding: utf-8 -*- # mailbox.py # Copyright (C) 2013-2015 LEAP # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. """ IMAP Mailbox. """ import re import os import io import cStringIO import StringIO import time from collections import defaultdict from email.utils import formatdate from twisted.internet import defer from twisted.internet import reactor from twisted.logger import Logger from twisted.mail import imap4 from zope.interface import implements from leap.common.check import leap_assert from leap.common.check import leap_assert_type from leap.bitmask.mail.constants import INBOX_NAME, MessageFlags from leap.bitmask.mail.imap.messages import IMAPMessage # TODO LIST # [ ] finish the implementation of IMailboxListener # [ ] implement the rest of ISearchableMailbox INIT_FLAGS = (MessageFlags.RECENT_FLAG, MessageFlags.LIST_FLAG) def make_collection_listener(mailbox): """ Wrap a mailbox in a class that can be hashed according to the mailbox name. This means that dicts or sets will use this new equality rule, so we won't collect multiple instances of the same mailbox in collections like the MessageCollection set where we keep track of listeners. """ class HashableMailbox(object): def __init__(self, mbox): self.mbox = mbox # See #8083, pixelated adaptor introduces conflicts in the usage self.mailbox_name = self.mbox.mbox_name + 'IMAP' def __hash__(self): return hash(self.mailbox_name) def __eq__(self, other): return self.mailbox_name == other.mbox.mbox_name + 'IMAP' def notify_new(self): self.mbox.notify_new() return HashableMailbox(mailbox) class IMAPMailbox(object): """ A Soledad-backed IMAP mailbox. Implements the high-level method needed for the Mailbox interfaces. The low-level database methods are contained in the generic MessageCollection class. We receive an instance of it and it is made accessible in the `collection` attribute. """ implements( imap4.IMailbox, imap4.IMailboxInfo, imap4.ISearchableMailbox, # XXX I think we do not need to implement CloseableMailbox, do we? # We could remove ourselves from the collectionListener, although I # think it simply will be garbage collected. # imap4.ICloseableMailbox imap4.IMessageCopier) init_flags = INIT_FLAGS CMD_MSG = "MESSAGES" CMD_RECENT = "RECENT" CMD_UIDNEXT = "UIDNEXT" CMD_UIDVALIDITY = "UIDVALIDITY" CMD_UNSEEN = "UNSEEN" log = Logger() # TODO we should turn this into a datastructure with limited capacity _listeners = defaultdict(set) def __init__(self, collection, rw=1): """ :param collection: instance of MessageCollection :type collection: MessageCollection :param rw: read-and-write flag for this mailbox :type rw: int """ self.rw = rw self._uidvalidity = None self.collection = collection self.collection.addListener(make_collection_listener(self)) @property def mbox_name(self): return self.collection.mbox_name @property def listeners(self): """ Returns listeners for this mbox. The server itself is a listener to the mailbox. so we can notify it (and should!) after changes in flags and number of messages. :rtype: set """ return self._listeners[self.mbox_name] def get_imap_message(self, message): d = defer.Deferred() IMAPMessage(message, store=self.collection.store, d=d) return d # FIXME this grows too crazily when many instances are fired, like # during imaptest stress testing. Should have a queue of limited size # instead. def addListener(self, listener): """ Add a listener to the listeners queue. The server adds itself as a listener when there is a SELECT, so it can send EXIST commands. :param listener: listener to add :type listener: an object that implements IMailboxListener """ listeners = self.listeners self.log.debug('Adding mailbox listener: %s. Total: %s' % ( listener, len(listeners))) listeners.add(listener) def removeListener(self, listener): """ Remove a listener from the listeners queue. :param listener: listener to remove :type listener: an object that implements IMailboxListener """ self.listeners.remove(listener) def getFlags(self): """ Returns the flags defined for this mailbox. :returns: tuple of flags for this mailbox :rtype: tuple of str """ flags = self.collection.mbox_wrapper.flags if not flags: flags = self.init_flags flags_str = map(str, flags) return flags_str def setFlags(self, flags): """ Sets flags for this mailbox. :param flags: a tuple with the flags :type flags: tuple of str """ # XXX this is setting (overriding) old flags. # Better pass a mode flag leap_assert(isinstance(flags, tuple), "flags expected to be a tuple") return self.collection.set_mbox_attr("flags", flags) def getUIDValidity(self): """ Return the unique validity identifier for this mailbox. :return: unique validity identifier :rtype: int """ return self.collection.get_mbox_attr("created") def getUID(self, message_number): """ Return the UID of a message in the mailbox .. note:: this implementation does not make much sense RIGHT NOW, but in the future will be useful to get absolute UIDs from message sequence numbers. :param message: the message sequence number. :type message: int :rtype: int :return: the UID of the message. """ # TODO support relative sequences. The (imap) message should # receive a sequence number attribute: a deferred is not expected return message_number def getUIDNext(self): """ Return the likely UID for the next message added to this mailbox. Currently it returns the higher UID incremented by one. :return: deferred with int :rtype: Deferred """ d = self.collection.get_uid_next() return d def getMessageCount(self): """ Returns the total count of messages in this mailbox. :return: deferred with int :rtype: Deferred """ return self.collection.count() def getUnseenCount(self): """ Returns the number of messages with the 'Unseen' flag. :return: count of messages flagged `unseen` :rtype: int """ return self.collection.count_unseen() def getRecentCount(self): """ Returns the number of messages with the 'Recent' flag. :return: count of messages flagged `recent` :rtype: int """ return self.collection.count_recent() def isWriteable(self): """ Get the read/write status of the mailbox. :return: 1 if mailbox is read-writeable, 0 otherwise. :rtype: int """ # XXX We don't need to store it in the mbox doc, do we? # return int(self.collection.get_mbox_attr('rw')) return self.rw def getHierarchicalDelimiter(self): """ Returns the character used to delimite hierarchies in mailboxes. :rtype: str """ return '/' def requestStatus(self, names): """ Handles a status request by gathering the output of the different status commands. :param names: a list of strings containing the status commands :type names: iter """ r = {} maybe = defer.maybeDeferred if self.CMD_MSG in names: r[self.CMD_MSG] = maybe(self.getMessageCount) if self.CMD_RECENT in names: r[self.CMD_RECENT] = maybe(self.getRecentCount) if self.CMD_UIDNEXT in names: r[self.CMD_UIDNEXT] = maybe(self.getUIDNext) if self.CMD_UIDVALIDITY in names: r[self.CMD_UIDVALIDITY] = maybe(self.getUIDValidity) if self.CMD_UNSEEN in names: r[self.CMD_UNSEEN] = maybe(self.getUnseenCount) def as_a_dict(values): return dict(zip(r.keys(), values)) d = defer.gatherResults(r.values()) d.addCallback(as_a_dict) return d def addMessage(self, message, flags, date=None): """ Adds a message to this mailbox. :param message: the raw message :type message: str :param flags: flag list :type flags: list of str :param date: timestamp :type date: str, or None :return: a deferred that will be triggered with the UID of the added message. """ # TODO should raise ReadOnlyMailbox if not rw. # TODO have a look at the cases for internal date in the rfc # XXX we could treat the message as an IMessage from here # TODO -- fast appends should be definitely solved by Blobs. # A better solution will probably involve implementing MULTIAPPEND # extension or patching imap server to support pipelining. if isinstance(message, (cStringIO.OutputType, StringIO.StringIO, io.BytesIO)): message = message.getvalue() leap_assert_type(message, basestring) if flags is None: flags = tuple() else: flags = tuple(str(flag) for flag in flags) if date is None: date = formatdate(time.time()) d = self.collection.add_msg(message, flags, date=date) d.addCallback(lambda message: message.get_uid()) d.addErrback( lambda failure: self.log.failure('Error while adding msg')) return d def notify_new(self, *args): """ Notify of new messages to all the listeners. This will be called indirectly by the underlying collection, that will notify this IMAPMailbox whenever there are changes in the number of messages in the collection, since we have added ourselves to the collection listeners. :param args: ignored. """ def cbNotifyNew(result): exists, recent = result for listener in self.listeners: listener.newMessages(exists, recent) d = self._get_notify_count() d.addCallback(cbNotifyNew) d.addCallback(self.collection.cb_signal_unread_to_ui) d.addErrback(lambda failure: self.log.failure('Error while notify')) def _get_notify_count(self): """ Get message count and recent count for this mailbox. :return: a deferred that will fire with a tuple, with number of messages and number of recent messages. :rtype: Deferred """ # XXX this is way too expensive in cases like multiple APPENDS. # We should have a way of keep a cache or do a self-increment for that # kind of calls. d_exists = defer.maybeDeferred(self.getMessageCount) d_recent = defer.maybeDeferred(self.getRecentCount) d_list = [d_exists, d_recent] def log_num_msg(result): exists, recent = tuple(result) self.log.debug( 'NOTIFY (%r): there are %s messages, %s recent' % ( self.mbox_name, exists, recent)) return result d = defer.gatherResults(d_list) d.addCallback(log_num_msg) return d # commands, do not rename methods def destroy(self): """ Called before this mailbox is permanently deleted. Should cleanup resources, and set the \\Noselect flag on the mailbox. """ # XXX this will overwrite all the existing flags # should better simply addFlag self.setFlags((MessageFlags.NOSELECT_FLAG,)) def remove_mbox(_): uuid = self.collection.mbox_uuid d = self.collection.mbox_wrapper.delete(self.collection.store) d.addCallback( lambda _: self.collection.mbox_indexer.delete_table(uuid)) return d d = self.deleteAllDocs() d.addCallback(remove_mbox) return d def expunge(self): """ Remove all messages flagged \\Deleted """ if not self.isWriteable(): raise imap4.ReadOnlyMailbox return self.collection.delete_all_flagged() def _get_message_fun(self, uid): """ Return the proper method to get a message for this mailbox, depending on the passed uid flag. :param uid: If true, the IDs specified in the query are UIDs; otherwise they are message sequence IDs. :type uid: bool :rtype: callable """ get_message_fun = [ self.collection.get_message_by_sequence_number, self.collection.get_message_by_uid][uid] return get_message_fun def _get_messages_range(self, messages_asked, uid=True): def get_range(messages_asked): return self._filter_msg_seq(messages_asked) d = self._bound_seq(messages_asked, uid) if uid: d.addCallback(get_range) d.addErrback( lambda f: self.log.failure('Error getting msg range')) return d def _bound_seq(self, messages_asked, uid): """ Put an upper bound to a messages sequence if this is open. :param messages_asked: IDs of the messages. :type messages_asked: MessageSet :return: a Deferred that will fire with a MessageSet """ def set_last_uid(last_uid): messages_asked.last = last_uid return messages_asked def set_last_seq(all_uid): messages_asked.last = len(all_uid) return messages_asked if not messages_asked.last: try: iter(messages_asked) except TypeError: # looks like we cannot iterate if uid: d = self.collection.get_last_uid() d.addCallback(set_last_uid) else: d = self.collection.all_uid_iter() d.addCallback(set_last_seq) return d return defer.succeed(messages_asked) def _filter_msg_seq(self, messages_asked): """ Filter a message sequence returning only the ones that do exist in the collection. :param messages_asked: IDs of the messages. :type messages_asked: MessageSet :rtype: set """ # TODO we could pass the asked sequence to the indexer # all_uid_iter, and bound the sql query instead. def filter_by_asked(all_msg_uid): set_asked = set(messages_asked) set_exist = set(all_msg_uid) return set_asked.intersection(set_exist) d = self.collection.all_uid_iter() d.addCallback(filter_by_asked) return d def fetch(self, messages_asked, uid): """ Retrieve one or more messages in this mailbox. from rfc 3501: The data items to be fetched can be either a single atom or a parenthesized list. :param messages_asked: IDs of the messages to retrieve information about :type messages_asked: MessageSet :param uid: If true, the IDs are UIDs. They are message sequence IDs otherwise. :type uid: bool :rtype: deferred with a generator that yields... """ get_msg_fun = self._get_message_fun(uid) getimapmsg = self.get_imap_message def get_imap_messages_for_range(msg_range): def _get_imap_msg(messages): d_imapmsg = [] # just in case we got bad data in here for msg in filter(None, messages): d_imapmsg.append(getimapmsg(msg)) return defer.gatherResults(d_imapmsg, consumeErrors=True) def _zip_msgid(imap_messages): zipped = zip( list(msg_range), imap_messages) return (item for item in zipped) # XXX not called?? def _unset_recent(sequence): reactor.callLater(0, self.unset_recent_flags, sequence) return sequence d_msg = [] for msgid in msg_range: # XXX We want cdocs because we "probably" are asked for the # body. We should be smarter at do_FETCH and pass a parameter # to this method in order not to prefetch cdocs if they're not # going to be used. d_msg.append(get_msg_fun(msgid, get_cdocs=True)) d = defer.gatherResults(d_msg, consumeErrors=True) d.addCallback(_get_imap_msg) d.addCallback(_zip_msgid) d.addErrback( lambda failure: self.log.error( 'Error getting msg for range')) return d d = self._get_messages_range(messages_asked, uid) d.addCallback(get_imap_messages_for_range) d.addErrback( lambda failure: self.log.failure('Error on fetch')) return d def fetch_flags(self, messages_asked, uid): """ A fast method to fetch all flags, tricking just the needed subset of the MIME interface that's needed to satisfy a generic FLAGS query. Given how LEAP Mail is supposed to work without local cache, this query is going to be quite common, and also we expect it to be in the form 1:* at the beginning of a session, so<|fim▁hole|> :param messages_asked: IDs of the messages to retrieve information about :type messages_asked: MessageSet :param uid: If 1, the IDs are UIDs. They are message sequence IDs otherwise. :type uid: int :return: A tuple of two-tuples of message sequence numbers and flagsPart, which is a only a partial implementation of MessagePart. :rtype: tuple """ # is_sequence = True if uid == 0 else False # XXX FIXME ----------------------------------------------------- # imap/tests, or muas like mutt, it will choke until we implement # sequence numbers. This is an easy hack meanwhile. is_sequence = False # --------------------------------------------------------------- if is_sequence: raise NotImplementedError( "FETCH FLAGS NOT IMPLEMENTED FOR MESSAGE SEQUENCE NUMBERS YET") d = defer.Deferred() reactor.callLater(0, self._do_fetch_flags, messages_asked, uid, d) return d def _do_fetch_flags(self, messages_asked, uid, d): """ :param messages_asked: IDs of the messages to retrieve information about :type messages_asked: MessageSet :param uid: If 1, the IDs are UIDs. They are message sequence IDs otherwise. :type uid: int :param d: deferred whose callback will be called with result. :type d: Deferred :rtype: A generator that yields two-tuples of message sequence numbers and flagsPart """ class flagsPart(object): def __init__(self, uid, flags): self.uid = uid self.flags = flags def getUID(self): return self.uid def getFlags(self): return map(str, self.flags) def pack_flags(result): _uid, _flags = result return _uid, flagsPart(_uid, _flags) def get_flags_for_seq(sequence): d_all_flags = [] for msgid in sequence: # TODO implement sequence numbers here too d_flags_per_uid = self.collection.get_flags_by_uid(msgid) d_flags_per_uid.addCallback(pack_flags) d_all_flags.append(d_flags_per_uid) gotflags = defer.gatherResults(d_all_flags) gotflags.addCallback(get_uid_flag_generator) return gotflags def get_uid_flag_generator(result): generator = (item for item in result) d.callback(generator) d_seq = self._get_messages_range(messages_asked, uid) d_seq.addCallback(get_flags_for_seq) return d_seq @defer.inlineCallbacks def fetch_headers(self, messages_asked, uid): """ A fast method to fetch all headers, tricking just the needed subset of the MIME interface that's needed to satisfy a generic HEADERS query. Given how LEAP Mail is supposed to work without local cache, this query is going to be quite common, and also we expect it to be in the form 1:* at the beginning of a session, so **MAYBE** it's not too bad to fetch all the HEADERS docs at once. :param messages_asked: IDs of the messages to retrieve information about :type messages_asked: MessageSet :param uid: If true, the IDs are UIDs. They are message sequence IDs otherwise. :type uid: bool :return: A tuple of two-tuples of message sequence numbers and headersPart, which is a only a partial implementation of MessagePart. :rtype: tuple """ # TODO implement sequences is_sequence = True if uid == 0 else False if is_sequence: raise NotImplementedError( "FETCH HEADERS NOT IMPLEMENTED FOR SEQUENCE NUMBER YET") class headersPart(object): def __init__(self, uid, headers): self.uid = uid self.headers = headers def getUID(self): return self.uid def getHeaders(self, _): return dict( (str(key), str(value)) for key, value in self.headers.items()) messages_asked = yield self._bound_seq(messages_asked, uid) seq_messg = yield self._filter_msg_seq(messages_asked) result = [] for msgid in seq_messg: msg = yield self.collection.get_message_by_uid(msgid) headers = headersPart(msgid, msg.get_headers()) result.append((msgid, headers)) defer.returnValue(iter(result)) def store(self, messages_asked, flags, mode, uid): """ Sets the flags of one or more messages. :param messages: The identifiers of the messages to set the flags :type messages: A MessageSet object with the list of messages requested :param flags: The flags to set, unset, or add. :type flags: sequence of str :param mode: If mode is -1, these flags should be removed from the specified messages. If mode is 1, these flags should be added to the specified messages. If mode is 0, all existing flags should be cleared and these flags should be added. :type mode: -1, 0, or 1 :param uid: If true, the IDs specified in the query are UIDs; otherwise they are message sequence IDs. :type uid: bool :return: A deferred, that will be called with a dict mapping message sequence numbers to sequences of str representing the flags set on the message after this operation has been performed. :rtype: deferred :raise ReadOnlyMailbox: Raised if this mailbox is not open for read-write. """ if not self.isWriteable(): self.log.info('Read only mailbox!') raise imap4.ReadOnlyMailbox d = defer.Deferred() reactor.callLater(0, self._do_store, messages_asked, flags, mode, uid, d) d.addCallback(self.collection.cb_signal_unread_to_ui) d.addErrback(lambda f: self.log.error('Error on store')) return d def _do_store(self, messages_asked, flags, mode, uid, observer): """ Helper method, invoke set_flags method in the IMAPMessageCollection. See the documentation for the `store` method for the parameters. :param observer: a deferred that will be called with the dictionary mapping UIDs to flags after the operation has been done. :type observer: deferred """ # TODO we should prevent client from setting Recent flag get_msg_fun = self._get_message_fun(uid) leap_assert(not isinstance(flags, basestring), "flags cannot be a string") flags = tuple(flags) def set_flags_for_seq(sequence): def return_result_dict(list_of_flags): result = dict(zip(list(sequence), list_of_flags)) observer.callback(result) return result d_all_set = [] for msgid in sequence: d = get_msg_fun(msgid) d.addCallback(lambda msg: self.collection.update_flags( msg, flags, mode)) d_all_set.append(d) got_flags_setted = defer.gatherResults(d_all_set) got_flags_setted.addCallback(return_result_dict) return got_flags_setted d_seq = self._get_messages_range(messages_asked, uid) d_seq.addCallback(set_flags_for_seq) return d_seq # ISearchableMailbox def search(self, query, uid): """ Search for messages that meet the given query criteria. Warning: this is half-baked, and it might give problems since it offers the SearchableInterface. We'll be implementing it asap. :param query: The search criteria :type query: list :param uid: If true, the IDs specified in the query are UIDs; otherwise they are message sequence IDs. :type uid: bool :return: A list of message sequence numbers or message UIDs which match the search criteria or a C{Deferred} whose callback will be invoked with such a list. :rtype: C{list} or C{Deferred} """ # TODO see if we can raise w/o interrupting flow # :raise IllegalQueryError: Raised when query is not valid. # example query: # ['UNDELETED', 'HEADER', 'Message-ID', # XXX fixme, does not exist # '[email protected]'] # TODO hardcoding for now! -- we'll support generic queries later on # but doing a quickfix for avoiding duplicate saves in the draft # folder. # See issue #4209 if len(query) > 2: if query[1] == 'HEADER' and query[2].lower() == "message-id": msgid = str(query[3]).strip() self.log.debug('Searching for %s' % (msgid,)) d = self.collection.get_uid_from_msgid(str(msgid)) d.addCallback(lambda result: [result]) return d # nothing implemented for any other query self.log.warn('Cannot process query: %s' % (query,)) return [] # IMessageCopier def copy(self, message): """ Copy the given message object into this mailbox. :param message: an IMessage implementor :type message: LeapMessage :return: a deferred that will be fired with the message uid when the copy succeed. :rtype: Deferred """ d = self.collection.copy_msg( message.message, self.collection.mbox_uuid) return d # convenience fun def deleteAllDocs(self): """ Delete all docs in this mailbox """ # FIXME not implemented return self.collection.delete_all_docs() def unset_recent_flags(self, uid_seq): """ Unset Recent flag for a sequence of UIDs. """ # FIXME not implemented return self.collection.unset_recent_flags(uid_seq) def __repr__(self): """ Representation string for this mailbox. """ return u"<IMAPMailbox: mbox '%s' (%s)>" % ( self.mbox_name, self.collection.count()) _INBOX_RE = re.compile(INBOX_NAME, re.IGNORECASE) def normalize_mailbox(name): """ Return a normalized representation of the mailbox ``name``. This method ensures that an eventual initial 'inbox' part of a mailbox name is made uppercase. :param name: the name of the mailbox :type name: unicode :rtype: unicode """ # XXX maybe it would make sense to normalize common folders too: # trash, sent, drafts, etc... if _INBOX_RE.match(name): # ensure inital INBOX is uppercase return INBOX_NAME + name[len(INBOX_NAME):] return name<|fim▁end|>
it's not bad to fetch all the FLAGS docs at once.
<|file_name|>app-bootstrap.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { BehaviorSubject } from 'rxjs'; import { AppLocalization } from '@kaltura-ng/mc-shared'; import { AppAuthentication } from './app-authentication.service'; import { kmcAppConfig } from '../../../kmc-app/kmc-app-config'; import { globalConfig } from 'config/global'; import { BrowserService } from 'app-shared/kmc-shell/providers/browser.service'; import { serverConfig } from 'config/server'; export enum BoostrappingStatus { Bootstrapping, Error, Bootstrapped } @Injectable() export class AppBootstrap implements CanActivate { private static _executed = false; private _initialized = false; private _bootstrapStatusSource = new BehaviorSubject<BoostrappingStatus>(BoostrappingStatus.Bootstrapping); bootstrapStatus$ = this._bootstrapStatusSource.asObservable(); constructor(private appLocalization: AppLocalization, private auth: AppAuthentication, private _browserService: BrowserService) { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> { if (!AppBootstrap._executed) { AppBootstrap._executed = true; this._bootstrap(); } return Observable.create((observer: any) => { const statusChangeSubscription = this.bootstrapStatus$.subscribe( (status: BoostrappingStatus) => { if (status === BoostrappingStatus.Bootstrapped) { observer.next(true); observer.complete(); if (statusChangeSubscription) statusChangeSubscription.unsubscribe(); } else { if (status === BoostrappingStatus.Error) { observer.next(false); observer.complete(); // we must modify document.location instead of using Angular router because // router is not supported until at least once component // was initialized document.location.href = kmcAppConfig.routing.errorRoute; if (statusChangeSubscription) statusChangeSubscription.unsubscribe(); } } }, () => { // error with configuration observer.next(false); observer.complete(); // we must modify document.location instead of using Angular router because // router is not supported until at least once component // was initialized document.location.href = kmcAppConfig.routing.errorRoute; if (statusChangeSubscription) statusChangeSubscription.unsubscribe(); } ); }); } private _bootstrap(): void { if (!this._initialized) { const bootstrapFailure = (error: any) => { console.log("Bootstrap Error::" + error); // TODO [kmc-infra] - move to log this._bootstrapStatusSource.next(BoostrappingStatus.Error); } this._initialized = true; // init localization, wait for localization to load before continuing const prefix = serverConfig.kalturaServer.deployUrl ? `${serverConfig.kalturaServer.deployUrl}i18n/` : null; this.appLocalization.setFilesHash(globalConfig.client.appVersion, prefix); const language = this.getCurrentLanguage(); this.appLocalization.load(language, 'en').subscribe( () => { this._bootstrapStatusSource.next(BoostrappingStatus.Bootstrapped); }, (error) => { bootstrapFailure(error); } ); } }<|fim▁hole|> private getCurrentLanguage(): string { let lang: string = null; // try getting last selected language from local storage if (this._browserService.getFromLocalStorage('kmc_lang') !== null) { const userLanguage: string = this._browserService.getFromLocalStorage('kmc_lang'); if (kmcAppConfig.locales.find(locale => locale.id === userLanguage)) { lang = userLanguage; } } return lang === null ? "en" : lang; } }<|fim▁end|>
<|file_name|>TurtleCommands.py<|end_file_name|><|fim▁begin|>__author__ = 'Alex' from Movement import Movement class BaseCommand: def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'unknown' self.m = movement def execute(selfself):pass class Forward(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'forward' self.m = movement def execute(self): self.m.moveCM(10)<|fim▁hole|>class Reverse(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'reverse' self.m = movement def execute(self): self.m.moveCM(10) class Left(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'left' self.m = movement def execute(self): self.m.turnDegrees(-90) class Right(BaseCommand): def __init__(self, movement): assert isinstance(movement, Movement) self.name = 'right' self.m = movement def execute(self): self.m.turnDegrees(90)<|fim▁end|>
<|file_name|>unit.js<|end_file_name|><|fim▁begin|>const sinon = require('sinon'); const sinonChai = require('sinon-chai'); const chai = require('chai'); const dirtyChai = require('dirty-chai'); const should = chai.Should; should(); chai.use(dirtyChai); chai.use(sinonChai); const index = require('./../src/index.js'); const error = new Error('should not be called'); describe('node-vault', () => { describe('module', () => { it('should export a function that returns a new client', () => { const v = index(); index.should.be.a('function'); v.should.be.an('object'); }); }); describe('client', () => { let request = null; let response = null; let vault = null; // helper function getURI(path) { return [vault.endpoint, vault.apiVersion, path].join('/'); } function assertRequest(thisRequest, params, done) { return () => { thisRequest.should.have.calledOnce(); thisRequest.calledWithMatch(params).should.be.ok(); return done(); }; } beforeEach(() => { // stub requests request = sinon.stub(); response = sinon.stub(); response.statusCode = 200; request.returns({ then(fn) { return fn(response); }, catch(fn) { return fn(); }, }); vault = index( { endpoint: 'http://localhost:8200', token: '123', 'request-promise': request, // dependency injection of stub } ); }); describe('help(path, options)', () => { it('should response help text for any path', done => { const path = 'sys/policy'; const params = { method: 'GET', uri: `${getURI(path)}?help=1`, }; vault.help(path) .then(assertRequest(request, params, done)) .catch(done); }); it('should handle undefined options', done => { const path = 'sys/policy'; const params = { method: 'GET', uri: `${getURI(path)}?help=1`, }; vault.help(path) .then(assertRequest(request, params, done)) .catch(done); }); }); describe('list(path, requestOptions)', () => { it('should list entries at the specific path', done => { const path = 'secret/hello'; const params = { method: 'LIST', uri: getURI(path), }; vault.list(path) .then(assertRequest(request, params, done)) .catch(done); }); }); describe('write(path, data, options)', () => { it('should write data to path', done => { const path = 'secret/hello'; const data = { value: 'world', }; const params = { method: 'PUT', uri: getURI(path), }; vault.write(path, data) .then(assertRequest(request, params, done)) .catch(done); }); it('should handle undefined options', done => { const path = 'secret/hello'; const data = { value: 'world', }; const params = { method: 'PUT', uri: getURI(path), }; vault.write(path, data) .then(assertRequest(request, params, done)) .catch(done); }); }); describe('read(path, options)', () => { it('should read data from path', done => { const path = 'secret/hello'; const params = { method: 'GET', uri: getURI(path), }; vault.read(path) .then(assertRequest(request, params, done)) .catch(done); }); it('should handle undefined options', done => { const path = 'secret/hello'; const params = { method: 'GET', uri: getURI(path), }; vault.read(path) .then(assertRequest(request, params, done)) .catch(done); }); }); describe('delete(path, options)', () => { it('should delete data from path', done => { const path = 'secret/hello'; const params = { method: 'DELETE', uri: getURI(path), }; vault.delete(path) .then(assertRequest(request, params, done)) .catch(done); }); it('should handle undefined options', done => { const path = 'secret/hello'; const params = { method: 'DELETE', uri: getURI(path), }; vault.delete(path) .then(assertRequest(request, params, done)) .catch(done); }); }); describe('handleVaultResponse(response)', () => { it('should return a function that handles errors from vault server', () => { const fn = vault.handleVaultResponse; fn.should.be.a('function'); }); it('should return a Promise with the body if successful', done => { const data = { hello: 1 }; response.body = data; const promise = vault.handleVaultResponse(response); promise.then(body => { body.should.equal(data); return done(); }); }); it('should return a Promise with the error if failed', done => { response.statusCode = 500; response.body = { errors: ['Something went wrong.'], }; response.request = { path: 'test', }; const promise = vault.handleVaultResponse(response); promise.catch(err => { err.message.should.equal(response.body.errors[0]); return done(); }); }); it('should return the status code if no error in the response', done => { response.statusCode = 500; response.request = { path: 'test', }; const promise = vault.handleVaultResponse(response); promise.catch(err => { err.message.should.equal(`Status ${response.statusCode}`); return done(); }); }); it('should not handle response from health route as error', done => { const data = { initialized: true, sealed: true, standby: true, server_time_utc: 1474301338, version: 'Vault v0.6.1', }; response.statusCode = 503; response.body = data; response.request = { path: '/v1/sys/health', }; const promise = vault.handleVaultResponse(response); promise.then(body => { body.should.equal(data); return done(); }); }); it('should return error if error on request path with health and not sys/health', done => { response.statusCode = 404; response.body = { errors: [], }; response.request = { path: '/v1/sys/policies/applications/im-not-sys-health/app', }; vault.handleVaultResponse(response) .then(() => done(error)) .catch(err => { err.message.should.equal(`Status ${response.statusCode}`); return done(); }); }); it('should return a Promise with the error if no response is passed', done => { const promise = vault.handleVaultResponse(); promise.catch((err) => { err.message.should.equal('No response passed'); return done(); }); }); }); describe('generateFunction(name, config)', () => { const config = { method: 'GET', path: '/myroute', }; const configWithSchema = { method: 'GET', path: '/myroute', schema: { req: { type: 'object', properties: { testProperty: { type: 'integer', minimum: 1, }, }, required: ['testProperty'], }, }, }; const configWithQuerySchema = { method: 'GET', path: '/myroute', schema: { query: { type: 'object', properties: {<|fim▁hole|> }, testParam2: { type: 'string', }, }, required: ['testParam1', 'testParam2'], }, }, }; it('should generate a function with name as defined in config', () => { const name = 'myGeneratedFunction'; vault.generateFunction(name, config); vault.should.have.property(name); const fn = vault[name]; fn.should.be.a('function'); }); describe('generated function', () => { it('should return a promise', done => { const name = 'myGeneratedFunction'; vault.generateFunction(name, config); const fn = vault[name]; const promise = fn(); request.calledOnce.should.be.ok(); /* eslint no-unused-expressions: 0*/ promise.should.be.promise; promise.then(done) .catch(done); }); it('should handle config with schema property', done => { const name = 'myGeneratedFunction'; vault.generateFunction(name, configWithSchema); const fn = vault[name]; const promise = fn({ testProperty: 3 }); promise.then(done).catch(done); }); it('should handle invalid arguments via schema property', done => { const name = 'myGeneratedFunction'; vault.generateFunction(name, configWithSchema); const fn = vault[name]; const promise = fn({ testProperty: 'wrong data type here' }); promise.catch(err => { err.message.should.equal('Invalid type: string (expected integer)'); return done(); }); }); it('should handle schema with query property', done => { const name = 'myGeneratedFunction'; vault.generateFunction(name, configWithQuerySchema); const fn = vault[name]; const promise = fn({ testParam1: 3, testParam2: 'hello' }); const options = { path: '/myroute?testParam1=3&testParam2=hello', }; promise .then(() => { request.calledWithMatch(options).should.be.ok(); done(); }) .catch(done); }); }); }); describe('request(options)', () => { it('should reject if options are undefined', done => { vault.request() .then(() => done(error)) .catch(() => done()); }); it('should handle undefined path in options', done => { const promise = vault.request({ method: 'GET', }); promise.catch(err => { err.message.should.equal('Missing required property: path'); return done(); }); }); it('should handle undefined method in options', done => { const promise = vault.request({ path: '/', }); promise.catch(err => { err.message.should.equal('Missing required property: method'); return done(); }); }); }); }); });<|fim▁end|>
testParam1: { type: 'integer', minimum: 1,
<|file_name|>ut.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- # @file ut.py # @brief The main unit test program of whole project # README: organize the unit tests in the number range # refer UTGeneral functions # print the suggested procedure in the console # print the suggested check procedure in the console # support current supported important features # this unit test include in the release procedure # MODULE_ARCH: # CLASS_ARCH: UTGeneral # GLOBAL USAGE: #standard import unittest #homemake import lib.globalclasses as gc from lib.const import * ##### Unit test section #### #the test ID provide the order of testes. class UTGeneral(unittest.TestCase): #local #ID:0-99 def test_01_setting_signature(self): print("\nThe expected unit test environment is") print("1. TBD") self.assertEqual(gc.SETTING["SIGNATURE"],'LASS-SIM') def test_02_check_library(self): #check external library that need to be installed<|fim▁hole|> import requests from vincenty import vincenty import matplotlib import numpy import pygrib def test_03_check_dir_exist(self): pass def test_04_check_grib(self): import pygrib # import pygrib interface to grib_api grbs = pygrib.open('include/M-A0060-000.grb2') print("grbs[:4] count=%i" %(len(grbs[:4]))) def test_11_loadjson(self): gc.LASSDATA.load_site_list() print("LASS sites count = %i" % (len(gc.LASSDATA.sites))) self.assertTrue(len(gc.LASSDATA.sites)>0)<|fim▁end|>
import simpy from configobj import ConfigObj import urllib import simplejson
<|file_name|>SocialPreview.uni.driver.d.ts<|end_file_name|><|fim▁begin|>import { BaseUniDriver } from 'wix-ui-test-utils/base-driver'; import { SocialPreviewSize, SocialPreviewSkin } from './index'; <|fim▁hole|> getDescription: () => Promise<string>; getSkin: () => Promise<SocialPreviewSkin>; getSize: () => Promise<SocialPreviewSize>; }<|fim▁end|>
export interface SocialPreviewUniDriver extends BaseUniDriver { getTitle: () => Promise<string>; getPreviewUrl: () => Promise<string>;
<|file_name|>core.client.routes.js<|end_file_name|><|fim▁begin|>'use strict'; <|fim▁hole|> function($stateProvider, $urlRouterProvider) { // Redirect to home view when route not found $urlRouterProvider.otherwise('/'); // Home state routing $stateProvider. state('home', { url: '/', templateUrl: 'modules/core/views/home.client.view.html' }). state('presupuesto',{ url: '/presupuesto', templateUrl: 'modules/productos/views/productos.pedido.client.view.html' }); } ]);<|fim▁end|>
// Setting up route angular.module('core').config(['$stateProvider', '$urlRouterProvider',
<|file_name|>MultiSelection.cpp<|end_file_name|><|fim▁begin|>#include "MultiSelection.h" #include "ofxCogEngine.h" #include "EnumConverter.h" #include "Node.h" namespace Cog { void MultiSelection::Load(Setting& setting) { string group = setting.GetItemVal("selection_group"); if (group.empty()) CogLogError("MultiSelection", "Error while loading MultiSelection behavior: expected parameter selection_group"); this->selectionGroup = StrId(group); // load all attributes string defaultImg = setting.GetItemVal("default_img"); string selectedImg = setting.GetItemVal("selected_img"); if (!defaultImg.empty() && !selectedImg.empty()) { this->defaultImg = CogGet2DImage(defaultImg); this->selectedImg = CogGet2DImage(selectedImg); } else { string defaultColorStr = setting.GetItemVal("default_color"); string selectedColorStr = setting.GetItemVal("selected_color"); if (!defaultColorStr.empty() && !selectedColorStr.empty()) { this->defaultColor = EnumConverter::StrToColor(defaultColorStr); this->selectedColor = EnumConverter::StrToColor(selectedColorStr); } } } void MultiSelection::OnInit() { SubscribeForMessages(ACT_OBJECT_HIT_ENDED, ACT_STATE_CHANGED); } void MultiSelection::OnStart() { CheckState(); owner->SetGroup(selectionGroup); } void MultiSelection::OnMessage(Msg& msg) { if (msg.HasAction(ACT_OBJECT_HIT_ENDED) && msg.GetContextNode()->IsInGroup(selectionGroup)) { // check if the object has been clicked (user could hit a different area and release touch over the button) auto evt = msg.GetDataPtr<InputEvent>(); if (evt->input->handlerNodeId == msg.GetContextNode()->GetId()) { ProcessHit(msg, false); } } else if (msg.HasAction(ACT_STATE_CHANGED) && msg.GetContextNode()->IsInGroup(selectionGroup)) { ProcessHit(msg, true); // set directly, because STATE_CHANGED event has been already invoked } } void MultiSelection::ProcessHit(Msg& msg, bool setDirectly) { if (msg.GetContextNode()->GetId() == owner->GetId()) { // selected actual node if (!owner->HasState(selectedState)) { if (setDirectly) owner->GetStates().SetState(selectedState); else owner->SetState(selectedState); SendMessage(ACT_OBJECT_SELECTED); CheckState(); } else { CheckState(); } } else { if (owner->HasState(selectedState)) { if (setDirectly) owner->GetStates().ResetState(selectedState); else owner->ResetState(selectedState); CheckState(); } } } void MultiSelection::CheckState() { if (owner->HasState(selectedState)) { if (selectedImg) { owner->GetMesh<Image>()->SetImage(selectedImg);<|fim▁hole|> } else { owner->GetMesh()->SetColor(selectedColor); } } else if (!owner->HasState(selectedState)) { if (defaultImg) { owner->GetMesh<Image>()->SetImage(defaultImg); } else { owner->GetMesh()->SetColor(defaultColor); } } } }// namespace<|fim▁end|>
<|file_name|>test_h5p.py<|end_file_name|><|fim▁begin|># This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. import unittest as ut from h5py import h5p, h5f, version from .common import TestCase class TestLibver(TestCase): """ Feature: Setting/getting lib ver bounds """ def test_libver(self): """ Test libver bounds set/get """ plist = h5p.create(h5p.FILE_ACCESS) plist.set_libver_bounds(h5f.LIBVER_EARLIEST, h5f.LIBVER_LATEST) self.assertEqual((h5f.LIBVER_EARLIEST, h5f.LIBVER_LATEST), plist.get_libver_bounds()) @ut.skipIf(version.hdf5_version_tuple < (1, 10, 2), 'Requires HDF5 1.10.2 or later') def test_libver_v18(self): """ Test libver bounds set/get for H5F_LIBVER_V18""" plist = h5p.create(h5p.FILE_ACCESS) plist.set_libver_bounds(h5f.LIBVER_EARLIEST, h5f.LIBVER_V18) self.assertEqual((h5f.LIBVER_EARLIEST, h5f.LIBVER_V18), plist.get_libver_bounds()) @ut.skipIf(version.hdf5_version_tuple < (1, 10, 2), 'Requires HDF5 1.10.2 or later') def test_libver_v110(self): """ Test libver bounds set/get for H5F_LIBVER_V110""" plist = h5p.create(h5p.FILE_ACCESS) plist.set_libver_bounds(h5f.LIBVER_V18, h5f.LIBVER_V110) self.assertEqual((h5f.LIBVER_V18, h5f.LIBVER_V110), plist.get_libver_bounds()) @ut.skipIf(version.hdf5_version_tuple < (1, 11, 4), 'Requires HDF5 1.11.4 or later') def test_libver_v112(self): """ Test libver bounds set/get for H5F_LIBVER_V112""" plist = h5p.create(h5p.FILE_ACCESS) plist.set_libver_bounds(h5f.LIBVER_V18, h5f.LIBVER_V112) self.assertEqual((h5f.LIBVER_V18, h5f.LIBVER_V112), plist.get_libver_bounds()) class TestDA(TestCase): ''' Feature: setting/getting chunk cache size on a dataset access property list ''' def test_chunk_cache(self): '''test get/set chunk cache ''' dalist = h5p.create(h5p.DATASET_ACCESS) nslots = 10000 # 40kb hash table nbytes = 1000000 # 1MB cache size w0 = .5 # even blend of eviction strategy dalist.set_chunk_cache(nslots, nbytes, w0) self.assertEqual((nslots, nbytes, w0), dalist.get_chunk_cache()) class TestFA(TestCase): ''' Feature: setting/getting mdc config on a file access property list ''' def test_mdc_config(self): '''test get/set mdc config ''' falist = h5p.create(h5p.FILE_ACCESS) config = falist.get_mdc_config() falist.set_mdc_config(config) def test_set_alignment(self): '''test get/set chunk cache ''' falist = h5p.create(h5p.FILE_ACCESS) threshold = 10 * 1024 # threshold of 10kiB alignment = 1024 * 1024 # threshold of 1kiB falist.set_alignment(threshold, alignment) self.assertEqual((threshold, alignment), falist.get_alignment()) @ut.skipUnless( version.hdf5_version_tuple >= (1, 12, 1) or (version.hdf5_version_tuple[:2] == (1, 10) and version.hdf5_version_tuple[2] >= 7), 'Requires HDF5 1.12.1 or later or 1.10.x >= 1.10.7') def test_set_file_locking(self): '''test get/set file locking''' falist = h5p.create(h5p.FILE_ACCESS) use_file_locking = False ignore_when_disabled = False falist.set_file_locking(use_file_locking, ignore_when_disabled) self.assertEqual((use_file_locking, ignore_when_disabled), falist.get_file_locking()) class TestPL(TestCase): def test_obj_track_times(self): """ tests if the object track times set/get """ # test for groups gcid = h5p.create(h5p.GROUP_CREATE) gcid.set_obj_track_times(False) self.assertEqual(False, gcid.get_obj_track_times()) gcid.set_obj_track_times(True) self.assertEqual(True, gcid.get_obj_track_times()) # test for datasets dcid = h5p.create(h5p.DATASET_CREATE) dcid.set_obj_track_times(False) self.assertEqual(False, dcid.get_obj_track_times()) dcid.set_obj_track_times(True) self.assertEqual(True, dcid.get_obj_track_times()) # test for generic objects ocid = h5p.create(h5p.OBJECT_CREATE) ocid.set_obj_track_times(False) self.assertEqual(False, ocid.get_obj_track_times()) ocid.set_obj_track_times(True) self.assertEqual(True, ocid.get_obj_track_times())<|fim▁hole|> def test_link_creation_tracking(self): """ tests the link creation order set/get """ gcid = h5p.create(h5p.GROUP_CREATE) gcid.set_link_creation_order(0) self.assertEqual(0, gcid.get_link_creation_order()) flags = h5p.CRT_ORDER_TRACKED | h5p.CRT_ORDER_INDEXED gcid.set_link_creation_order(flags) self.assertEqual(flags, gcid.get_link_creation_order()) # test for file creation fcpl = h5p.create(h5p.FILE_CREATE) fcpl.set_link_creation_order(flags) self.assertEqual(flags, fcpl.get_link_creation_order()) def test_attr_phase_change(self): """ test the attribute phase change """ cid = h5p.create(h5p.OBJECT_CREATE) # test default value ret = cid.get_attr_phase_change() self.assertEqual((8,6), ret) # max_compact must < 65536 (64kb) with self.assertRaises(ValueError): cid.set_attr_phase_change(65536, 6) # Using dense attributes storage to avoid 64kb size limitation # for a single attribute in compact attribute storage. cid.set_attr_phase_change(0, 0) self.assertEqual((0,0), cid.get_attr_phase_change())<|fim▁end|>
<|file_name|>0040_auto_20191120_2258.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2019-11-21 04:58 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('posgradmin', '0039_auto_20191120_2249'), ] operations = [ migrations.AlterModelOptions( name='profesor', options={'ordering': ['user__first_name', 'user__last_name'], 'verbose_name_plural': 'Profesores'}, ),<|fim▁hole|> ]<|fim▁end|>
<|file_name|>reduction.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, absolute_import, division import os import theano from theano.gof import Op, Apply from theano.gof.type import Generic from .basic_ops import (infer_context_name, as_gpuarray_variable) from .type import GpuArrayType try: import pygpu except ImportError as e: pass<|fim▁hole|>class GpuMaxAndArgmax(Op): """ GPU version of MaxAndArgmax """ params_type = Generic() __props__ = ('axis',) argmax_dtype = "int64" def __init__(self, axis): assert isinstance(axis, (list, tuple)) self.axis = tuple(axis) def get_params(self, node): return self.axis def make_node(self, X): context_name = infer_context_name(X) # We keep the original broadcastable flags for dimensions on which # we do not perform the max / argmax. all_axes = set(self.axis) broadcastable = [b for i, b in enumerate(X.type.broadcastable) if i not in all_axes] inputs = [as_gpuarray_variable(X, context_name)] outputs = [GpuArrayType(X.type.dtype, broadcastable, context_name=context_name, name='max')(), GpuArrayType(self.argmax_dtype, broadcastable, context_name=context_name, name='argmax')()] return Apply(self, inputs, outputs) def c_headers(self): return ['<numpy_compat.h>', '<gpuarray_helper.h>'] def c_header_dirs(self): return [pygpu.get_include(), os.path.dirname(__file__)] def c_code(self, node, name, input_names, output_names, sub): # Recall: X = input_names[0] # Recall: axes = sub['params'] # Recall: max, argmax = output_names # Recall: fail = sub['fail'] max_typecode = pygpu.gpuarray.dtype_to_typecode(node.inputs[0].dtype) argmax_typecode = pygpu.gpuarray.dtype_to_typecode(self.argmax_dtype) ret = """ #if PY_MAJOR_VERSION >= 3 #ifndef PyInt_AS_LONG #define PyInt_AS_LONG PyLong_AS_LONG #endif #endif int err = 0; unsigned %(name)s_redux_len = PyTuple_GET_SIZE(%(axes)s); unsigned* %(name)s_axes_to_reduce = (unsigned*)malloc(%(name)s_redux_len * sizeof(unsigned)); for (unsigned i = 0; i < %(name)s_redux_len; ++i) { PyObject* axis_object = PyTuple_GET_ITEM(%(axes)s, i); %(name)s_axes_to_reduce[i] = (unsigned) PyInt_AS_LONG(axis_object); } size_t %(name)s_input_ndim = PyGpuArray_NDIM(%(X)s); size_t %(name)s_output_ndim = %(name)s_input_ndim - %(name)s_redux_len; size_t* %(name)s_output_dims = (size_t*)malloc(%(name)s_output_ndim * sizeof(size_t)); if (%(name)s_redux_len == 1) { for (unsigned i = 0; i < %(name)s_axes_to_reduce[0]; ++i) { %(name)s_output_dims[i] = PyGpuArray_DIM(%(X)s, i); } for (unsigned i = %(name)s_axes_to_reduce[0] + 1; i < %(name)s_input_ndim; ++i) { %(name)s_output_dims[i-1] = PyGpuArray_DIM(%(X)s, i); } } else { int64_t current_input_pos = -1; int64_t current_output_pos = -1; for (unsigned i = 0; i < %(name)s_redux_len; ++i) { for (++current_input_pos; current_input_pos < %(name)s_axes_to_reduce[i]; ++current_input_pos) { %(name)s_output_dims[++current_output_pos] = PyGpuArray_DIM(%(X)s, current_input_pos); } } for (++current_input_pos; current_input_pos < %(name)s_input_ndim; ++current_input_pos) { %(name)s_output_dims[++current_output_pos] = PyGpuArray_DIM(%(X)s, current_input_pos); } } if (theano_prep_output(&%(max)s, %(name)s_output_ndim, %(name)s_output_dims, %(max_typecode)s, GA_C_ORDER, %(X)s->context)) { PyErr_SetString(PyExc_RuntimeError, "GpuMaxAndArgmax: unable to prepare max output."); %(fail)s } if (theano_prep_output(&%(argmax)s, %(name)s_output_ndim, %(name)s_output_dims, %(argmax_typecode)s, GA_C_ORDER, %(X)s->context)) { PyErr_SetString(PyExc_RuntimeError, "GpuMaxAndArgmax: unable to prepare argmax output."); %(fail)s } if (%(name)s_input_ndim == 0) { /* GpuArray_maxandargmax can't handle a 0-d array * because it expects that 1 <= redux_len <= input_ndim. * As input_ndim == 0, then 1 <= redux_len <= 0 is false. * To handle this case we copy input to max and we set argmax to 0. */ if (GA_NO_ERROR != GpuArray_setarray(&%(max)s->ga, &%(X)s->ga)) { PyErr_SetString(PyExc_RuntimeError, "GpuMaxAndArgmax: unable to copy input to max when input is a scalar."); %(fail)s } if (GA_NO_ERROR != GpuArray_memset(&%(argmax)s->ga, 0)) { PyErr_SetString(PyExc_RuntimeError, "GpuMaxAndArgmax: unable to set argmax to 0 when input is a scalar."); %(fail)s } } else if (GA_NO_ERROR != (err = GpuArray_maxandargmax(&%(max)s->ga, &%(argmax)s->ga, &%(X)s->ga, %(name)s_redux_len, %(name)s_axes_to_reduce) )) { PyErr_Format(PyExc_RuntimeError, "GpuMaxAndArgmax: unable to compute gpuarray maxandargmax: error %%d: %%s (%%s).", err, gpuarray_error_str(err), GpuArray_error(&%(X)s->ga, err)); %(fail)s } """ if theano.config.gpuarray.sync: ret += """ GpuArray_sync(&%(max)s->ga); GpuArray_sync(&%(argmax)s->ga); """ return ret % {'X': input_names[0], 'axes': sub['params'], 'max': output_names[0], 'argmax': output_names[1], 'max_typecode': max_typecode, 'argmax_typecode': argmax_typecode, 'name': name, 'fail': sub['fail']} def c_code_cleanup(self, node, name, inputs, outputs, sub): return """ free(%(name)s_output_dims); free(%(name)s_axes_to_reduce); """ % {'name': name, 'X': inputs[0]} def c_code_cache_version(self): return (1, 1)<|fim▁end|>
<|file_name|>cargo.rs<|end_file_name|><|fim▁begin|>extern crate cargo; extern crate env_logger; extern crate git2_curl; extern crate rustc_serialize; extern crate toml; #[macro_use] extern crate log; use std::collections::BTreeSet; use std::env; use std::fs; use std::io; use std::path::{PathBuf, Path}; use std::process::Command; use cargo::{execute_main_without_stdin, handle_error, shell}; use cargo::core::MultiShell; use cargo::util::{CliError, CliResult, lev_distance, Config}; #[derive(RustcDecodable)] struct Flags { flag_list: bool, flag_verbose: bool, flag_quiet: bool, flag_color: Option<String>, arg_command: String, arg_args: Vec<String>, } const USAGE: &'static str = " Rust's package manager Usage: cargo <command> [<args>...] cargo [options] Options: -h, --help Display this message -V, --version Print version info and exit --list List installed commands -v, --verbose Use verbose output -q, --quiet No output printed to stdout --color WHEN Coloring: auto, always, never Some common cargo commands are: build Compile the current project clean Remove the target directory doc Build this project's and its dependencies' documentation new Create a new cargo project run Build and execute src/main.rs test Run the tests bench Run the benchmarks update Update dependencies listed in Cargo.lock search Search registry for crates See 'cargo help <command>' for more information on a specific command. "; fn main() { env_logger::init().unwrap(); execute_main_without_stdin(execute, true, USAGE) } macro_rules! each_subcommand{ ($mac:ident) => ({ $mac!(bench); $mac!(build); $mac!(clean); $mac!(doc); $mac!(fetch); $mac!(generate_lockfile); $mac!(git_checkout); $mac!(help); $mac!(install); $mac!(locate_project); $mac!(login); $mac!(new); $mac!(owner); $mac!(package); $mac!(pkgid); $mac!(publish); $mac!(read_manifest); $mac!(run); $mac!(rustc); $mac!(search); $mac!(test); $mac!(uninstall); $mac!(update); $mac!(verify_project); $mac!(version); $mac!(yank); }) } /** The top-level `cargo` command handles configuration and project location because they are fundamental (and intertwined). Other commands can rely on this top-level information. */ fn execute(flags: Flags, config: &Config) -> CliResult<Option<()>> { try!(config.shell().set_verbosity(flags.flag_verbose, flags.flag_quiet)); try!(config.shell().set_color_config(flags.flag_color.as_ref().map(|s| &s[..]))); init_git_transports(config); if flags.flag_list { println!("Installed Commands:"); for command in list_commands().into_iter() { println!(" {}", command); }; return Ok(None) } let args = match &flags.arg_command[..] { // For the commands `cargo` and `cargo help`, re-execute ourselves as // `cargo -h` so we can go through the normal process of printing the // help message. "" | "help" if flags.arg_args.is_empty() => { config.shell().set_verbose(true); let args = &["cargo".to_string(), "-h".to_string()]; let r = cargo::call_main_without_stdin(execute, config, USAGE, args, false); cargo::process_executed(r, &mut config.shell()); return Ok(None) } // For `cargo help -h` and `cargo help --help`, print out the help // message for `cargo help` "help" if flags.arg_args[0] == "-h" || flags.arg_args[0] == "--help" => { vec!["cargo".to_string(), "help".to_string(), "-h".to_string()] } // For `cargo help foo`, print out the usage message for the specified // subcommand by executing the command with the `-h` flag. "help" => { vec!["cargo".to_string(), flags.arg_args[0].clone(), "-h".to_string()] } // For all other invocations, we're of the form `cargo foo args...`. We // use the exact environment arguments to preserve tokens like `--` for // example. _ => env::args().collect(), }; macro_rules! cmd{ ($name:ident) => ( if args[1] == stringify!($name).replace("_", "-") { mod $name; config.shell().set_verbose(true); let r = cargo::call_main_without_stdin($name::execute, config, $name::USAGE, &args, false); cargo::process_executed(r, &mut config.shell()); return Ok(None) } ) } each_subcommand!(cmd); execute_subcommand(&args[1], &args, &mut config.shell()); Ok(None) } fn find_closest(cmd: &str) -> Option<String> { let cmds = list_commands(); // Only consider candidates with a lev_distance of 3 or less so we don't // suggest out-of-the-blue options. let mut filtered = cmds.iter().map(|c| (lev_distance(&c, cmd), c)) .filter(|&(d, _)| d < 4) .collect::<Vec<_>>(); filtered.sort_by(|a, b| a.0.cmp(&b.0)); if filtered.len() == 0 { None } else { Some(filtered[0].1.to_string()) } } fn execute_subcommand(cmd: &str, args: &[String], shell: &mut MultiShell) { let command = match find_command(cmd) { Some(command) => command, None => { let msg = match find_closest(cmd) { Some(closest) => format!("No such subcommand\n\n\t\ Did you mean `{}`?\n", closest), None => "No such subcommand".to_string() }; return handle_error(CliError::new(&msg, 127), shell) } }; match Command::new(&command).args(&args[1..]).status() { Ok(ref status) if status.success() => {} Ok(ref status) => { match status.code() { Some(code) => handle_error(CliError::new("", code), shell), None => { let msg = format!("subcommand failed with: {}", status); handle_error(CliError::new(&msg, 101), shell) } } } Err(ref e) if e.kind() == io::ErrorKind::NotFound => { handle_error(CliError::new("No such subcommand", 127), shell) } Err(err) => { let msg = format!("Subcommand failed to run: {}", err); handle_error(CliError::new(&msg, 127), shell) } } } /// List all runnable commands. find_command should always succeed /// if given one of returned command. fn list_commands() -> BTreeSet<String> { let command_prefix = "cargo-"; let mut commands = BTreeSet::new(); for dir in list_command_directory().iter() { let entries = match fs::read_dir(dir) { Ok(entries) => entries, _ => continue }; for entry in entries { let entry = match entry { Ok(e) => e, Err(..) => continue }; let entry = entry.path(); let filename = match entry.file_name().and_then(|s| s.to_str()) { Some(filename) => filename, _ => continue }; if filename.starts_with(command_prefix) && filename.ends_with(env::consts::EXE_SUFFIX) && is_executable(&entry) { let command = &filename[ command_prefix.len().. filename.len() - env::consts::EXE_SUFFIX.len()]; commands.insert(command.to_string()); } } } macro_rules! add_cmd{ ($cmd:ident) => ({ commands.insert(stringify!($cmd).replace("_", "-")); }) } each_subcommand!(add_cmd); commands } #[cfg(unix)] fn is_executable(path: &Path) -> bool { use std::os::unix::prelude::*; fs::metadata(path).map(|m| { m.permissions().mode() & 0o001 == 0o001 }).unwrap_or(false) } #[cfg(windows)] fn is_executable(path: &Path) -> bool { fs::metadata(path).map(|m| m.is_file()).unwrap_or(false) } /// Get `Command` to run given command. fn find_command(cmd: &str) -> Option<PathBuf> { let command_exe = format!("cargo-{}{}", cmd, env::consts::EXE_SUFFIX); let dirs = list_command_directory(); let mut command_paths = dirs.iter().map(|dir| dir.join(&command_exe)); command_paths.find(|path| fs::metadata(&path).is_ok()) } /// List candidate locations where subcommands might be installed. fn list_command_directory() -> Vec<PathBuf> { let mut dirs = vec![]; if let Ok(mut path) = env::current_exe() { path.pop(); dirs.push(path.join("../lib/cargo")); dirs.push(path); } if let Some(val) = env::var_os("PATH") { dirs.extend(env::split_paths(&val));<|fim▁hole|>} fn init_git_transports(config: &Config) { // Only use a custom transport if a proxy is configured, right now libgit2 // doesn't support proxies and we have to use a custom transport in this // case. The custom transport, however, is not as well battle-tested. match cargo::ops::http_proxy_exists(config) { Ok(true) => {} _ => return } let handle = match cargo::ops::http_handle(config) { Ok(handle) => handle, Err(..) => return, }; // The unsafety of the registration function derives from two aspects: // // 1. This call must be synchronized with all other registration calls as // well as construction of new transports. // 2. The argument is leaked. // // We're clear on point (1) because this is only called at the start of this // binary (we know what the state of the world looks like) and we're mostly // clear on point (2) because we'd only free it after everything is done // anyway unsafe { git2_curl::register(handle); } }<|fim▁end|>
} dirs
<|file_name|>HELP.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
print("hello!!!!")
<|file_name|>createCopy.py<|end_file_name|><|fim▁begin|>import os import time import traceback from lib.FileManager.FM import REQUEST_DELAY from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer class CreateCopy(BaseWorkerCustomer): def __init__(self, paths, session, *args, **kwargs): super(CreateCopy, self).__init__(*args, **kwargs) self.paths = paths self.session = session def run(self): try: self.preload() self.logger.info("CreateCopy process run") ftp = self.get_ftp_connection(self.session) # Временная хеш таблица для директорий по которым будем делать листинг directories = {} for path in self.paths:<|fim▁hole|> if dirname not in directories.keys(): directories[dirname] = [] directories[dirname].append(path) # Массив хешей source -> target для каждого пути copy_paths = [] # Эта содомия нужна чтобы составтить массив source -> target для создания копии файла с красивым именем # с учетом того что могут быть совпадения for dirname, dir_paths in directories.items(): dir_listing = ftp.listdir(dirname) for dir_path in dir_paths: i = 0 exist = False if ftp.isdir(dir_path): filename = os.path.basename(dir_path) ext = '' else: filename, file_extension = ftp.path.splitext(os.path.basename(dir_path)) ext = file_extension copy_name = filename + ' copy' + ext if i == 0 else filename + ' copy(' + str(i) + ')' + ext for dir_current_path in dir_listing: if copy_name == dir_current_path: exist = True i += 1 break if not exist: copy_paths.append({ 'source': dir_path, 'target': ftp.path.join(dirname, copy_name) }) while exist: exist = False if ftp.isdir(dir_path): filename = ftp.path.basename(dir_path) ext = '' else: filename, file_extension = ftp.path.splitext(dir_path) ext = file_extension copy_name = filename + ' copy' + ext if i == 0 else filename + ' copy(' + str(i) + ')' + ext for dir_current_path in dir_listing: if copy_name == dir_current_path: exist = True i += 1 break if not exist: dir_listing.append(copy_name) copy_paths.append({ 'source': dir_path, 'target': os.path.join(dirname, copy_name) }) success_paths = [] error_paths = [] created_paths = [] next_tick = time.time() + REQUEST_DELAY for copy_path in copy_paths: try: source_path = copy_path.get('source') target_path = copy_path.get('target') if ftp.isfile(source_path): copy_result = ftp.copy_file(source_path, ftp.path.dirname(target_path), overwrite=True, rename=target_path) if not copy_result['success'] or len(copy_result['file_list']['failed']) > 0: raise copy_result['error'] if copy_result['error'] is not None else Exception( "Upload error") elif ftp.isdir(source_path): copy_result = ftp.copy_dir(source_path, ftp.path.dirname(target_path), overwrite=True, rename=target_path) if not copy_result['success'] or len(copy_result['file_list']['failed']) > 0: raise copy_result['error'] if copy_result['error'] is not None else Exception( "Upload error") else: error_paths.append(source_path) break success_paths.append(source_path) created_paths.append(ftp.file_info(target_path)) if time.time() > next_tick: progress = { 'percent': round(float(len(success_paths)) / float(len(copy_paths)), 2), 'text': str( int(round(float(len(success_paths)) / float(len(copy_paths)), 2) * 100)) + '%' } self.on_running(self.status_id, progress=progress, pid=self.pid, pname=self.name) next_tick = time.time() + REQUEST_DELAY except Exception as e: self.logger.error("Error copy file %s , error %s" % (str(source_path), str(e))) error_paths.append(source_path) result = { "success": success_paths, "errors": error_paths, "items": created_paths } # иначе пользователям кажется что скопировалось не полностью ) progress = { 'percent': round(float(len(success_paths)) / float(len(copy_paths)), 2), 'text': str(int(round(float(len(success_paths)) / float(len(copy_paths)), 2) * 100)) + '%' } time.sleep(REQUEST_DELAY) self.on_success(self.status_id, data=result, progress=progress, pid=self.pid, pname=self.name) except Exception as e: result = { "error": True, "message": str(e), "traceback": traceback.format_exc() } self.on_error(self.status_id, result, pid=self.pid, pname=self.name)<|fim▁end|>
dirname = ftp.path.dirname(path)
<|file_name|>daemon_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package unversioned import ( "testing" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/expapi" "k8s.io/kubernetes/pkg/expapi/testapi"<|fim▁hole|> func getDCResourceName() string { return "daemons" } func TestListDaemons(t *testing.T) { ns := api.NamespaceAll c := &testClient{ Request: testRequest{ Method: "GET", Path: testapi.ResourcePath(getDCResourceName(), ns, ""), }, Response: Response{StatusCode: 200, Body: &expapi.DaemonList{ Items: []expapi.Daemon{ { ObjectMeta: api.ObjectMeta{ Name: "foo", Labels: map[string]string{ "foo": "bar", "name": "baz", }, }, Spec: expapi.DaemonSpec{ Template: &api.PodTemplateSpec{}, }, }, }, }, }, } receivedControllerList, err := c.Setup().Daemons(ns).List(labels.Everything()) c.Validate(t, receivedControllerList, err) } func TestGetDaemon(t *testing.T) { ns := api.NamespaceDefault c := &testClient{ Request: testRequest{Method: "GET", Path: testapi.ResourcePath(getDCResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Response: Response{ StatusCode: 200, Body: &expapi.Daemon{ ObjectMeta: api.ObjectMeta{ Name: "foo", Labels: map[string]string{ "foo": "bar", "name": "baz", }, }, Spec: expapi.DaemonSpec{ Template: &api.PodTemplateSpec{}, }, }, }, } receivedController, err := c.Setup().Daemons(ns).Get("foo") c.Validate(t, receivedController, err) } func TestGetDaemonWithNoName(t *testing.T) { ns := api.NamespaceDefault c := &testClient{Error: true} receivedPod, err := c.Setup().Daemons(ns).Get("") if (err != nil) && (err.Error() != nameRequiredError) { t.Errorf("Expected error: %v, but got %v", nameRequiredError, err) } c.Validate(t, receivedPod, err) } func TestUpdateDaemon(t *testing.T) { ns := api.NamespaceDefault requestController := &expapi.Daemon{ ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"}, } c := &testClient{ Request: testRequest{Method: "PUT", Path: testapi.ResourcePath(getDCResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Response: Response{ StatusCode: 200, Body: &expapi.Daemon{ ObjectMeta: api.ObjectMeta{ Name: "foo", Labels: map[string]string{ "foo": "bar", "name": "baz", }, }, Spec: expapi.DaemonSpec{ Template: &api.PodTemplateSpec{}, }, }, }, } receivedController, err := c.Setup().Daemons(ns).Update(requestController) c.Validate(t, receivedController, err) } func TestDeleteDaemon(t *testing.T) { ns := api.NamespaceDefault c := &testClient{ Request: testRequest{Method: "DELETE", Path: testapi.ResourcePath(getDCResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Response: Response{StatusCode: 200}, } err := c.Setup().Daemons(ns).Delete("foo") c.Validate(t, nil, err) } func TestCreateDaemon(t *testing.T) { ns := api.NamespaceDefault requestController := &expapi.Daemon{ ObjectMeta: api.ObjectMeta{Name: "foo"}, } c := &testClient{ Request: testRequest{Method: "POST", Path: testapi.ResourcePath(getDCResourceName(), ns, ""), Body: requestController, Query: buildQueryValues(nil)}, Response: Response{ StatusCode: 200, Body: &expapi.Daemon{ ObjectMeta: api.ObjectMeta{ Name: "foo", Labels: map[string]string{ "foo": "bar", "name": "baz", }, }, Spec: expapi.DaemonSpec{ Template: &api.PodTemplateSpec{}, }, }, }, } receivedController, err := c.Setup().Daemons(ns).Create(requestController) c.Validate(t, receivedController, err) }<|fim▁end|>
"k8s.io/kubernetes/pkg/labels" )
<|file_name|>options_directory.go<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2018 The "MysteriumNetwork/node" Authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package node import ( "errors" "os" log "github.com/cihub/seelog" ) // OptionsDirectory describes data structure holding directories as parameters type OptionsDirectory struct { // Data directory stores persistent data like keystore, cli history, etc. Data string // Data directory stores database Storage string // Data directory stores identity keys Keystore string // Config directory stores all data needed for runtime (db scripts etc.) Config string // Runtime directory for various temp file - usually current working dir Runtime string } // Check checks that configured dirs exist (which should contain info) and runtime dirs are created (if not exist) func (options *OptionsDirectory) Check() error { if options.Config != "" { err := ensureDirExists(options.Config) if err != nil { return err } } err := ensureOrCreateDir(options.Runtime)<|fim▁hole|> } err = ensureOrCreateDir(options.Storage) if err != nil { return err } return ensureOrCreateDir(options.Data) } func ensureOrCreateDir(dir string) error { err := ensureDirExists(dir) if os.IsNotExist(err) { log.Info("[Directory config checker] ", "Directory: ", dir, " does not exit. Creating new one") return os.MkdirAll(dir, 0700) } return err } func ensureDirExists(dir string) error { fileStat, err := os.Stat(dir) if err != nil { return err } if isDir := fileStat.IsDir(); !isDir { return errors.New("directory expected") } return nil }<|fim▁end|>
if err != nil { return err
<|file_name|>test_factor.rs<|end_file_name|><|fim▁begin|>// This file is part of the uutils coreutils package. // // (c) kwantam <[email protected]> // // For the full copyright and license information, please view the LICENSE file // that was distributed with this source code. #![allow(clippy::unreadable_literal)] // spell-checker:ignore (methods) hexdigest use tempfile::TempDir; use crate::common::util::*; use std::fs::OpenOptions; use std::time::SystemTime; #[path = "../../src/uu/factor/sieve.rs"] mod sieve; extern crate conv; extern crate rand; use self::rand::distributions::{Distribution, Uniform}; use self::rand::{rngs::SmallRng, Rng, SeedableRng}; use self::sieve::Sieve; const NUM_PRIMES: usize = 10000; const NUM_TESTS: usize = 100; #[test] fn test_parallel() { use hex_literal::hex; use sha1::{Digest, Sha1}; // factor should only flush the buffer at line breaks let n_integers = 100_000; let mut input_string = String::new(); for i in 0..=n_integers { input_string.push_str(&(format!("{} ", i))[..]); } let tmp_dir = TempDir::new().unwrap(); let tmp_dir = AtPath::new(tmp_dir.path()); tmp_dir.touch("output"); let output = OpenOptions::new() .append(true) .open(tmp_dir.plus("output")) .unwrap(); for mut child in (0..10) .map(|_| { new_ucmd!() .set_stdout(output.try_clone().unwrap()) .pipe_in(input_string.clone()) .run_no_wait() }) .collect::<Vec<_>>() { assert_eq!(child.wait().unwrap().code().unwrap(), 0); } let result = TestScenario::new(util_name!()) .ccmd("sort") .arg(tmp_dir.plus("output")) .succeeds(); let mut hasher = Sha1::new(); hasher.update(result.stdout()); let hash_check = hasher.finalize(); assert_eq!( hash_check[..], hex!("cc743607c0ff300ff575d92f4ff0c87d5660c393") ); } #[test] fn test_first_100000_integers() { extern crate sha1; use hex_literal::hex; use sha1::{Digest, Sha1}; let n_integers = 100_000; let mut input_string = String::new(); for i in 0..=n_integers { input_string.push_str(&(format!("{} ", i))[..]); } println!("STDIN='{}'", input_string); let result = new_ucmd!().pipe_in(input_string.as_bytes()).succeeds(); // `seq 0 100000 | factor | sha1sum` => "4ed2d8403934fa1c76fe4b84c5d4b8850299c359" let mut hasher = Sha1::new(); hasher.update(result.stdout()); let hash_check = hasher.finalize(); assert_eq!( hash_check[..], hex!("4ed2d8403934fa1c76fe4b84c5d4b8850299c359") ); } #[test] fn test_cli_args() { // Make sure that factor works with CLI arguments as well. new_ucmd!().args(&["3"]).succeeds().stdout_contains("3: 3"); new_ucmd!() .args(&["3", "6"]) .succeeds() .stdout_contains("3: 3") .stdout_contains("6: 2 3"); } #[test] fn test_random() { use conv::prelude::*; let log_num_primes = f64::value_from(NUM_PRIMES).unwrap().log2().ceil(); let primes = Sieve::primes().take(NUM_PRIMES).collect::<Vec<u64>>(); let rng_seed = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap() .as_secs(); println!("rng_seed={:?}", rng_seed); let mut rng = SmallRng::seed_from_u64(rng_seed); let mut rand_gt = move |min: u64| { let mut product = 1_u64; let mut factors = Vec::new(); while product < min { // log distribution---higher probability for lower numbers let factor; loop { let next = rng.gen_range(0_f64..log_num_primes).exp2().floor() as usize; if next < NUM_PRIMES { factor = primes[next]; break; } } let factor = factor; match product.checked_mul(factor) { Some(p) => { product = p; factors.push(factor); } None => break, }; } factors.sort_unstable(); (product, factors) }; // build an input and expected output string from factor let mut input_string = String::new(); let mut output_string = String::new(); for _ in 0..NUM_TESTS { let (product, factors) = rand_gt(1 << 63); input_string.push_str(&(format!("{} ", product))[..]); output_string.push_str(&(format!("{}:", product))[..]); for factor in factors { output_string.push_str(&(format!(" {}", factor))[..]); } output_string.push('\n'); } run(input_string.as_bytes(), output_string.as_bytes()); } #[test] fn test_random_big() { let rng_seed = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap() .as_secs(); println!("rng_seed={:?}", rng_seed); let mut rng = SmallRng::seed_from_u64(rng_seed); let bit_range_1 = Uniform::new(14_usize, 51); let mut rand_64 = move || { // first, choose a random number of bits for the first factor let f_bit_1 = bit_range_1.sample(&mut rng); // how many more bits do we need? let rem = 64 - f_bit_1; // we will have a number of additional factors equal to n_facts + 1 // where n_facts is in [0, floor(rem/14) ) NOTE half-open interval // Each prime factor is at least 14 bits, hence floor(rem/14) let n_factors = Uniform::new(0_usize, rem / 14).sample(&mut rng); // we have to distribute extra_bits among the (n_facts + 1) values let extra_bits = rem - (n_factors + 1) * 14; // (remember, a Range is a half-open interval) let extra_range = Uniform::new(0_usize, extra_bits + 1); // to generate an even split of this range, generate n-1 random elements // in the range, add the desired total value to the end, sort this list, // and then compute the sequential differences. let mut f_bits = Vec::new(); for _ in 0..n_factors { f_bits.push(extra_range.sample(&mut rng)); } f_bits.push(extra_bits); f_bits.sort_unstable(); // compute sequential differences here. We leave off the +14 bits // so we can just index PRIMES_BY_BITS let mut f_bits = f_bits .iter() .scan(0, |st, &x| { let ret = x - *st; // + 14 would give actual number of bits *st = x; Some(ret) }) .collect::<Vec<usize>>(); // finally, add f_bit_1 in there f_bits.push(f_bit_1 - 14); // index of f_bit_1 in PRIMES_BY_BITS let f_bits = f_bits; let mut n_bits = 0; let mut product = 1_u64; let mut factors = Vec::new(); for bit in f_bits { assert!(bit < 37); n_bits += 14 + bit; let elm = Uniform::new(0, PRIMES_BY_BITS[bit].len()).sample(&mut rng); let factor = PRIMES_BY_BITS[bit][elm]; factors.push(factor); product *= factor; } assert_eq!(n_bits, 64); factors.sort_unstable(); (product, factors) }; let mut input_string = String::new(); let mut output_string = String::new(); for _ in 0..NUM_TESTS { let (product, factors) = rand_64(); input_string.push_str(&(format!("{} ", product))[..]); output_string.push_str(&(format!("{}:", product))[..]); for factor in factors { output_string.push_str(&(format!(" {}", factor))[..]); } output_string.push('\n'); } run(input_string.as_bytes(), output_string.as_bytes()); } #[test] fn test_big_primes() { let mut input_string = String::new(); let mut output_string = String::new(); for prime in PRIMES64 { input_string.push_str(&(format!("{} ", prime))[..]); output_string.push_str(&(format!("{0}: {0}\n", prime))[..]); } run(input_string.as_bytes(), output_string.as_bytes()); } fn run(input_string: &[u8], output_string: &[u8]) { println!("STDIN='{}'", String::from_utf8_lossy(input_string)); println!( "STDOUT(expected)='{}'", String::from_utf8_lossy(output_string) ); // now run factor new_ucmd!() .pipe_in(input_string) .run() .stdout_is(String::from_utf8(output_string.to_owned()).unwrap()); } const PRIMES_BY_BITS: &[&[u64]] = &[ PRIMES14, PRIMES15, PRIMES16, PRIMES17, PRIMES18, PRIMES19, PRIMES20, PRIMES21, PRIMES22, PRIMES23, PRIMES24, PRIMES25, PRIMES26, PRIMES27, PRIMES28, PRIMES29, PRIMES30, PRIMES31, PRIMES32, PRIMES33, PRIMES34, PRIMES35, PRIMES36, PRIMES37, PRIMES38, PRIMES39, PRIMES40, PRIMES41, PRIMES42, PRIMES43, PRIMES44, PRIMES45, PRIMES46, PRIMES47, PRIMES48, PRIMES49, PRIMES50, ]; const PRIMES64: &[u64] = &[ 18446744073709551557, 18446744073709551533, 18446744073709551521, 18446744073709551437, 18446744073709551427, 18446744073709551359, 18446744073709551337, 18446744073709551293, 18446744073709551263, 18446744073709551253, 18446744073709551191, 18446744073709551163, 18446744073709551113, 18446744073709550873, 18446744073709550791, 18446744073709550773, 18446744073709550771, 18446744073709550719, 18446744073709550717, 18446744073709550681, 18446744073709550671, 18446744073709550593, 18446744073709550591, 18446744073709550539, 18446744073709550537, 18446744073709550381, 18446744073709550341, 18446744073709550293, 18446744073709550237, 18446744073709550147, 18446744073709550141, 18446744073709550129, 18446744073709550111, 18446744073709550099, 18446744073709550047, 18446744073709550033, 18446744073709550009, 18446744073709549951, 18446744073709549861, 18446744073709549817, 18446744073709549811, 18446744073709549777, 18446744073709549757, 18446744073709549733, 18446744073709549667, 18446744073709549621, 18446744073709549613, 18446744073709549583, 18446744073709549571, ]; const PRIMES14: &[u64] = &[ 16381, 16369, 16363, 16361, 16349, 16339, 16333, 16319, 16301, 16273, 16267, 16253, 16249, 16231, 16229, 16223, 16217, 16193, 16189, 16187, 16183, 16141, 16139, 16127, 16111, 16103, 16097, 16091, 16087, 16073, 16069, 16067, 16063, 16061, 16057, 16033, 16007, 16001, 15991, 15973, 15971, 15959, 15937, 15923, 15919, 15913, 15907, 15901, 15889, 15887, 15881, 15877, 15859, 15823, 15817, 15809, 15803, 15797, 15791, 15787, 15773, 15767, 15761, 15749, 15739, 15737, 15733, 15731, 15727, 15683, 15679, 15671, 15667, 15661, 15649, 15647, 15643, 15641, 15629, 15619, 15607, 15601, 15583, 15581, 15569, 15559, 15551, 15541, 15527, 15511, 15497, 15493, 15473, 15467, 15461, 15451, 15443, 15439, 15427, 15413, 15401, 15391, 15383, 15377, 15373, ]; const PRIMES15: &[u64] = &[ 32749, 32719, 32717, 32713, 32707, 32693, 32687, 32653, 32647, 32633, 32621, 32611, 32609, 32603, 32587, 32579, 32573, 32569, 32563, 32561, 32537, 32533, 32531, 32507, 32503, 32497, 32491, 32479, 32467, 32443, 32441, 32429, 32423, 32413, 32411, 32401, 32381, 32377, 32371, 32369, 32363, 32359, 32353, 32341, 32327, 32323, 32321, 32309, 32303, 32299, 32297, 32261, 32257, 32251, 32237, 32233, 32213, 32203, 32191, 32189, 32183, 32173, 32159, 32143, 32141, 32119, 32117, 32099, 32089, 32083, 32077, 32069, 32063, 32059, 32057, 32051, 32029, 32027, 32009, 32003, 31991, 31981, 31973, 31963, 31957, 31907, 31891, 31883, 31873, 31859, 31849, 31847, 31817, 31799, 31793, 31771, 31769, 31751, ]; const PRIMES16: &[u64] = &[ 65521, 65519, 65497, 65479, 65449, 65447, 65437, 65423, 65419, 65413, 65407, 65393, 65381, 65371, 65357, 65353, 65327, 65323, 65309, 65293, 65287, 65269, 65267, 65257, 65239, 65213, 65203, 65183, 65179, 65173, 65171, 65167, 65147, 65141, 65129, 65123, 65119, 65111, 65101, 65099, 65089, 65071, 65063, 65053, 65033, 65029, 65027, 65011, 65003, 64997, 64969, 64951, 64937, 64927, 64921, 64919, 64901, 64891, 64879, 64877, 64871, 64853, 64849, 64817, 64811, 64793, 64783, 64781, 64763, 64747, 64717, 64709, 64693, 64679, 64667, 64663, 64661, 64633, 64627, 64621, 64613, 64609, 64601, 64591, 64579, 64577, 64567, 64553, ]; const PRIMES17: &[u64] = &[ 131071, 131063, 131059, 131041, 131023, 131011, 131009, 130987, 130981, 130973, 130969, 130957, 130927, 130873, 130859, 130843, 130841, 130829, 130817, 130811, 130807, 130787, 130783, 130769, 130729, 130699, 130693, 130687, 130681, 130657, 130651, 130649, 130643, 130639, 130633, 130631, 130621, 130619, 130589, 130579, 130553, 130547, 130531, 130523, 130517, 130513, 130489, 130483, 130477, 130469, 130457, 130447, 130439, 130423, 130411, 130409, 130399, 130379, 130369, 130367, 130363, 130349, 130343, 130337, 130307, 130303, 130279, 130267, 130261, 130259, 130253, 130241, 130223, 130211, 130201, 130199, 130183, 130171, 130147, 130127, 130121, 130099, 130087, 130079, 130073, 130069, 130057, 130051, ]; const PRIMES18: &[u64] = &[ 262139, 262133, 262127, 262121, 262111, 262109, 262103, 262079, 262069, 262051, 262049, 262027, 262007, 261983, 261977, 261973, 261971, 261959, 261917, 261887, 261881, 261847, 261823, 261799, 261791, 261787, 261773, 261761, 261757, 261739, 261721, 261713, 261707, 261697, 261673, 261643, 261641, 261637, 261631, 261619, 261601, 261593, 261587, 261581, 261577, 261563, 261557, 261529, 261523, 261509, 261467, 261463, 261451, 261439, 261433, 261431, 261427, 261407, 261389, 261379, 261353, 261347, 261337, 261329, 261323, 261301, 261281, 261271, 261251, 261241, 261229, 261223, 261169, 261167, 261127, ]; const PRIMES19: &[u64] = &[ 524287, 524269, 524261, 524257, 524243, 524231, 524221, 524219, 524203, 524201, 524197, 524189, 524171, 524149, 524123, 524119, 524113, 524099, 524087, 524081, 524071, 524063, 524057, 524053, 524047, 523997, 523987, 523969, 523949, 523937, 523927, 523907, 523903, 523877, 523867, 523847, 523829, 523801, 523793, 523777, 523771, 523763, 523759, 523741, 523729, 523717, 523681, 523673, 523669, 523667, 523657, 523639, 523637, 523631, 523603, 523597, 523577, 523573, 523571, 523553, 523543, 523541, 523519, 523511, 523493, 523489, 523487, 523463, 523459, 523433, 523427, 523417, 523403, 523387, 523357, 523351, 523349, 523333, 523307, 523297, ]; const PRIMES20: &[u64] = &[ 1048573, 1048571, 1048559, 1048549, 1048517, 1048507, 1048447, 1048433, 1048423, 1048391, 1048387, 1048367, 1048361, 1048357, 1048343, 1048309, 1048291, 1048273, 1048261, 1048219, 1048217, 1048213, 1048193, 1048189, 1048139, 1048129, 1048127, 1048123, 1048063, 1048051, 1048049, 1048043, 1048027, 1048013, 1048009, 1048007, 1047997, 1047989, 1047979, 1047971, 1047961, 1047941, 1047929, 1047923, 1047887, 1047883, 1047881, 1047859, 1047841, 1047833, 1047821, 1047779, 1047773, 1047763, 1047751, 1047737, 1047721, 1047713, 1047703, 1047701, 1047691, 1047689, 1047671, 1047667, 1047653, 1047649, 1047647, 1047589, 1047587, 1047559, ]; const PRIMES21: &[u64] = &[ 2097143, 2097133, 2097131, 2097097, 2097091, 2097083, 2097047, 2097041, 2097031, 2097023, 2097013, 2096993, 2096987, 2096971, 2096959, 2096957, 2096947, 2096923, 2096911, 2096909, 2096893, 2096881, 2096873, 2096867, 2096851, 2096837, 2096807, 2096791, 2096789, 2096777, 2096761, 2096741, 2096737, 2096713, 2096693, 2096687, 2096681, 2096639, 2096629, 2096621, 2096599, 2096597, 2096569, 2096539, 2096533, 2096483, 2096449, 2096431, 2096429, 2096411, 2096407, 2096401, 2096399, 2096377, 2096357, 2096291, 2096273, 2096261, 2096233, 2096231, 2096221, 2096209, 2096191, 2096183, 2096147, ]; const PRIMES22: &[u64] = &[ 4194301, 4194287, 4194277, 4194271, 4194247, 4194217, 4194199, 4194191, 4194187, 4194181, 4194173, 4194167, 4194143, 4194137, 4194131, 4194107, 4194103, 4194023, 4194011, 4194007, 4193977, 4193971, 4193963, 4193957, 4193939, 4193929, 4193909, 4193869, 4193807, 4193803, 4193801, 4193789, 4193759, 4193753, 4193743, 4193701, 4193663, 4193633, 4193573, 4193569, 4193551, 4193549, 4193531, 4193513, 4193507, 4193459, 4193447, 4193443, 4193417, 4193411, 4193393, 4193389, 4193381, 4193377, 4193369, 4193359, 4193353, 4193327, 4193309, 4193303, 4193297, ]; const PRIMES23: &[u64] = &[ 8388593, 8388587, 8388581, 8388571, 8388547, 8388539, 8388473, 8388461, 8388451, 8388449, 8388439, 8388427, 8388421, 8388409, 8388377, 8388371, 8388319, 8388301, 8388287, 8388283, 8388277, 8388239, 8388209, 8388187, 8388113, 8388109, 8388091, 8388071, 8388059, 8388019, 8388013, 8387999, 8387993, 8387959, 8387957, 8387947, 8387933, 8387921, 8387917, 8387891, 8387879, 8387867, 8387861, 8387857, 8387839, 8387831, 8387809, 8387807, 8387741, 8387737, 8387723, 8387707, 8387671, 8387611, 8387609, 8387591, ]; const PRIMES24: &[u64] = &[ 16777213, 16777199, 16777183, 16777153, 16777141, 16777139, 16777127, 16777121, 16777099, 16777049, 16777027, 16776989, 16776973, 16776971, 16776967, 16776961, 16776941, 16776937, 16776931, 16776919, 16776901, 16776899, 16776869, 16776857, 16776839, 16776833, 16776817, 16776763, 16776731, 16776719, 16776713, 16776691, 16776689, 16776679, 16776659, 16776631, 16776623, 16776619, 16776607, 16776593, 16776581, 16776547, 16776521, 16776491, 16776481, 16776469, 16776451, 16776401, 16776391, 16776379, 16776371, 16776367, 16776343, 16776337, 16776317, 16776313, 16776289, 16776217, 16776211, ]; const PRIMES25: &[u64] = &[ 33554393, 33554383, 33554371, 33554347, 33554341, 33554317, 33554291, 33554273, 33554267, 33554249, 33554239, 33554221, 33554201, 33554167, 33554159, 33554137, 33554123, 33554093, 33554083, 33554077, 33554051, 33554021, 33554011, 33554009, 33553999, 33553991, 33553969, 33553967, 33553909, 33553901, 33553879, 33553837, 33553799, 33553787, 33553771, 33553769, 33553759, 33553747, 33553739, 33553727, 33553697, 33553693, 33553679, 33553661, 33553657, 33553651, 33553649, 33553633, 33553613, 33553607, 33553577, 33553549, 33553547, 33553537, 33553519, 33553517, 33553511, 33553489, 33553463, 33553451, 33553417, ]; const PRIMES26: &[u64] = &[ 67108859, 67108837, 67108819, 67108777, 67108763, 67108757, 67108753, 67108747, 67108739, 67108729, 67108721, 67108709, 67108693, 67108669, 67108667, 67108661, 67108649, 67108633, 67108597, 67108579, 67108529, 67108511, 67108507, 67108493, 67108471, 67108463, 67108453, 67108439, 67108387, 67108373, 67108369, 67108351, 67108331, 67108313, 67108303, 67108289, 67108271, 67108219, 67108207, 67108201, 67108199, 67108187, 67108183, 67108177, 67108127, 67108109, 67108081, 67108049, 67108039, 67108037, 67108033, 67108009, 67108007, 67108003, 67107983, 67107977, 67107967, 67107941, 67107919, 67107913, 67107883, 67107881, 67107871, 67107863, ]; const PRIMES27: &[u64] = &[ 134217689, 134217649, 134217617, 134217613, 134217593, 134217541, 134217529, 134217509, 134217497, 134217493, 134217487, 134217467, 134217439, 134217437, 134217409, 134217403, 134217401, 134217367, 134217361, 134217353, 134217323, 134217301, 134217277, 134217257, 134217247, 134217221, 134217199, 134217173, 134217163, 134217157, 134217131, 134217103, 134217089, 134217079, 134217049, 134217047, 134217043, 134217001, 134216987, 134216947, 134216939, 134216933, 134216911, 134216899, 134216881, 134216869, 134216867, 134216861, 134216837, 134216827, 134216807, 134216801, 134216791, 134216783, 134216777, 134216759, 134216737, 134216729, ]; const PRIMES28: &[u64] = &[ 268435399, 268435367, 268435361, 268435337, 268435331, 268435313, 268435291, 268435273, 268435243, 268435183, 268435171, 268435157, 268435147, 268435133, 268435129, 268435121, 268435109, 268435091, 268435067, 268435043, 268435039, 268435033, 268435019, 268435009, 268435007, 268434997, 268434979, 268434977, 268434961, 268434949, 268434941, 268434937, 268434857, 268434841, 268434827, 268434821, 268434787, 268434781, 268434779, 268434773, 268434731, 268434721, 268434713, 268434707, 268434703, 268434697, 268434659, 268434623, 268434619, 268434581, 268434577, 268434563, 268434557, 268434547, 268434511, 268434499, 268434479, 268434461, ]; const PRIMES29: &[u64] = &[ 536870909, 536870879, 536870869, 536870849, 536870839, 536870837, 536870819, 536870813, 536870791, 536870779, 536870767, 536870743, 536870729, 536870723, 536870717, 536870701, 536870683, 536870657, 536870641, 536870627, 536870611, 536870603, 536870599, 536870573, 536870569, 536870563, 536870561, 536870513, 536870501, 536870497, 536870473, 536870401, 536870363, 536870317, 536870303, 536870297, 536870273, 536870267, 536870239, 536870233, 536870219, 536870171, 536870167, 536870153, 536870123, 536870063, 536870057, 536870041, 536870027, 536869999, 536869951, 536869943, 536869937, 536869919, 536869901, 536869891, ]; const PRIMES30: &[u64] = &[ 1073741789, 1073741783, 1073741741, 1073741723, 1073741719, 1073741717, 1073741689, 1073741671, 1073741663, 1073741651, 1073741621, 1073741567, 1073741561, 1073741527, 1073741503, 1073741477, 1073741467, 1073741441, 1073741419, 1073741399, 1073741387, 1073741381, 1073741371, 1073741329, 1073741311, 1073741309, 1073741287, 1073741237, 1073741213, 1073741197, 1073741189, 1073741173, 1073741101, 1073741077, 1073741047, 1073740963, 1073740951, 1073740933, 1073740909, 1073740879, 1073740853, 1073740847, 1073740819, 1073740807, ]; const PRIMES31: &[u64] = &[ 2147483647, 2147483629, 2147483587, 2147483579, 2147483563, 2147483549, 2147483543, 2147483497, 2147483489, 2147483477, 2147483423, 2147483399, 2147483353, 2147483323, 2147483269, 2147483249, 2147483237, 2147483179, 2147483171, 2147483137, 2147483123, 2147483077, 2147483069, 2147483059, 2147483053, 2147483033, 2147483029, 2147482951, 2147482949, 2147482943, 2147482937, 2147482921, 2147482877, 2147482873, 2147482867, 2147482859, 2147482819, 2147482817, 2147482811, 2147482801, 2147482763, 2147482739, 2147482697, 2147482693, 2147482681, 2147482663, 2147482661, ]; const PRIMES32: &[u64] = &[ 4294967291, 4294967279, 4294967231, 4294967197, 4294967189, 4294967161, 4294967143, 4294967111, 4294967087, 4294967029, 4294966997, 4294966981, 4294966943, 4294966927, 4294966909, 4294966877, 4294966829, 4294966813, 4294966769, 4294966667, 4294966661, 4294966657, 4294966651, 4294966639, 4294966619, 4294966591, 4294966583, 4294966553, 4294966477, 4294966447, 4294966441, 4294966427, 4294966373, 4294966367, 4294966337, 4294966297, ]; const PRIMES33: &[u64] = &[ 8589934583, 8589934567, 8589934543, 8589934513, 8589934487, 8589934307, 8589934291, 8589934289, 8589934271, 8589934237, 8589934211, 8589934207, 8589934201, 8589934187, 8589934151, 8589934141, 8589934139, 8589934117, 8589934103, 8589934099, 8589934091, 8589934069, 8589934049, 8589934027, 8589934007, 8589933973, 8589933971, 8589933967, 8589933931, 8589933917, 8589933907, 8589933853, 8589933827, 8589933823, 8589933787, 8589933773, 8589933733, 8589933731, 8589933721, 8589933683, 8589933647, 8589933641, 8589933637, 8589933631, 8589933629, 8589933619, 8589933601, 8589933581, ]; const PRIMES34: &[u64] = &[ 17179869143, 17179869107, 17179869071, 17179869053, 17179869041, 17179869019, 17179868999, 17179868977, 17179868957, 17179868903, 17179868899, 17179868887, 17179868879, 17179868873, 17179868869, 17179868861, 17179868843, 17179868833, 17179868809, 17179868807, 17179868777, 17179868759, 17179868729, 17179868711, 17179868683, 17179868681, 17179868597, 17179868549, 17179868543, 17179868521, 17179868513, 17179868479, 17179868443, 17179868437, 17179868429, 17179868383, 17179868369, 17179868357, 17179868353, 17179868351, 17179868333, 17179868317, 17179868309, 17179868297, 17179868287, 17179868249, 17179868243, 17179868183, ]; const PRIMES35: &[u64] = &[ 34359738337, 34359738319, 34359738307, 34359738299, 34359738289, 34359738247, 34359738227, 34359738121, 34359738059, 34359738043, 34359738011, 34359737917, 34359737869, 34359737849, 34359737837, 34359737821, 34359737813, 34359737791, 34359737777, 34359737771, 34359737717, 34359737591, 34359737567, 34359737549, 34359737519, 34359737497, 34359737479, 34359737407, 34359737393, 34359737371, ]; const PRIMES36: &[u64] = &[ 68719476731, 68719476719, 68719476713, 68719476671, 68719476619, 68719476599, 68719476577, 68719476563, 68719476547, 68719476503, 68719476493, 68719476479, 68719476433, 68719476407, 68719476391, 68719476389, 68719476377, 68719476361, 68719476323, 68719476307, 68719476281, 68719476271, 68719476257, 68719476247, 68719476209, 68719476197, 68719476181, 68719476169, 68719476157, 68719476149, 68719476109, 68719476053, 68719476047, 68719476019, 68719475977, 68719475947, 68719475933, 68719475911, 68719475893, 68719475879, 68719475837, 68719475827, 68719475809, 68719475791, 68719475779, 68719475771,<|fim▁hole|> const PRIMES37: &[u64] = &[ 137438953447, 137438953441, 137438953427, 137438953403, 137438953349, 137438953331, 137438953273, 137438953271, 137438953121, 137438953097, 137438953037, 137438953009, 137438952953, 137438952901, 137438952887, 137438952869, 137438952853, 137438952731, 137438952683, 137438952611, 137438952529, 137438952503, 137438952491, ]; const PRIMES38: &[u64] = &[ 274877906899, 274877906857, 274877906837, 274877906813, 274877906791, 274877906759, 274877906753, 274877906717, 274877906713, 274877906687, 274877906647, 274877906629, 274877906627, 274877906573, 274877906543, 274877906491, 274877906477, 274877906473, 274877906431, 274877906419, 274877906341, 274877906333, 274877906327, 274877906321, 274877906309, 274877906267, 274877906243, 274877906213, 274877906209, 274877906203, 274877906179, 274877906167, 274877906119, 274877906063, 274877906053, 274877906021, 274877905931, ]; const PRIMES39: &[u64] = &[ 549755813881, 549755813869, 549755813821, 549755813797, 549755813753, 549755813723, 549755813669, 549755813657, 549755813647, 549755813587, 549755813561, 549755813513, 549755813507, 549755813461, 549755813417, 549755813401, 549755813371, 549755813359, 549755813357, 549755813351, 549755813339, 549755813317, 549755813311, 549755813281, 549755813239, 549755813231, 549755813213, 549755813207, 549755813197, 549755813183, 549755813161, 549755813149, 549755813147, 549755813143, 549755813141, 549755813059, 549755813027, 549755813003, 549755812951, 549755812937, 549755812933, 549755812889, 549755812867, ]; const PRIMES40: &[u64] = &[ 1099511627689, 1099511627609, 1099511627581, 1099511627573, 1099511627563, 1099511627491, 1099511627483, 1099511627477, 1099511627387, 1099511627339, 1099511627321, 1099511627309, 1099511627297, 1099511627293, 1099511627261, 1099511627213, 1099511627191, 1099511627177, 1099511627173, 1099511627143, 1099511627089, 1099511626987, 1099511626949, 1099511626937, 1099511626793, 1099511626781, 1099511626771, ]; const PRIMES41: &[u64] = &[ 2199023255531, 2199023255521, 2199023255497, 2199023255489, 2199023255479, 2199023255477, 2199023255461, 2199023255441, 2199023255419, 2199023255413, 2199023255357, 2199023255327, 2199023255291, 2199023255279, 2199023255267, 2199023255243, 2199023255203, 2199023255171, 2199023255137, 2199023255101, 2199023255087, 2199023255081, 2199023255069, 2199023255027, 2199023255021, 2199023254979, 2199023254933, 2199023254913, 2199023254907, 2199023254903, 2199023254843, 2199023254787, 2199023254699, 2199023254693, 2199023254657, 2199023254567, ]; const PRIMES42: &[u64] = &[ 4398046511093, 4398046511087, 4398046511071, 4398046511051, 4398046511039, 4398046510961, 4398046510943, 4398046510939, 4398046510889, 4398046510877, 4398046510829, 4398046510787, 4398046510771, 4398046510751, 4398046510733, 4398046510721, 4398046510643, 4398046510639, 4398046510597, 4398046510577, 4398046510547, 4398046510531, 4398046510463, 4398046510397, 4398046510391, 4398046510379, 4398046510357, 4398046510331, 4398046510327, 4398046510313, 4398046510283, 4398046510279, 4398046510217, 4398046510141, 4398046510133, 4398046510103, 4398046510093, ]; const PRIMES43: &[u64] = &[ 8796093022151, 8796093022141, 8796093022091, 8796093022033, 8796093021953, 8796093021941, 8796093021917, 8796093021899, 8796093021889, 8796093021839, 8796093021803, 8796093021791, 8796093021769, 8796093021763, 8796093021743, 8796093021671, 8796093021607, 8796093021587, 8796093021533, 8796093021523, 8796093021517, 8796093021493, 8796093021467, 8796093021461, 8796093021449, 8796093021409, 8796093021407, 8796093021371, 8796093021347, 8796093021337, 8796093021281, 8796093021269, ]; const PRIMES44: &[u64] = &[ 17592186044399, 17592186044299, 17592186044297, 17592186044287, 17592186044273, 17592186044267, 17592186044129, 17592186044089, 17592186044057, 17592186044039, 17592186043987, 17592186043921, 17592186043889, 17592186043877, 17592186043841, 17592186043829, 17592186043819, 17592186043813, 17592186043807, 17592186043741, 17592186043693, 17592186043667, 17592186043631, 17592186043591, 17592186043577, 17592186043547, 17592186043483, 17592186043451, 17592186043433, 17592186043409, ]; const PRIMES45: &[u64] = &[ 35184372088777, 35184372088763, 35184372088751, 35184372088739, 35184372088711, 35184372088699, 35184372088693, 35184372088673, 35184372088639, 35184372088603, 35184372088571, 35184372088517, 35184372088493, 35184372088471, 35184372088403, 35184372088391, 35184372088379, 35184372088363, 35184372088321, 35184372088319, 35184372088279, 35184372088259, 35184372088249, 35184372088241, 35184372088223, 35184372088183, 35184372088097, 35184372088081, 35184372088079, 35184372088051, 35184372088043, 35184372088039, 35184372087937, 35184372087929, 35184372087923, 35184372087881, 35184372087877, 35184372087869, ]; const PRIMES46: &[u64] = &[ 70368744177643, 70368744177607, 70368744177601, 70368744177587, 70368744177497, 70368744177467, 70368744177427, 70368744177377, 70368744177359, 70368744177353, 70368744177331, 70368744177289, 70368744177283, 70368744177271, 70368744177257, 70368744177227, 70368744177167, 70368744177113, 70368744177029, 70368744176959, 70368744176921, 70368744176909, 70368744176879, 70368744176867, 70368744176833, 70368744176827, 70368744176807, 70368744176779, 70368744176777, 70368744176729, 70368744176719, 70368744176711, ]; const PRIMES47: &[u64] = &[ 140737488355213, 140737488355201, 140737488355181, 140737488355049, 140737488355031, 140737488354989, 140737488354893, 140737488354787, 140737488354709, 140737488354679, 140737488354613, 140737488354557, 140737488354511, 140737488354431, 140737488354413, 140737488354409, 140737488354373, 140737488354347, 140737488354329, ]; const PRIMES48: &[u64] = &[ 281474976710597, 281474976710591, 281474976710567, 281474976710563, 281474976710509, 281474976710491, 281474976710467, 281474976710423, 281474976710413, 281474976710399, 281474976710339, 281474976710327, 281474976710287, 281474976710197, 281474976710143, 281474976710131, 281474976710129, 281474976710107, 281474976710089, 281474976710087, 281474976710029, 281474976709987, 281474976709891, 281474976709859, 281474976709831, 281474976709757, 281474976709741, 281474976709711, 281474976709649, 281474976709637, ]; const PRIMES49: &[u64] = &[ 562949953421231, 562949953421201, 562949953421189, 562949953421173, 562949953421131, 562949953421111, 562949953421099, 562949953421047, 562949953421029, 562949953420973, 562949953420871, 562949953420867, 562949953420837, 562949953420793, 562949953420747, 562949953420741, 562949953420733, 562949953420727, 562949953420609, 562949953420571, 562949953420559, 562949953420553, 562949953420523, 562949953420507, 562949953420457, 562949953420403, 562949953420373, 562949953420369, 562949953420343, 562949953420303, 562949953420297, ]; const PRIMES50: &[u64] = &[ 1125899906842597, 1125899906842589, 1125899906842573, 1125899906842553, 1125899906842511, 1125899906842507, 1125899906842493, 1125899906842463, 1125899906842429, 1125899906842391, 1125899906842357, 1125899906842283, 1125899906842273, 1125899906842247, 1125899906842201, 1125899906842177, 1125899906842079, 1125899906842033, 1125899906842021, 1125899906842013, 1125899906841973, 1125899906841971, 1125899906841959, 1125899906841949, 1125899906841943, 1125899906841917, 1125899906841901, 1125899906841883, 1125899906841859, 1125899906841811, 1125899906841803, 1125899906841751, 1125899906841713, 1125899906841673, 1125899906841653, 1125899906841623, 1125899906841613, ];<|fim▁end|>
68719475767, 68719475731, 68719475729, ];
<|file_name|>kubernetes_worker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json import os import random import shutil import subprocess import time from shlex import split from subprocess import check_call, check_output from subprocess import CalledProcessError from socket import gethostname from charms import layer from charms.layer import snap from charms.reactive import hook from charms.reactive import set_state, remove_state, is_state from charms.reactive import when, when_any, when_not from charms.kubernetes.common import get_version from charms.reactive.helpers import data_changed, any_file_changed from charms.templating.jinja2 import render from charmhelpers.core import hookenv, unitdata from charmhelpers.core.host import service_stop, service_restart from charmhelpers.contrib.charmsupport import nrpe # Override the default nagios shortname regex to allow periods, which we # need because our bin names contain them (e.g. 'snap.foo.daemon'). The # default regex in charmhelpers doesn't allow periods, but nagios itself does. nrpe.Check.shortname_re = '[\.A-Za-z0-9-_]+$' kubeconfig_path = '/root/cdk/kubeconfig' kubeproxyconfig_path = '/root/cdk/kubeproxyconfig' kubeclientconfig_path = '/root/.kube/config' os.environ['PATH'] += os.pathsep + os.path.join(os.sep, 'snap', 'bin') db = unitdata.kv() @hook('upgrade-charm') def upgrade_charm(): # Trigger removal of PPA docker installation if it was previously set. set_state('config.changed.install_from_upstream') hookenv.atexit(remove_state, 'config.changed.install_from_upstream') cleanup_pre_snap_services() check_resources_for_upgrade_needed() # Remove the RC for nginx ingress if it exists if hookenv.config().get('ingress'): kubectl_success('delete', 'rc', 'nginx-ingress-controller') # Remove gpu.enabled state so we can reconfigure gpu-related kubelet flags, # since they can differ between k8s versions remove_state('kubernetes-worker.gpu.enabled') remove_state('kubernetes-worker.cni-plugins.installed') remove_state('kubernetes-worker.config.created') remove_state('kubernetes-worker.ingress.available') set_state('kubernetes-worker.restart-needed') def check_resources_for_upgrade_needed(): hookenv.status_set('maintenance', 'Checking resources') resources = ['kubectl', 'kubelet', 'kube-proxy'] paths = [hookenv.resource_get(resource) for resource in resources] if any_file_changed(paths): set_upgrade_needed() def set_upgrade_needed(): set_state('kubernetes-worker.snaps.upgrade-needed') config = hookenv.config() previous_channel = config.previous('channel') require_manual = config.get('require-manual-upgrade') if previous_channel is None or not require_manual: set_state('kubernetes-worker.snaps.upgrade-specified') def cleanup_pre_snap_services(): # remove old states remove_state('kubernetes-worker.components.installed') # disable old services services = ['kubelet', 'kube-proxy'] for service in services: hookenv.log('Stopping {0} service.'.format(service)) service_stop(service) # cleanup old files files = [ "/lib/systemd/system/kubelet.service", "/lib/systemd/system/kube-proxy.service", "/etc/default/kube-default", "/etc/default/kubelet", "/etc/default/kube-proxy", "/srv/kubernetes", "/usr/local/bin/kubectl", "/usr/local/bin/kubelet", "/usr/local/bin/kube-proxy", "/etc/kubernetes" ] for file in files: if os.path.isdir(file): hookenv.log("Removing directory: " + file) shutil.rmtree(file) elif os.path.isfile(file): hookenv.log("Removing file: " + file) os.remove(file) @when('config.changed.channel') def channel_changed(): set_upgrade_needed() @when('kubernetes-worker.snaps.upgrade-needed') @when_not('kubernetes-worker.snaps.upgrade-specified') def upgrade_needed_status(): msg = 'Needs manual upgrade, run the upgrade action' hookenv.status_set('blocked', msg) @when('kubernetes-worker.snaps.upgrade-specified') def install_snaps(): check_resources_for_upgrade_needed() channel = hookenv.config('channel') hookenv.status_set('maintenance', 'Installing kubectl snap') snap.install('kubectl', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kubelet snap') snap.install('kubelet', channel=channel, classic=True) hookenv.status_set('maintenance', 'Installing kube-proxy snap') snap.install('kube-proxy', channel=channel, classic=True) set_state('kubernetes-worker.snaps.installed') set_state('kubernetes-worker.restart-needed') remove_state('kubernetes-worker.snaps.upgrade-needed') remove_state('kubernetes-worker.snaps.upgrade-specified') @hook('stop') def shutdown(): ''' When this unit is destroyed: - delete the current node - stop the worker services ''' try: if os.path.isfile(kubeconfig_path): kubectl('delete', 'node', gethostname().lower()) except CalledProcessError: hookenv.log('Failed to unregister node.') service_stop('snap.kubelet.daemon') service_stop('snap.kube-proxy.daemon') @when('docker.available') @when_not('kubernetes-worker.cni-plugins.installed') def install_cni_plugins(): ''' Unpack the cni-plugins resource ''' charm_dir = os.getenv('CHARM_DIR') # Get the resource via resource_get try: resource_name = 'cni-{}'.format(arch()) archive = hookenv.resource_get(resource_name) except Exception: message = 'Error fetching the cni resource.' hookenv.log(message) hookenv.status_set('blocked', message) return if not archive: hookenv.log('Missing cni resource.') hookenv.status_set('blocked', 'Missing cni resource.') return # Handle null resource publication, we check if filesize < 1mb filesize = os.stat(archive).st_size if filesize < 1000000: hookenv.status_set('blocked', 'Incomplete cni resource.') return hookenv.status_set('maintenance', 'Unpacking cni resource.') unpack_path = '{}/files/cni'.format(charm_dir) os.makedirs(unpack_path, exist_ok=True) cmd = ['tar', 'xfvz', archive, '-C', unpack_path] hookenv.log(cmd) check_call(cmd) apps = [ {'name': 'loopback', 'path': '/opt/cni/bin'} ] for app in apps: unpacked = '{}/{}'.format(unpack_path, app['name']) app_path = os.path.join(app['path'], app['name']) install = ['install', '-v', '-D', unpacked, app_path] hookenv.log(install) check_call(install) # Used by the "registry" action. The action is run on a single worker, but # the registry pod can end up on any worker, so we need this directory on # all the workers. os.makedirs('/srv/registry', exist_ok=True) set_state('kubernetes-worker.cni-plugins.installed') @when('kubernetes-worker.snaps.installed') def set_app_version(): ''' Declare the application version to juju ''' cmd = ['kubelet', '--version'] version = check_output(cmd) hookenv.application_version_set(version.split(b' v')[-1].rstrip()) @when('kubernetes-worker.snaps.installed') @when_not('kube-control.dns.available') def notify_user_transient_status(): ''' Notify to the user we are in a transient state and the application is still converging. Potentially remotely, or we may be in a detached loop wait state ''' # During deployment the worker has to start kubelet without cluster dns # configured. If this is the first unit online in a service pool waiting # to self host the dns pod, and configure itself to query the dns service # declared in the kube-system namespace hookenv.status_set('waiting', 'Waiting for cluster DNS.') @when('kubernetes-worker.snaps.installed', 'kube-control.dns.available') @when_not('kubernetes-worker.snaps.upgrade-needed') def charm_status(kube_control): '''Update the status message with the current status of kubelet.''' update_kubelet_status() def update_kubelet_status(): ''' There are different states that the kubelet can be in, where we are waiting for dns, waiting for cluster turnup, or ready to serve applications.''' services = [ 'kubelet', 'kube-proxy' ] failing_services = [] for service in services: daemon = 'snap.{}.daemon'.format(service) if not _systemctl_is_active(daemon): failing_services.append(service) if len(failing_services) == 0: hookenv.status_set('active', 'Kubernetes worker running.') else: msg = 'Waiting for {} to start.'.format(','.join(failing_services)) hookenv.status_set('waiting', msg) @when('certificates.available') def send_data(tls): '''Send the data that is required to create a server certificate for this server.''' # Use the public ip of this unit as the Common Name for the certificate. common_name = hookenv.unit_public_ip() # Create SANs that the tls layer will add to the server cert. sans = [ hookenv.unit_public_ip(), hookenv.unit_private_ip(), gethostname() ] # Create a path safe name by removing path characters from the unit name. certificate_name = hookenv.local_unit().replace('/', '_') # Request a server cert with this information. tls.request_server_cert(common_name, sans, certificate_name) @when('kube-api-endpoint.available', 'kube-control.dns.available', 'cni.available') def watch_for_changes(kube_api, kube_control, cni): ''' Watch for configuration changes and signal if we need to restart the worker services ''' servers = get_kube_api_servers(kube_api) dns = kube_control.get_dns() cluster_cidr = cni.get_config()['cidr'] if (data_changed('kube-api-servers', servers) or data_changed('kube-dns', dns) or data_changed('cluster-cidr', cluster_cidr)): set_state('kubernetes-worker.restart-needed') @when('kubernetes-worker.snaps.installed', 'kube-api-endpoint.available', 'tls_client.ca.saved', 'tls_client.client.certificate.saved', 'tls_client.client.key.saved', 'tls_client.server.certificate.saved', 'tls_client.server.key.saved', 'kube-control.dns.available', 'kube-control.auth.available', 'cni.available', 'kubernetes-worker.restart-needed', 'worker.auth.bootstrapped') def start_worker(kube_api, kube_control, auth_control, cni): ''' Start kubelet using the provided API and DNS info.''' servers = get_kube_api_servers(kube_api) # Note that the DNS server doesn't necessarily exist at this point. We know # what its IP will eventually be, though, so we can go ahead and configure # kubelet with that info. This ensures that early pods are configured with # the correct DNS even though the server isn't ready yet. dns = kube_control.get_dns() cluster_cidr = cni.get_config()['cidr'] if cluster_cidr is None: hookenv.log('Waiting for cluster cidr.') return creds = db.get('credentials') data_changed('kube-control.creds', creds) # set --allow-privileged flag for kubelet set_privileged() create_config(random.choice(servers), creds) configure_kubelet(dns) configure_kube_proxy(servers, cluster_cidr) set_state('kubernetes-worker.config.created') restart_unit_services() update_kubelet_status() apply_node_labels() remove_state('kubernetes-worker.restart-needed') @when('cni.connected') @when_not('cni.configured') def configure_cni(cni): ''' Set worker configuration on the CNI relation. This lets the CNI subordinate know that we're the worker so it can respond accordingly. ''' cni.set_config(is_master=False, kubeconfig_path=kubeconfig_path) @when('config.changed.ingress') def toggle_ingress_state(): ''' Ingress is a toggled state. Remove ingress.available if set when toggled ''' remove_state('kubernetes-worker.ingress.available') @when('docker.sdn.configured') def sdn_changed(): '''The Software Defined Network changed on the container so restart the kubernetes services.''' restart_unit_services() update_kubelet_status() remove_state('docker.sdn.configured') @when('kubernetes-worker.config.created') @when_not('kubernetes-worker.ingress.available') def render_and_launch_ingress(): ''' If configuration has ingress daemon set enabled, launch the ingress load balancer and default http backend. Otherwise attempt deletion. ''' config = hookenv.config() # If ingress is enabled, launch the ingress controller if config.get('ingress'): launch_default_ingress_controller() else: hookenv.log('Deleting the http backend and ingress.') kubectl_manifest('delete', '/root/cdk/addons/default-http-backend.yaml') kubectl_manifest('delete', '/root/cdk/addons/ingress-daemon-set.yaml') # noqa hookenv.close_port(80) hookenv.close_port(443) @when('config.changed.labels', 'kubernetes-worker.config.created') def apply_node_labels(): ''' Parse the labels configuration option and apply the labels to the node. ''' # scrub and try to format an array from the configuration option config = hookenv.config() user_labels = _parse_labels(config.get('labels')) # For diffing sake, iterate the previous label set if config.previous('labels'): previous_labels = _parse_labels(config.previous('labels')) hookenv.log('previous labels: {}'.format(previous_labels)) else: # this handles first time run if there is no previous labels config previous_labels = _parse_labels("") # Calculate label removal for label in previous_labels: if label not in user_labels: hookenv.log('Deleting node label {}'.format(label)) _apply_node_label(label, delete=True) # if the label is in user labels we do nothing here, it will get set # during the atomic update below. # Atomically set a label for label in user_labels: _apply_node_label(label, overwrite=True) # Set label for application name _apply_node_label('juju-application={}'.format(hookenv.service_name()), overwrite=True) @when_any('config.changed.kubelet-extra-args', 'config.changed.proxy-extra-args') def extra_args_changed(): set_state('kubernetes-worker.restart-needed') @when('config.changed.docker-logins') def docker_logins_changed(): config = hookenv.config() previous_logins = config.previous('docker-logins') logins = config['docker-logins'] logins = json.loads(logins) if previous_logins: previous_logins = json.loads(previous_logins) next_servers = {login['server'] for login in logins} previous_servers = {login['server'] for login in previous_logins} servers_to_logout = previous_servers - next_servers for server in servers_to_logout: cmd = ['docker', 'logout', server] subprocess.check_call(cmd) for login in logins: server = login['server'] username = login['username'] password = login['password'] cmd = ['docker', 'login', server, '-u', username, '-p', password] subprocess.check_call(cmd) set_state('kubernetes-worker.restart-needed') def arch(): '''Return the package architecture as a string. Raise an exception if the architecture is not supported by kubernetes.''' # Get the package architecture for this system. architecture = check_output(['dpkg', '--print-architecture']).rstrip() # Convert the binary result into a string. architecture = architecture.decode('utf-8') return architecture def create_config(server, creds): '''Create a kubernetes configuration for the worker unit.''' # Get the options from the tls-client layer. layer_options = layer.options('tls-client') # Get all the paths to the tls information required for kubeconfig. ca = layer_options.get('ca_certificate_path') # Create kubernetes configuration in the default location for ubuntu. create_kubeconfig('/home/ubuntu/.kube/config', server, ca, token=creds['client_token'], user='ubuntu') # Make the config dir readable by the ubuntu users so juju scp works. cmd = ['chown', '-R', 'ubuntu:ubuntu', '/home/ubuntu/.kube'] check_call(cmd) # Create kubernetes configuration in the default location for root. create_kubeconfig(kubeclientconfig_path, server, ca, token=creds['client_token'], user='root') # Create kubernetes configuration for kubelet, and kube-proxy services. create_kubeconfig(kubeconfig_path, server, ca, token=creds['kubelet_token'], user='kubelet') create_kubeconfig(kubeproxyconfig_path, server, ca, token=creds['proxy_token'], user='kube-proxy') def parse_extra_args(config_key): elements = hookenv.config().get(config_key, '').split() args = {} for element in elements: if '=' in element: key, _, value = element.partition('=') args[key] = value else: args[element] = 'true' return args def configure_kubernetes_service(service, base_args, extra_args_key): db = unitdata.kv() prev_args_key = 'kubernetes-worker.prev_args.' + service prev_args = db.get(prev_args_key) or {} extra_args = parse_extra_args(extra_args_key) args = {} for arg in prev_args: # remove previous args by setting to null args[arg] = 'null' for k, v in base_args.items(): args[k] = v for k, v in extra_args.items(): args[k] = v cmd = ['snap', 'set', service] + ['%s=%s' % item for item in args.items()] check_call(cmd) db.set(prev_args_key, args) def configure_kubelet(dns): layer_options = layer.options('tls-client') ca_cert_path = layer_options.get('ca_certificate_path') server_cert_path = layer_options.get('server_certificate_path') server_key_path = layer_options.get('server_key_path') kubelet_opts = {} kubelet_opts['require-kubeconfig'] = 'true' kubelet_opts['kubeconfig'] = kubeconfig_path kubelet_opts['network-plugin'] = 'cni' kubelet_opts['v'] = '0' kubelet_opts['address'] = '0.0.0.0' kubelet_opts['port'] = '10250' kubelet_opts['cluster-domain'] = dns['domain'] kubelet_opts['anonymous-auth'] = 'false' kubelet_opts['client-ca-file'] = ca_cert_path kubelet_opts['tls-cert-file'] = server_cert_path kubelet_opts['tls-private-key-file'] = server_key_path kubelet_opts['logtostderr'] = 'true' kubelet_opts['fail-swap-on'] = 'false' if (dns['enable-kube-dns']): kubelet_opts['cluster-dns'] = dns['sdn-ip'] privileged = is_state('kubernetes-worker.privileged') kubelet_opts['allow-privileged'] = 'true' if privileged else 'false' if is_state('kubernetes-worker.gpu.enabled'): if get_version('kubelet') < (1, 6): hookenv.log('Adding --experimental-nvidia-gpus=1 to kubelet') kubelet_opts['experimental-nvidia-gpus'] = '1' else: hookenv.log('Adding --feature-gates=Accelerators=true to kubelet') kubelet_opts['feature-gates'] = 'Accelerators=true' configure_kubernetes_service('kubelet', kubelet_opts, 'kubelet-extra-args') def configure_kube_proxy(api_servers, cluster_cidr): kube_proxy_opts = {} kube_proxy_opts['cluster-cidr'] = cluster_cidr kube_proxy_opts['kubeconfig'] = kubeproxyconfig_path kube_proxy_opts['logtostderr'] = 'true' kube_proxy_opts['v'] = '0' kube_proxy_opts['master'] = random.choice(api_servers) if b'lxc' in check_output('virt-what', shell=True): kube_proxy_opts['conntrack-max-per-core'] = '0' configure_kubernetes_service('kube-proxy', kube_proxy_opts, 'proxy-extra-args') def create_kubeconfig(kubeconfig, server, ca, key=None, certificate=None, user='ubuntu', context='juju-context', cluster='juju-cluster', password=None, token=None): '''Create a configuration for Kubernetes based on path using the supplied arguments for values of the Kubernetes server, CA, key, certificate, user context and cluster.''' if not key and not certificate and not password and not token: raise ValueError('Missing authentication mechanism.') # token and password are mutually exclusive. Error early if both are # present. The developer has requested an impossible situation. # see: kubectl config set-credentials --help if token and password: raise ValueError('Token and Password are mutually exclusive.') # Create the config file with the address of the master server. cmd = 'kubectl config --kubeconfig={0} set-cluster {1} ' \ '--server={2} --certificate-authority={3} --embed-certs=true' check_call(split(cmd.format(kubeconfig, cluster, server, ca))) # Delete old users cmd = 'kubectl config --kubeconfig={0} unset users' check_call(split(cmd.format(kubeconfig))) # Create the credentials using the client flags. cmd = 'kubectl config --kubeconfig={0} ' \ 'set-credentials {1} '.format(kubeconfig, user) if key and certificate: cmd = '{0} --client-key={1} --client-certificate={2} '\ '--embed-certs=true'.format(cmd, key, certificate) if password: cmd = "{0} --username={1} --password={2}".format(cmd, user, password) # This is mutually exclusive from password. They will not work together. if token: cmd = "{0} --token={1}".format(cmd, token) check_call(split(cmd)) # Create a default context with the cluster. cmd = 'kubectl config --kubeconfig={0} set-context {1} ' \ '--cluster={2} --user={3}' check_call(split(cmd.format(kubeconfig, context, cluster, user))) # Make the config use this new context. cmd = 'kubectl config --kubeconfig={0} use-context {1}' check_call(split(cmd.format(kubeconfig, context))) def launch_default_ingress_controller(): ''' Launch the Kubernetes ingress controller & default backend (404) ''' context = {} context['arch'] = arch() addon_path = '/root/cdk/addons/{}' context['defaultbackend_image'] = \ "gcr.io/google_containers/defaultbackend:1.4" if arch() == 's390x': context['defaultbackend_image'] = \ "gcr.io/google_containers/defaultbackend-s390x:1.4" # Render the default http backend (404) replicationcontroller manifest manifest = addon_path.format('default-http-backend.yaml') render('default-http-backend.yaml', manifest, context) hookenv.log('Creating the default http backend.') try: kubectl('apply', '-f', manifest) except CalledProcessError as e: hookenv.log(e) hookenv.log('Failed to create default-http-backend. Will attempt again next update.') # noqa hookenv.close_port(80) hookenv.close_port(443) return # Render the ingress daemon set controller manifest context['ingress_image'] = \ "gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.13" if arch() == 's390x': context['ingress_image'] = \ "docker.io/cdkbot/nginx-ingress-controller-s390x:0.9.0-beta.13" context['juju_application'] = hookenv.service_name() manifest = addon_path.format('ingress-daemon-set.yaml') render('ingress-daemon-set.yaml', manifest, context) hookenv.log('Creating the ingress daemon set.') try: kubectl('apply', '-f', manifest) except CalledProcessError as e: hookenv.log(e) hookenv.log('Failed to create ingress controller. Will attempt again next update.') # noqa hookenv.close_port(80) hookenv.close_port(443) return set_state('kubernetes-worker.ingress.available') hookenv.open_port(80) hookenv.open_port(443) def restart_unit_services(): '''Restart worker services.''' hookenv.log('Restarting kubelet and kube-proxy.') services = ['kube-proxy', 'kubelet'] for service in services: service_restart('snap.%s.daemon' % service) def get_kube_api_servers(kube_api): '''Return the kubernetes api server address and port for this relationship.''' hosts = [] # Iterate over every service from the relation object. for service in kube_api.services(): for unit in service['hosts']: hosts.append('https://{0}:{1}'.format(unit['hostname'], unit['port'])) return hosts def kubectl(*args): ''' Run a kubectl cli command with a config file. Returns stdout and throws an error if the command fails. ''' command = ['kubectl', '--kubeconfig=' + kubeclientconfig_path] + list(args) hookenv.log('Executing {}'.format(command)) return check_output(command) def kubectl_success(*args): ''' Runs kubectl with the given args. Returns True if succesful, False if not. ''' try: kubectl(*args) return True except CalledProcessError: return False def kubectl_manifest(operation, manifest): ''' Wrap the kubectl creation command when using filepath resources :param operation - one of get, create, delete, replace :param manifest - filepath to the manifest ''' # Deletions are a special case if operation == 'delete': # Ensure we immediately remove requested resources with --now return kubectl_success(operation, '-f', manifest, '--now') else: # Guard against an error re-creating the same manifest multiple times if operation == 'create': # If we already have the definition, its probably safe to assume # creation was true. if kubectl_success('get', '-f', manifest): hookenv.log('Skipping definition for {}'.format(manifest)) return True # Execute the requested command that did not match any of the special # cases above return kubectl_success(operation, '-f', manifest) @when('nrpe-external-master.available') @when_not('nrpe-external-master.initial-config') def initial_nrpe_config(nagios=None): set_state('nrpe-external-master.initial-config') update_nrpe_config(nagios) @when('kubernetes-worker.config.created') @when('nrpe-external-master.available') @when_any('config.changed.nagios_context', 'config.changed.nagios_servicegroups')<|fim▁hole|> services = ('snap.kubelet.daemon', 'snap.kube-proxy.daemon') hostname = nrpe.get_nagios_hostname() current_unit = nrpe.get_nagios_unit_name() nrpe_setup = nrpe.NRPE(hostname=hostname) nrpe.add_init_service_checks(nrpe_setup, services, current_unit) nrpe_setup.write() @when_not('nrpe-external-master.available') @when('nrpe-external-master.initial-config') def remove_nrpe_config(nagios=None): remove_state('nrpe-external-master.initial-config') # List of systemd services for which the checks will be removed services = ('snap.kubelet.daemon', 'snap.kube-proxy.daemon') # The current nrpe-external-master interface doesn't handle a lot of logic, # use the charm-helpers code for now. hostname = nrpe.get_nagios_hostname() nrpe_setup = nrpe.NRPE(hostname=hostname) for service in services: nrpe_setup.remove_check(shortname=service) def set_privileged(): """Update the allow-privileged flag for kubelet. """ privileged = hookenv.config('allow-privileged') if privileged == 'auto': gpu_enabled = is_state('kubernetes-worker.gpu.enabled') privileged = 'true' if gpu_enabled else 'false' if privileged == 'true': set_state('kubernetes-worker.privileged') else: remove_state('kubernetes-worker.privileged') @when('config.changed.allow-privileged') @when('kubernetes-worker.config.created') def on_config_allow_privileged_change(): """React to changed 'allow-privileged' config value. """ set_state('kubernetes-worker.restart-needed') remove_state('config.changed.allow-privileged') @when('cuda.installed') @when('kubernetes-worker.config.created') @when_not('kubernetes-worker.gpu.enabled') def enable_gpu(): """Enable GPU usage on this node. """ config = hookenv.config() if config['allow-privileged'] == "false": hookenv.status_set( 'active', 'GPUs available. Set allow-privileged="auto" to enable.' ) return hookenv.log('Enabling gpu mode') try: # Not sure why this is necessary, but if you don't run this, k8s will # think that the node has 0 gpus (as shown by the output of # `kubectl get nodes -o yaml` check_call(['nvidia-smi']) except CalledProcessError as cpe: hookenv.log('Unable to communicate with the NVIDIA driver.') hookenv.log(cpe) return # Apply node labels _apply_node_label('gpu=true', overwrite=True) _apply_node_label('cuda=true', overwrite=True) set_state('kubernetes-worker.gpu.enabled') set_state('kubernetes-worker.restart-needed') @when('kubernetes-worker.gpu.enabled') @when_not('kubernetes-worker.privileged') @when_not('kubernetes-worker.restart-needed') def disable_gpu(): """Disable GPU usage on this node. This handler fires when we're running in gpu mode, and then the operator sets allow-privileged="false". Since we can no longer run privileged containers, we need to disable gpu mode. """ hookenv.log('Disabling gpu mode') # Remove node labels _apply_node_label('gpu', delete=True) _apply_node_label('cuda', delete=True) remove_state('kubernetes-worker.gpu.enabled') set_state('kubernetes-worker.restart-needed') @when('kubernetes-worker.gpu.enabled') @when('kube-control.connected') def notify_master_gpu_enabled(kube_control): """Notify kubernetes-master that we're gpu-enabled. """ kube_control.set_gpu(True) @when_not('kubernetes-worker.gpu.enabled') @when('kube-control.connected') def notify_master_gpu_not_enabled(kube_control): """Notify kubernetes-master that we're not gpu-enabled. """ kube_control.set_gpu(False) @when('kube-control.connected') def request_kubelet_and_proxy_credentials(kube_control): """ Request kubelet node authorization with a well formed kubelet user. This also implies that we are requesting kube-proxy auth. """ # The kube-cotrol interface is created to support RBAC. # At this point we might as well do the right thing and return the hostname # even if it will only be used when we enable RBAC nodeuser = 'system:node:{}'.format(gethostname().lower()) kube_control.set_auth_request(nodeuser) @when('kube-control.connected') def catch_change_in_creds(kube_control): """Request a service restart in case credential updates were detected.""" nodeuser = 'system:node:{}'.format(gethostname().lower()) creds = kube_control.get_auth_credentials(nodeuser) if creds \ and data_changed('kube-control.creds', creds) \ and creds['user'] == nodeuser: # We need to cache the credentials here because if the # master changes (master leader dies and replaced by a new one) # the new master will have no recollection of our certs. db.set('credentials', creds) set_state('worker.auth.bootstrapped') set_state('kubernetes-worker.restart-needed') @when_not('kube-control.connected') def missing_kube_control(): """Inform the operator they need to add the kube-control relation. If deploying via bundle this won't happen, but if operator is upgrading a a charm in a deployment that pre-dates the kube-control relation, it'll be missing. """ hookenv.status_set( 'blocked', 'Relate {}:kube-control kubernetes-master:kube-control'.format( hookenv.service_name())) @when('docker.ready') def fix_iptables_for_docker_1_13(): """ Fix iptables FORWARD policy for Docker >=1.13 https://github.com/kubernetes/kubernetes/issues/40182 https://github.com/kubernetes/kubernetes/issues/39823 """ cmd = ['iptables', '-w', '300', '-P', 'FORWARD', 'ACCEPT'] check_call(cmd) def _systemctl_is_active(application): ''' Poll systemctl to determine if the application is running ''' cmd = ['systemctl', 'is-active', application] try: raw = check_output(cmd) return b'active' in raw except Exception: return False class GetNodeNameFailed(Exception): pass def get_node_name(): # Get all the nodes in the cluster cmd = 'kubectl --kubeconfig={} get no -o=json'.format(kubeconfig_path) cmd = cmd.split() deadline = time.time() + 60 while time.time() < deadline: try: raw = check_output(cmd) break except CalledProcessError: hookenv.log('Failed to get node name for node %s.' ' Will retry.' % (gethostname())) time.sleep(1) else: msg = 'Failed to get node name for node %s' % gethostname() raise GetNodeNameFailed(msg) result = json.loads(raw.decode('utf-8')) if 'items' in result: for node in result['items']: if 'status' not in node: continue if 'addresses' not in node['status']: continue # find the hostname for address in node['status']['addresses']: if address['type'] == 'Hostname': if address['address'] == gethostname(): return node['metadata']['name'] # if we didn't match, just bail to the next node break msg = 'Failed to get node name for node %s' % gethostname() raise GetNodeNameFailed(msg) class ApplyNodeLabelFailed(Exception): pass def _apply_node_label(label, delete=False, overwrite=False): ''' Invoke kubectl to apply node label changes ''' nodename = get_node_name() # TODO: Make this part of the kubectl calls instead of a special string cmd_base = 'kubectl --kubeconfig={0} label node {1} {2}' if delete is True: label_key = label.split('=')[0] cmd = cmd_base.format(kubeconfig_path, nodename, label_key) cmd = cmd + '-' else: cmd = cmd_base.format(kubeconfig_path, nodename, label) if overwrite: cmd = '{} --overwrite'.format(cmd) cmd = cmd.split() deadline = time.time() + 60 while time.time() < deadline: code = subprocess.call(cmd) if code == 0: break hookenv.log('Failed to apply label %s, exit code %d. Will retry.' % ( label, code)) time.sleep(1) else: msg = 'Failed to apply label %s' % label raise ApplyNodeLabelFailed(msg) def _parse_labels(labels): ''' Parse labels from a key=value string separated by space.''' label_array = labels.split(' ') sanitized_labels = [] for item in label_array: if '=' in item: sanitized_labels.append(item) else: hookenv.log('Skipping malformed option: {}'.format(item)) return sanitized_labels<|fim▁end|>
def update_nrpe_config(unused=None):
<|file_name|>subsurface_pt_BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.1"> <context> <name>About</name> <message> <location filename="../mobile-widgets/qml/About.qml" line="10"/> <location filename="../mobile-widgets/qml/About.qml" line="19"/> <source>About Subsurface-mobile</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="36"/> <source>A mobile version of the free Subsurface divelog software. </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="37"/> <source>View your dive logs while on the go.</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="48"/> <source>Version: %1 © Subsurface developer team 2011-2017</source> <translation type="unfinished"/> </message> </context> <context> <name>BtDeviceSelectionDialog</name> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="14"/> <source>Remote Bluetooth device selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="32"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="35"/> <source>Discovered devices</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="41"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="38"/> <source>Save</source> <translation>Salvar</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="54"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="39"/> <source>Quit</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="83"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="36"/> <source>Scan</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="96"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="37"/> <source>Clear</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="119"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="29"/> <source>Local Bluetooth device details</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="128"/> <source>Name: </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="142"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="31"/> <source>Address:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="171"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="33"/> <source>Bluetooth powered on</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="193"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="34"/> <source>Turn on/off</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="203"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="30"/> <source>Select device:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="32"/> <source>Name:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="56"/> <source>Could not initialize Winsock version 2.2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="134"/> <source>Trying to turn on the local Bluetooth device...</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="137"/> <source>Trying to turn off the local Bluetooth device...</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="167"/> <source>Remote devices list was cleared.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="183"/> <source>Scanning for remote devices...</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="192"/> <source>Scanning finished successfully.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="208"/> <source>The local Bluetooth device was %1.</source> <extracomment>%1 will be replaced with &quot;turned on&quot; or &quot;turned off&quot;</extracomment> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="209"/> <source>turned on</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="209"/> <source>turned off</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="225"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="339"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="359"/> <source>UNPAIRED</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="229"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="344"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="357"/> <source>PAIRED</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="232"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="349"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="358"/> <source>AUTHORIZED_PAIRED</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="236"/> <source>%1 (%2) [State: %3]</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="253"/> <source>The device %1 can be used for connection. You can press the Save button.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="262"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="375"/> <source>The device %1 must be paired in order to be used. Please use the context menu for pairing options.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="286"/> <source>The local device was changed.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="306"/> <source>Pair</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="307"/> <source>Remove pairing</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="323"/> <source>Trying to pair device %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="327"/> <source>Trying to unpair device %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="340"/> <source>Device %1 was unpaired.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="347"/> <source>Device %1 was paired.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="352"/> <source>Device %1 was paired and is authorized.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="378"/> <source>The device %1 can now be used for connection. You can press the Save button.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="390"/> <source>Local device error: %1.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="391"/> <source>Pairing error. If the remote device requires a custom PIN code, please try to pair the devices using your operating system. </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="393"/> <source>Unknown error</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="402"/> <source>The Bluetooth adaptor is powered off, power it on before doing discovery.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="405"/> <source>Writing to or reading from the device resulted in an error.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="411"/> <source>An unknown error has occurred.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="416"/> <source>Device discovery error: %1.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="444"/> <source>Not available</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="451"/> <source>The local Bluetooth adapter cannot be accessed.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="501"/> <source>The device discovery agent was not created because the %1 address does not match the physical adapter address of any local Bluetooth device.</source> <translation type="unfinished"/> </message> </context> <context> <name>BuddyFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="619"/> <source>Person: </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="620"/> <source>Searches for buddies and divemasters</source> <translation type="unfinished"/> </message> </context> <context> <name>BuddyFilterModel</name> <message> <location filename="../qt-models/filtermodels.cpp" line="248"/> <source>No buddies</source> <translation type="unfinished"/> </message> </context> <context> <name>CloudCredentials</name> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="50"/> <source>Cloud credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="56"/> <source>Email</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="68"/> <source>Password</source> <translation>Senha</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="92"/> <source>Show password</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="97"/> <source>PIN</source> <translation type="unfinished"/> </message> </context> <context> <name>ColumnNameProvider</name> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Dive #</source> <translation>Mergulho nº</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Time</source> <translation>Horário</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>GPS</source> <translation>GPS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Cyl. size</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="42"/> <source>Start pressure</source> <translation>Pressão inicial</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>End pressure</source> <translation>Pressão final</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Max. depth</source> <translation>Profundidade máxima</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Avg. depth</source> <translation>Profundidade Média</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Tags</source> <translation>Rótulos</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Air temp.</source> <translation>Temperatura do ar</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="43"/> <source>Water temp.</source> <translation>Temperatura da água</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>O₂</source> <translation>O₂</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>He</source> <translation>He</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample time</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample CNS</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="44"/> <source>Sample NDL</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="45"/> <source>Sample TTS</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="45"/> <source>Sample stopdepth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="45"/> <source>Sample pressure</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="46"/> <source>Sample sensor1 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="46"/> <source>Sample sensor2 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="46"/> <source>Sample sensor3 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Sample setpoint</source> <translation type="unfinished"/> </message> </context> <context> <name>ConfigureDiveComputer</name> <message> <location filename="../core/configuredivecomputer.cpp" line="220"/> <source>Could not save the backup file %1. Error Message: %2</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="236"/> <source>Could not open backup file: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="584"/> <source>Dive computer details read successfully</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="593"/> <source>Setting successfully written to device</source> <translation>Configurações armazenadas com sucesso</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="602"/> <source>Device firmware successfully updated</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="611"/> <source>Device settings successfully reset</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="627"/> <source>Unable to create libdivecomputer context</source> <translation>Não é possivel criar contexto da libdivecomputer</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="656"/> <source>Could not a establish connection to the dive computer.</source> <translation type="unfinished"/> </message> </context> <context> <name>ConfigureDiveComputerDialog</name> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="14"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1518"/> <source>Configure dive computer</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="22"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1519"/> <source>Device or mount point</source> <translation>Disco ou ponto de montágem</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="47"/> <source>Connect via Bluetooth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="54"/> <source>Connect</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="64"/> <source>Disconnect</source> <translation>Desconectar</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="80"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1521"/> <source>Retrieve available details</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="90"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1523"/> <source>Read settings from backup file or from device before writing to the device</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="93"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1525"/> <source>Save changes to device</source> <translation>Salvar alterações no dispositivo</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="116"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1527"/> <source>Read settings from backup file or from device before writing to a backup file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="119"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1529"/> <source>Backup</source> <translation>Backup</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="129"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1530"/> <source>Restore backup</source> <translation>Restaurar backup</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="139"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1531"/> <source>Update firmware</source> <translation>Atualizar firmware</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="163"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1532"/> <source>Save libdivecomputer logfile</source> <translation>Salvar arquivo de log da biblioteca libdivecomputer</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="170"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1520"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1533"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="177"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1534"/> <source>Cancel</source> <translation>Cancelar</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="214"/> <source>OSTC 3,Sport,Cr,2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="223"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1541"/> <source>Suunto Vyper family</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="232"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1543"/> <source>OSTC, Mk.2/2N/2C</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="253"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1561"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1937"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1616"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1764"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1781"/> <source>Basic settings</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="260"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1575"/> <source>Eco</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="265"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1576"/> <source>Medium</source> <translation>Médio</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="270"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1577"/> <source>High</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="278"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="826"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="849"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="875"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="927"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="993"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1019"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1101"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1117"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1450"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2278"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2382"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2408"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2434"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2474"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2497"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1586"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1621"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1623"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1625"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1628"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1637"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1638"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1710"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1785"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1789"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1801"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1803"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1806"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1807"/> <source>%</source> <translation>%</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="289"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1552"/> <source>English</source> <translation>Inglês</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="294"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1553"/> <source>German</source> <translation>Alemão</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="299"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1554"/> <source>French</source> <translation>Francês</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="304"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1555"/> <source>Italian</source> <translation>Italiano</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="313"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1582"/> <source>m/°C</source> <translation>m/°C</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="318"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1583"/> <source>ft/°F</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="326"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1656"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1943"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1546"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1726"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1766"/> <source>Serial No.</source> <translation>No. Serial</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="349"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1679"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1980"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1547"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1727"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1767"/> <source>Firmware version</source> <translation>Versão da firmware</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="360"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1568"/> <source>MMDDYY</source> <translation>MMDDAA</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="365"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1569"/> <source>DDMMYY</source> <translation>DDMMAA</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="370"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1570"/> <source>YYMMDD</source> <translation>AAMMDD</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="385"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1549"/> <source>Language</source> <translation>Língua</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="395"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2063"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1565"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1780"/> <source>Date format</source> <translation>Formato da data</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="405"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1572"/> <source>Brightness</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="415"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1850"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1579"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1753"/> <source>Units</source> <translation>Unidades</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="425"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1585"/> <source>Salinity (0-5%)</source> <translation>Salinidade (0-5%)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="438"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1615"/> <source>Reset device to default settings</source> <translation>Restaurar para configurações padrão</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="452"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1590"/> <source>230LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="457"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1591"/> <source>330LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="462"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1592"/> <source>390LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="467"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1593"/> <source>440LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="472"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1594"/> <source>660LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="477"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1595"/> <source>820LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="482"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1596"/> <source>1090LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="487"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1597"/> <source>1370LSB/Gauss</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="521"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1587"/> <source>Compass gain</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="531"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1799"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1745"/> <source>Computer model</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="538"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1713"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1990"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1548"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1729"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1768"/> <source>Custom text</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="556"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1560"/> <source>OC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="561"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1561"/> <source>CC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="566"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2336"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1562"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1793"/> <source>Gauge</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="571"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1563"/> <source>Apnea</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="579"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1557"/> <source>Dive mode</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="590"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1602"/> <source>2s</source> <translation>2s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="595"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1769"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1603"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1739"/> <source>10s</source> <translation>10s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="603"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2034"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1599"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1779"/> <source>Sampling rate</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="614"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1608"/> <source>Standard</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="619"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1609"/> <source>Red</source> <translation>Vermelho</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="624"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1610"/> <source>Green</source> <translation>Verde</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="629"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1611"/> <source>Blue</source> <translation>Azul</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="637"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2092"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1613"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1770"/> <source>Sync dive computer time with PC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="644"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1605"/> <source>Dive mode color</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="654"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2020"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1614"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1771"/> <source>Show safety stop</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="661"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2145"/> <source>End Depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="671"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2162"/> <source> s</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="687"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1953"/> <source>Length</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="694"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2138"/> <source>Start Depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="701"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2152"/> <source>Reset Depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="711"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="736"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="758"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="904"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2181"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2206"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2228"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2307"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1626"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1786"/> <source> m</source> <translation>m</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="778"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2248"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1643"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1810"/> <source>Advanced settings</source> <translation>Configurações avançadas</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="784"/> <source>Left button sensitivity</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="791"/> <source>Always show ppO2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="798"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2254"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1617"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1782"/> <source>Alt GF can be selected underwater</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="805"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2271"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1618"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1783"/> <source>Future TTS</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="812"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1619"/> <source>Pressure sensor offset</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="819"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2490"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1620"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1809"/> <source>GFLow</source> <translation>GFlow</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="842"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2467"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1622"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1808"/> <source>GFHigh</source> <translation>GFHigh</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="865"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2261"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1624"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1784"/> <source>Desaturation</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="917"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2320"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1627"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1787"/> <source>Decotype</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="943"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1629"/> <source> mbar</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="960"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2331"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1633"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1792"/> <source>ZH-L16</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="965"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1634"/> <source>ZH-L16+GF</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="973"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2369"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1630"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1788"/> <source> min</source> <translation>min</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="983"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2398"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1636"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1800"/> <source>Last deco</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1009"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2424"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1640"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1802"/> <source>Alt GFLow</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1035"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2450"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1641"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1804"/> <source>Alt GFHigh</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1042"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2457"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1639"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1805"/> <source>Saturation</source> <translation>Saturação</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1052"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1642"/> <source>Flip screen</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1059"/> <source>Right button sensitivity</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1066"/> <source>MOD warning</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1073"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2513"/> <source>Graphical speed indicator</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1080"/> <source>Dynamic ascent rate</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1087"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2552"/> <source>Bottom gas consumption</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1094"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2559"/> <source>Deco gas consumption</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1133"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1149"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2520"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2536"/> <source> ℓ/min</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1165"/> <source>Temperature sensor offset</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1172"/> <source>°C</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1192"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2567"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1721"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1876"/> <source>Gas settings</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1235"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1320"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2610"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2695"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1645"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1668"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1812"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1835"/> <source>%O₂</source> <translation>%O₂</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1240"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1325"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2615"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2700"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1647"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1670"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1814"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1837"/> <source>%He</source> <translation>%He</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1245"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1330"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2620"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2705"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1649"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1672"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1816"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1839"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1250"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1335"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1410"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2625"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2710"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2775"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1651"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1674"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1818"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1841"/> <source>Change depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1255"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2630"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1656"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1823"/> <source>Gas 1</source> <translation>Gás 1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1260"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2635"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1658"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1825"/> <source>Gas 2</source> <translation>Gás 2</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1265"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2640"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1660"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1827"/> <source>Gas 3</source> <translation>Gás 3</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1270"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2645"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1662"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1829"/> <source>Gas 4</source> <translation>Gás 4</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1275"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2650"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1664"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1831"/> <source>Gas 5</source> <translation>Gás 5</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1340"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2715"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1679"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1846"/> <source>Dil 1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1345"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2720"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1681"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1848"/> <source>Dil 2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1350"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2725"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1683"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1850"/> <source>Dil 3</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1355"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2730"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1685"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1852"/> <source>Dil 4</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1360"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2735"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1687"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1854"/> <source>Dil 5</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1405"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2770"/> <source>Setpoint</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1415"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2780"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1698"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1865"/> <source>SP 1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1420"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2785"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1700"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1867"/> <source>SP 2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1425"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2790"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1702"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1869"/> <source>SP 3</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1430"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1704"/> <source>SP 4</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1435"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1706"/> <source>SP 5</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1443"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1709"/> <source>O₂ in calibration gas</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1467"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1713"/> <source>Fixed setpoint</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1472"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1714"/> <source>Sensor</source> <translation>Sensor</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1480"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1716"/> <source>Setpoint fallback</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1503"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1519"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2811"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2827"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1717"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1718"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1872"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1873"/> <source> cbar</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1535"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2843"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1719"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1874"/> <source>pO₂ max</source> <translation>pO₂ max</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1542"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2850"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1720"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1875"/> <source>pO₂ min</source> <translation>pO₂ min</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1583"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1722"/> <source>Safety level</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1609"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1723"/> <source>Altitude range</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1616"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1724"/> <source>Model</source> <translation>Modelo</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1636"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2013"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1725"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1778"/> <source>Number of dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1696"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1728"/> <source>Max depth</source> <translation>Profundidade máxima</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1743"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1732"/> <source>P0 (none)</source> <extracomment>Suunto safety level</extracomment> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1748"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1733"/> <source>P1 (medium)</source> <extracomment>Suunto safety level</extracomment> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1753"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1734"/> <source>P2 (high)</source> <extracomment>Suunto safety level</extracomment> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1761"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1736"/> <source>Sample rate</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1774"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1740"/> <source>20s</source> <translation>20s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1779"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1741"/> <source>30s</source> <translation>30s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1784"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1742"/> <source>60s</source> <translation>60s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1792"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1744"/> <source>Total dive time</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1816"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1908"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1746"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1762"/> <source>min</source> <translation>min</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1830"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1749"/> <source>24h</source> <translation>24h</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1835"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1750"/> <source>12h</source> <translation>12h</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1843"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1752"/> <source>Time format</source> <translation>Formato da hora</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1858"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1756"/> <source>Imperial</source> <translation>Imperial</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1863"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1757"/> <source>Metric</source> <translation>Métrico</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1874"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1759"/> <source>s</source> <translation>s</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1881"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1760"/> <source>Light</source> <translation>Leve</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1898"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1761"/> <source>Depth alarm</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1918"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1763"/> <source>Time alarm</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2074"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1774"/> <source>MM/DD/YY</source> <translation>MM/DD/AA</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2079"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1775"/> <source>DD/MM/YY</source> <translation>DD/MM/AA</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2084"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1776"/> <source>YY/MM/DD</source> <translation>AA/MM/DD</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2099"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1765"/> <source>Salinity</source> <translation>Salinidade</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2109"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1769"/> <source>kg/ℓ</source> <translation>kg/ℓ</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2341"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1794"/> <source>ZH-L16 CC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2346"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1795"/> <source>Apnoea</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2351"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1796"/> <source>L16-GF OC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2356"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1797"/> <source>L16-GF CC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2361"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1798"/> <source>PSCR-GF</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_configuredivecomputerdialog.h" line="1539"/> <source>OSTC 3</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_configuredivecomputerdialog.h" line="1691"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1858"/> <source>Set point [cbar]</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_configuredivecomputerdialog.h" line="1693"/> <location filename="../build/ui_configuredivecomputerdialog.h" line="1860"/> <source>Change depth [m]</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1110"/> <source>Backup dive computer settings</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1111"/> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1132"/> <source>Backup files (*.xml)</source> <translation>Arquivos de backup (*.xml)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1115"/> <source>XML backup error</source> <translation>Erro no XML de backup</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1116"/> <source>An error occurred while saving the backup file. %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1119"/> <source>Backup succeeded</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1120"/> <source>Your settings have been saved to: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1131"/> <source>Restore dive computer settings</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1137"/> <source>XML restore error</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1138"/> <source>An error occurred while restoring the backup file. %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1142"/> <source>Restore succeeded</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1143"/> <source>Your settings have been restored successfully.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1153"/> <source>Select firmware file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1154"/> <source>All files (*.*)</source> <translation>Todos arquivos (*.*)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1210"/> <source>Choose file for divecomputer download logfile</source> <translation>Escolha o arquivo para recebimento do arquivo de log do computador de mergulho</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1211"/> <source>Log files (*.log)</source> <translation>Arquivos de log (*.log)</translation> </message> </context> <context> <name>ContextDrawer</name> <message> <location filename="../mobile-widgets/qml/kirigami/src/controls/ContextDrawer.qml" line="76"/> <source>Actions</source> <translation type="unfinished"/> </message> </context> <context> <name>CylindersModel</name> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Size</source> <translation>Tamanho</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Work press.</source> <translation>Pressão de trabalho</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Start press.</source> <translation>Pressão inicial</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>End press.</source> <translation>Pressão final</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>O₂%</source> <translation>O₂%</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>He%</source> <translation>He%</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> <source>Deco switch at</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> <source>Bot. MOD</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> <source>MND</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> <source>Use</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="44"/> <source>cuft</source> <translation>pés cúbicos</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="48"/> <source>ℓ</source> <translation>ℓ</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="177"/> <source>Clicking here will remove this cylinder.</source> <translation>Ao clicar aqui irá eliminar este cilindro.</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="180"/> <source>Switch depth for deco gas. Calculated using Deco pO₂ preference, unless set manually.</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="183"/> <source>Calculated using Bottom pO₂ preference. Setting MOD adjusts O₂%, set to &apos;*&apos; for best O₂% for max depth.</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="186"/> <source>Calculated using Best Mix END preference. Setting MND adjusts He%, set to &apos;*&apos; for best He% for max depth.</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="444"/> <source>Cylinder cannot be removed</source> <translation>Cilindro não pode ser eliminado</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="445"/> <source>This gas is in use. Only cylinders that are not used in the dive can be removed.</source> <translation>Esse gás está em uso, Apenas cilindros que não estão sendo usados podem ser removidos.</translation> </message> </context> <context> <name>DiveComponentSelectionDialog</name> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="23"/> <location filename="../build/ui_divecomponentselection.h" line="139"/> <source>Component selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="52"/> <location filename="../build/ui_divecomponentselection.h" line="140"/> <source>Which components would you like to copy</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="73"/> <location filename="../build/ui_divecomponentselection.h" line="141"/> <source>Dive site</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="80"/> <location filename="../build/ui_divecomponentselection.h" line="142"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="87"/> <location filename="../build/ui_divecomponentselection.h" line="143"/> <source>Visibility</source> <translation>Visibilidade</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="94"/> <location filename="../build/ui_divecomponentselection.h" line="144"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="101"/> <location filename="../build/ui_divecomponentselection.h" line="145"/> <source>Tags</source> <translation>Rótulos</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="108"/> <location filename="../build/ui_divecomponentselection.h" line="146"/> <source>Weights</source> <translation>Lastro</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="115"/> <location filename="../build/ui_divecomponentselection.h" line="147"/> <source>Cylinders</source> <translation>Cilindros</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="122"/> <location filename="../build/ui_divecomponentselection.h" line="148"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="129"/> <location filename="../build/ui_divecomponentselection.h" line="149"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="136"/> <location filename="../build/ui_divecomponentselection.h" line="150"/> <source>Rating</source> <translation>Classificação</translation> </message> </context> <context> <name>DiveComputerManagementDialog</name> <message> <location filename="../desktop-widgets/divecomputermanagementdialog.ui" line="17"/> <location filename="../build/ui_divecomputermanagementdialog.h" line="65"/> <source>Edit dive computer nicknames</source> <translation>Editar o apelido dos computadores de mergulho</translation> </message> <message> <location filename="../desktop-widgets/divecomputermanagementdialog.cpp" line="49"/> <source>Remove the selected dive computer?</source> <translation>Remover o computador de mergulho selecionado?</translation> </message> <message> <location filename="../desktop-widgets/divecomputermanagementdialog.cpp" line="50"/> <source>Are you sure that you want to remove the selected dive computer?</source> <translation>Tem a certeza que deseja remover o computador de mergulho selecionado?</translation> </message> </context> <context> <name>DiveComputerModel</name> <message> <location filename="../qt-models/divecomputermodel.cpp" line="7"/> <source>Model</source> <translation>Modelo</translation> </message> <message> <location filename="../qt-models/divecomputermodel.cpp" line="7"/> <source>Device ID</source> <translation>ID do dispositivo</translation> </message> <message> <location filename="../qt-models/divecomputermodel.cpp" line="7"/> <source>Nickname</source> <translation>Apelido</translation> </message> <message> <location filename="../qt-models/divecomputermodel.cpp" line="41"/> <source>Clicking here will remove this dive computer.</source> <translation>Clicar aqui removerá os computadores de mergulho</translation> </message> </context> <context> <name>DiveDetails</name> <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="38"/> <source>Dive details</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="72"/> <source>Delete dive</source> <translation>Remover mergulho</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="89"/> <source>Show on map</source> <translation type="unfinished"/> </message> </context> <context> <name>DiveDetailsEdit</name> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="80"/> <source>Dive %1</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="84"/> <source>Date:</source> <translation>Data:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="92"/> <source>Location:</source> <translation>Localidade:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="101"/> <source>Coordinates:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="110"/> <source>Use current GPS location:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="124"/> <source>Depth:</source> <translation>Profundidade:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="133"/> <source>Duration:</source> <translation>Duração:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="143"/> <source>Air Temp:</source> <translation>Temperatura do ar:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="152"/> <source>Water Temp:</source> <translation>Temperatura da água:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="161"/> <source>Suit:</source> <translation>Roupa:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="176"/> <source>Buddy:</source> <translation>Companheiro:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="191"/> <source>Dive Master:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="206"/> <source>Weight:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="216"/> <source>Cylinder:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="231"/> <source>Gas mix:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="241"/> <source>Start Pressure:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="250"/> <source>End Pressure:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="260"/> <source>Notes:</source> <translation>Notas:</translation> </message> </context> <context> <name>DiveDetailsView</name> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="63"/> <source>Date: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="80"/> <source>Depth: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="89"/> <source>Duration: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="121"/> <source>No profile to show</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="139"/> <source>Dive Details</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="144"/> <source>Suit:</source> <translation>Roupa:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="158"/> <source>Air Temp:</source> <translation>Temperatura do ar:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="172"/> <source>Cylinder:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="185"/> <source>Water Temp:</source> <translation>Temperatura da água:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="198"/> <source>Dive Master:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="211"/> <source>Weight:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="224"/> <source>Buddy:</source> <translation>Companheiro:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="237"/> <source>SAC:</source> <translation>SAC:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="252"/> <source>Notes</source> <translation>Notas</translation> </message> </context> <context> <name>DiveEventItem</name> <message> <location filename="../profile-widget/diveeventitem.cpp" line="165"/> <source>Manual switch to OC</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="167"/> <source> begin</source> <comment>Starts with space!</comment> <translation>início</translation> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="168"/> <source> end</source> <comment>Starts with space!</comment> <translation>fim</translation> </message> </context> <context> <name>DiveImportedModel</name> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="656"/> <source>Date/time</source> <translation>Data/hora</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="658"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="660"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="682"/> <source>h:</source> <translation>h:</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="682"/> <source>min</source> <translation>min</translation> </message> </context> <context> <name>DiveList</name> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="12"/> <location filename="../mobile-widgets/qml/DiveList.qml" line="227"/> <location filename="../mobile-widgets/qml/DiveList.qml" line="233"/> <source>Dive list</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="95"/> <source>Depth: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="106"/> <source>Duration: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="223"/> <source>Cloud credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="229"/> <source>Please tap the &apos;+&apos; button to add a dive</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="248"/> <source>No dives in dive list</source> <translation type="unfinished"/> </message> </context> <context> <name>DiveListView</name> <message> <location filename="../desktop-widgets/divelistview.cpp" line="849"/> <source>Expand all</source> <translation>Expandir todos</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="851"/> <source>Collapse all</source> <translation>Esconder todos</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="855"/> <source>Collapse others</source> <translation>Esconder outros</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="859"/> <source>Remove dive(s) from trip</source> <translation>Remover mergulhos de viagem</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="860"/> <source>Create new trip above</source> <translation>Criar viagem acima</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="874"/> <source>Add dive(s) to trip immediately above</source> <translation>Adicionar mergulhos para a viagem acima</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="876"/> <source>Add dive(s) to trip immediately below</source> <translation>Adicionar mergulhos para viagem abaixo</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="880"/> <source>Merge trip with trip above</source> <translation>Juntar viagem com viagem acima</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="881"/> <source>Merge trip with trip below</source> <translation>Juntar viagem com viagem abaixo</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="885"/> <source>Delete dive(s)</source> <translation>Apagar mergulho(s)</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="887"/> <source>Mark dive(s) invalid</source> <translation>Marcar megulho(s) como inválidos</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="891"/> <source>Merge selected dives</source> <translation>Juntar mergulhos selecionados</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="893"/> <source>Renumber dive(s)</source> <translation>Renumerar mergulho(s)</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="894"/> <source>Shift dive times</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="895"/> <source>Split selected dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="896"/> <source>Load image(s) from file(s)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="897"/> <source>Load image(s) from web</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="919"/> <source>Open image files</source> <translation>Abrir imagens</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="919"/> <source>Image files (*.jpg *.jpeg *.pnm *.tif *.tiff)</source> <translation>Imagens (*.jpg *.jpeg *.pnm *.tif *.tiff)</translation> </message> </context> <context> <name>DiveLocationModel</name> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="330"/> <source>Create a new dive site, copying relevant information from the current dive.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="331"/> <source>Create a new dive site with this name</source> <translation type="unfinished"/> </message> </context> <context> <name>DiveLogExportDialog</name> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="14"/> <location filename="../build/ui_divelogexportdialog.h" line="349"/> <source>Export dive log files</source> <translation>Exportar arquivo de log</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="44"/> <location filename="../build/ui_divelogexportdialog.h" line="369"/> <source>General export</source> <translation>Exportações Gerais</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="103"/> <location filename="../build/ui_divelogexportdialog.h" line="351"/> <source>Export format</source> <translation>Formato de exportação</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="115"/> <location filename="../build/ui_divelogexportdialog.h" line="352"/> <source>Subsurface &amp;XML</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="134"/> <location filename="../build/ui_divelogexportdialog.h" line="353"/> <source>UDDF</source> <translation>UDDF</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="147"/> <location filename="../build/ui_divelogexportdialog.h" line="354"/> <source>di&amp;velogs.de</source> <translation type="unfinished"/> </message> <message><|fim▁hole|> <source>DiveShare</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="167"/> <location filename="../build/ui_divelogexportdialog.h" line="356"/> <source>CSV dive profile</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="177"/> <location filename="../build/ui_divelogexportdialog.h" line="357"/> <source>CSV dive details</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="187"/> <location filename="../build/ui_divelogexportdialog.h" line="358"/> <source>Worldmap</source> <translation>Globo</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="197"/> <source>TeX</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="207"/> <location filename="../build/ui_divelogexportdialog.h" line="359"/> <source>I&amp;mage depths</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="253"/> <location filename="../build/ui_divelogexportdialog.h" line="360"/> <source>Selection</source> <translation>Seleção</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="262"/> <location filename="../desktop-widgets/divelogexportdialog.ui" line="356"/> <location filename="../build/ui_divelogexportdialog.h" line="361"/> <location filename="../build/ui_divelogexportdialog.h" line="372"/> <source>Selected dives</source> <translation>Mergulhos selecionados</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="272"/> <location filename="../build/ui_divelogexportdialog.h" line="362"/> <source>All dives</source> <translation>Todos os mergulhos</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="285"/> <location filename="../build/ui_divelogexportdialog.h" line="363"/> <source>CSV units</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="298"/> <location filename="../build/ui_divelogexportdialog.h" line="366"/> <source>Metric</source> <translation>Métrico</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="303"/> <location filename="../build/ui_divelogexportdialog.h" line="367"/> <source>Imperial</source> <translation>Imperial</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="316"/> <location filename="../build/ui_divelogexportdialog.h" line="396"/> <source>HTML</source> <translation>HTML</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="334"/> <location filename="../build/ui_divelogexportdialog.h" line="370"/> <source>General settings</source> <translation>Configurações Gerais</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="340"/> <location filename="../build/ui_divelogexportdialog.h" line="371"/> <source>Subsurface numbers</source> <translation>Numeros do Subsurface</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="369"/> <location filename="../build/ui_divelogexportdialog.h" line="373"/> <source>Export yearly statistics</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="385"/> <location filename="../build/ui_divelogexportdialog.h" line="374"/> <source>All di&amp;ves</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="395"/> <location filename="../build/ui_divelogexportdialog.h" line="375"/> <source>Export list only</source> <translation>Exportar apenas a lista</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="402"/> <location filename="../build/ui_divelogexportdialog.h" line="376"/> <source>Export photos</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="418"/> <location filename="../build/ui_divelogexportdialog.h" line="377"/> <source>Style options</source> <translation>Opções de estilo</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="433"/> <location filename="../build/ui_divelogexportdialog.h" line="378"/> <source>Font</source> <translation>Fonte</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="443"/> <location filename="../build/ui_divelogexportdialog.h" line="379"/> <source>Font size</source> <translation>Tamanho da fonte</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="454"/> <location filename="../build/ui_divelogexportdialog.h" line="382"/> <source>8</source> <translation>8</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="459"/> <location filename="../build/ui_divelogexportdialog.h" line="383"/> <source>10</source> <translation>10</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="464"/> <location filename="../build/ui_divelogexportdialog.h" line="384"/> <source>12</source> <translation>12</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="469"/> <location filename="../build/ui_divelogexportdialog.h" line="385"/> <source>14</source> <translation>14</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="474"/> <location filename="../build/ui_divelogexportdialog.h" line="386"/> <source>16</source> <translation>16</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="479"/> <location filename="../build/ui_divelogexportdialog.h" line="387"/> <source>18</source> <translation>18</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="484"/> <location filename="../build/ui_divelogexportdialog.h" line="388"/> <source>20</source> <translation>20</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="492"/> <location filename="../build/ui_divelogexportdialog.h" line="390"/> <source>Theme</source> <translation>Tema</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="503"/> <location filename="../build/ui_divelogexportdialog.h" line="393"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="99"/> <source>Light</source> <translation>Leve</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="508"/> <location filename="../build/ui_divelogexportdialog.h" line="394"/> <source>Sand</source> <translation>Areia</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="76"/> <source>Generic format that is used for data exchange between a variety of diving related programs.</source> <translation>Formato genérico que é utilizado para troca de dados em uma variedade de programas de mergulho</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="78"/> <source>Comma separated values describing the dive profile.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="80"/> <source>Comma separated values of the dive information. This includes most of the dive details but no profile information.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="82"/> <source>Send the dive data to divelogs.de website.</source> <translation>Enviar os dados para o site do divelogs.de</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="84"/> <source>Send the dive data to dive-share.appspot.com website</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="86"/> <source>HTML export of the dive locations, visualized on a world map.</source> <translation>Exportação HTML de pontos de mergulho visualizados no mundo</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="88"/> <source>Subsurface native XML format.</source> <translation>Formato nativo do Subsurface</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="90"/> <source>Write depths of images to file.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="92"/> <source>Write dive as TeX macros to file.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="137"/> <source>Export UDDF file as</source> <translation>Exportar arquivo UDDF como</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="138"/> <source>UDDF files (*.uddf *.UDDF)</source> <translation>Arquivos UDDF (*.uddf *.UDDF)</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="141"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="145"/> <source>Export CSV file as</source> <translation>Exportar arquivo CSV como</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="142"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="146"/> <source>CSV files (*.csv *.CSV)</source> <translation>Arquivos CSV (*.csv *.CSV)</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="152"/> <source>Export world map</source> <translation>Exportar mapa do mundo</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="153"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="177"/> <source>HTML files (*.html)</source> <translation>Arquivos HTML (*.html)</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="157"/> <source>Export Subsurface XML</source> <translation>Exportar XML do Subsurface</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="158"/> <source>XML files (*.xml *.ssrf)</source> <translation>Arquivos XML (*.xml *.ssrf)</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="166"/> <source>Save image depths</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="170"/> <source>Export to TeX file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="170"/> <source>TeX files (*.tex)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="176"/> <source>Export HTML files as</source> <translation>Exportar arquivo HTML como</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="192"/> <source>Please wait, exporting...</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="227"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="311"/> <source>Can&apos;t open file %s</source> <translation>Não é possivel abrir o arquivo %s</translation> </message> </context> <context> <name>DiveLogImportDialog</name> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="14"/> <location filename="../build/ui_divelogimportdialog.h" line="149"/> <source>Import dive log file</source> <translation>Importar arquivo com log de mergulho</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="89"/> <location filename="../build/ui_divelogimportdialog.h" line="152"/> <source>dd.mm.yyyy</source> <translation>dd.mm.aaaa</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="94"/> <location filename="../build/ui_divelogimportdialog.h" line="153"/> <source>mm/dd/yyyy</source> <translation>mm/dd/aaaa</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="99"/> <location filename="../build/ui_divelogimportdialog.h" line="154"/> <source>yyyy-mm-dd</source> <translation>aaaa-mm-dd</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="108"/> <location filename="../build/ui_divelogimportdialog.h" line="158"/> <source>Seconds</source> <translation>Segundos</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="113"/> <location filename="../build/ui_divelogimportdialog.h" line="159"/> <source>Minutes</source> <translation>Minutos</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="118"/> <location filename="../build/ui_divelogimportdialog.h" line="160"/> <source>Minutes:seconds</source> <translation>Minutos:segundos</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="127"/> <location filename="../build/ui_divelogimportdialog.h" line="164"/> <source>Metric</source> <translation>Métrico</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="132"/> <location filename="../build/ui_divelogimportdialog.h" line="165"/> <source>Imperial</source> <translation>Imperial</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="155"/> <location filename="../build/ui_divelogimportdialog.h" line="167"/> <source>Drag the tags above to each corresponding column below</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="355"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="528"/> <source>Tab</source> <translation>Tab</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="598"/> <source>Some column headers were pre-populated; please drag and drop the headers so they match the column they are in.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="636"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="761"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="857"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="925"/> <source>Sample time</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="638"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="763"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="859"/> <source>Sample depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="640"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="765"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="861"/> <source>Sample temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="642"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="767"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="863"/> <source>Sample pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="644"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="769"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="865"/> <source>Sample sensor1 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="646"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="771"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="867"/> <source>Sample sensor2 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="648"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="773"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="869"/> <source>Sample sensor3 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="650"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="775"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="871"/> <source>Sample CNS</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="652"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="777"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="873"/> <source>Sample NDL</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="654"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="779"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="875"/> <source>Sample TTS</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="656"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="781"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="877"/> <source>Sample stopdepth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="658"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="783"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="879"/> <source>Sample pressure</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="660"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="785"/> <source>Sample setpoint</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="664"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="759"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="929"/> <source>Dive #</source> <translation>Mergulho nº</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="665"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="753"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="931"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="666"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="757"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="933"/> <source>Time</source> <translation>Horário</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="667"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="935"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="668"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="941"/> <source>Max. depth</source> <translation>Profundidade máxima</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="669"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="943"/> <source>Avg. depth</source> <translation>Profundidade Média</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="670"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="975"/> <source>Air temp.</source> <translation>Temperatura do ar</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="671"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="977"/> <source>Water temp.</source> <translation>Temperatura da água</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="672"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="965"/> <source>Cyl. size</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="673"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="967"/> <source>Start pressure</source> <translation>Pressão inicial</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="674"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="969"/> <source>End pressure</source> <translation>Pressão final</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="675"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="971"/> <source>O₂</source> <translation>O₂</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="676"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="973"/> <source>He</source> <translation>He</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="677"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="937"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="678"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="939"/> <source>GPS</source> <translation>GPS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="679"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="945"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="680"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="947"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="681"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="949"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="682"/> <source>Rating</source> <translation>Classificação</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="683"/> <source>Visibility</source> <translation>Visibilidade</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="684"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="951"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="685"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="953"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="686"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="955"/> <source>Tags</source> <translation>Rótulos</translation> </message> </context> <context> <name>DiveObjectHelper</name> <message> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="323"/> <source>%1 dive(s)</source> <translation type="unfinished"/> </message> </context> <context> <name>DivePlanner</name> <message> <location filename="../desktop-widgets/diveplanner.ui" line="109"/> <location filename="../build/ui_diveplanner.h" line="189"/> <source>Planned dive time</source> <translation>Tempo do mergulho planejado</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="152"/> <location filename="../build/ui_diveplanner.h" line="190"/> <source>Altitude</source> <translation>Altitude</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="159"/> <location filename="../build/ui_diveplanner.h" line="191"/> <source>ATM pressure</source> <translation>pressão atmosférica</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="166"/> <location filename="../build/ui_diveplanner.h" line="192"/> <source>Salinity</source> <translation>Salinidade</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="179"/> <location filename="../build/ui_diveplanner.h" line="193"/> <source>mbar</source> <translation>mbar</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="198"/> <location filename="../build/ui_diveplanner.h" line="194"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="220"/> <location filename="../build/ui_diveplanner.h" line="195"/> <source> kg/ℓ</source> <translation> kg/ℓ</translation> </message> </context> <context> <name>DivePlannerPointsModel</name> <message> <location filename="../qt-models/diveplannermodel.cpp" line="136"/> <source>unknown</source> <translation>desconhecido</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="326"/> <source>Final depth</source> <translation>Profundidade final</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="328"/> <source>Run time</source> <translation>Tempo</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="330"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="332"/> <source>Used gas</source> <translation>Gás usado</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="334"/> <source>CC setpoint</source> <translation type="unfinished"/> </message> </context> <context> <name>DivePlannerWidget</name> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="112"/> <source>Dive planner points</source> <translation>Pontos planejados</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="116"/> <source>Available gases</source> <translation>Gases disponiveis</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="143"/> <source>Add dive data point</source> <translation>Adicionar ponto</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="152"/> <source>Save new</source> <translation type="unfinished"/> </message> </context> <context> <name>DivePlotDataModel</name> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="114"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="116"/> <source>Time</source> <translation>Horário</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="118"/> <source>Pressure</source> <translation>Pressão</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="120"/> <source>Temperature</source> <translation>Temperatura</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="122"/> <source>Color</source> <translation>Cor</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="124"/> <source>User entered</source> <translation>Entrado pelo usuário</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="126"/> <source>Cylinder index</source> <translation>Indice do Cilindro</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="128"/> <source>Pressure S</source> <translation>Pressão S</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="130"/> <source>Pressure I</source> <translation>Pressão I</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="132"/> <source>Ceiling</source> <translation>Teto</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="134"/> <source>SAC</source> <translation>SAC</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="136"/> <source>pN₂</source> <translation>pN₂</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="138"/> <source>pHe</source> <translation>pHe</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="140"/> <source>pO₂</source> <translation>pO₂</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="142"/> <source>Setpoint</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="144"/> <source>Sensor 1</source> <translation>Sensor 1</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="146"/> <source>Sensor 2</source> <translation>Sensor 2</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="148"/> <source>Sensor 3</source> <translation>Sensor 3</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="150"/> <source>Ambient pressure</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="152"/> <source>Heart rate</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="154"/> <source>Gradient factor</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="156"/> <source>Mean depth @ s</source> <translation type="unfinished"/> </message> </context> <context> <name>DiveShareExportDialog</name> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="14"/> <location filename="../build/ui_diveshareexportdialog.h" line="176"/> <source>Dialog</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="61"/> <location filename="../build/ui_diveshareexportdialog.h" line="177"/> <source>User ID</source> <translation>ID do usuário</translation> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="75"/> <location filename="../build/ui_diveshareexportdialog.h" line="181"/> <source>⌫</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="82"/> <location filename="../build/ui_diveshareexportdialog.h" line="182"/> <source>Get user ID</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="91"/> <location filename="../build/ui_diveshareexportdialog.h" line="183"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:20pt; font-weight:600; color:#ff8000;&quot;&gt;⚠&lt;/span&gt; Not using a UserID means that you will need to manually keep bookmarks to your dives, to find them again.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="104"/> <location filename="../build/ui_diveshareexportdialog.h" line="185"/> <source>Private dives will not appear in &quot;related dives&quot; lists, and will only be accessible if their URL is known.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="107"/> <location filename="../build/ui_diveshareexportdialog.h" line="187"/> <source>Keep dives private</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="129"/> <location filename="../build/ui_diveshareexportdialog.h" line="188"/> <source>Upload dive data</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="174"/> <location filename="../build/ui_diveshareexportdialog.h" line="189"/> <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; p, li { white-space: pre-wrap; } &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Oxygen-Sans'; font-size:7pt; font-weight:600; font-style:normal;&quot;&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> </context> <context> <name>DiveTripModel</name> <message> <location filename="../qt-models/divetripmodel.cpp" line="434"/> <location filename="../qt-models/divetripmodel.cpp" line="483"/> <source>#</source> <translation>nº</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="437"/> <location filename="../qt-models/divetripmodel.cpp" line="486"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="440"/> <location filename="../qt-models/divetripmodel.cpp" line="489"/> <source>Rating</source> <translation>Classificação</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="443"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="446"/> <location filename="../qt-models/divetripmodel.cpp" line="495"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="449"/> <source>Temp</source> <translation>Temp</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="452"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="455"/> <location filename="../qt-models/divetripmodel.cpp" line="504"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="458"/> <location filename="../qt-models/divetripmodel.cpp" line="507"/> <source>Cyl</source> <translation>Cilindro</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="461"/> <location filename="../qt-models/divetripmodel.cpp" line="510"/> <source>Gas</source> <translation>Gás</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="464"/> <source>SAC</source> <translation>SAC</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="467"/> <location filename="../qt-models/divetripmodel.cpp" line="518"/> <source>OTU</source> <translation>OTU</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="470"/> <location filename="../qt-models/divetripmodel.cpp" line="521"/> <source>Max CNS</source> <translation>CNS Máximo</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="473"/> <source>Photos</source> <translation>Fotos</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="476"/> <location filename="../qt-models/divetripmodel.cpp" line="527"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="492"/> <source>Depth(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="492"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="492"/> <source>ft</source> <translation>pé(s)</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="498"/> <source>Temp(%1%2)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="501"/> <source>Weight(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="501"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="501"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="515"/> <source>SAC(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="515"/> <source>/min</source> <translation>/min</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="524"/> <source>Photos before/during/after dive</source> <translation type="unfinished"/> </message> </context> <context> <name>DivelogsDeWebServices</name> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="165"/> <source>no dives were selected</source> <translation>nenhum mergulho selecionado</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="175"/> <source>stylesheet to export to divelogs.de is not found</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="185"/> <source>failed to create zip file for upload: %s</source> <translation>falha ao criar arquivo zip para upload: %s</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="237"/> <source>internal error</source> <translation>erro interno</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="245"/> <source>Conversion of dive %1 to divelogs.de format failed</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="273"/> <source>error writing zip file: %s zip error %d system error %d - %s</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="745"/> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="936"/> <source>Done</source> <translation>Finalizado</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="779"/> <source>Uploading dive list...</source> <translation>Enviando lista de mergulhos...</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="811"/> <source>Downloading dive list...</source> <translation>Recebendo lista de mergulhos...</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="852"/> <source>Downloading %1 dives...</source> <translation>Recebendo %1 mergulhos...</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="886"/> <source>Download finished - %1</source> <translation>Recebimento terminado - %1</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="900"/> <source>Problem with download</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="901"/> <source>The archive could not be opened: </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="910"/> <source>Corrupted download</source> <translation>Recebimento inválido</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="911"/> <source>The archive could not be opened: %1</source> <translation>O arquivo não pode ser aberto: %1</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="937"/> <source>Upload finished</source> <translation>Enviado finalizado</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="950"/> <source>Upload failed</source> <translation>Envio falhou</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="953"/> <source>Upload successful</source> <translation>Envio bem sucedido</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="956"/> <source>Login failed</source> <translation>Abertura de sessão (login) falhou</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="959"/> <source>Cannot parse response</source> <translation>Falha na análise da resposta</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="971"/> <source>Error: %1</source> <translation>Erro: %1</translation> </message> </context> <context> <name>DownloadFromDCWidget</name> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="107"/> <source>Download</source> <translation>Receber</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="110"/> <source>Choose Bluetooth download mode</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="191"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="286"/> <source>Find Uemis dive computer</source> <translation>Encontrar computador de mergulho Uemis</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="392"/> <source>Choose file for divecomputer download logfile</source> <translation>Escolha o arquivo para recebimento do arquivo de log do computador de mergulho</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="393"/> <source>Log files (*.log)</source> <translation>Arquivos de log (*.log)</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="408"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="409"/> <source>Saving the libdivecomputer dump will NOT download dives to the dive list.</source> <translation>Ao salvar a saída da biblioteca libdivecomputer as informações dos mergulhos recebidos NÃO serão gravadas na lista de mergulhos.</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="420"/> <source>Choose file for divecomputer binary dump file</source> <translation>Escolha o arquivo onde gravar a saída binária do computador de mergulho</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="421"/> <source>Dump files (*.bin)</source> <translation>Arquivos de saída (*.bin)</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="446"/> <source>Retry</source> <translation>Tentar novamente</translation> </message> </context> <context> <name>DownloadFromDiveComputer</name> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="14"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="265"/> <source>Download from dive computer</source> <translation>Download do Computador de Mergulho</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="52"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="266"/> <source>Device or mount point</source> <translation>Disco ou ponto de montágem</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="66"/> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="101"/> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="115"/> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="132"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="267"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="272"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="274"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="73"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="268"/> <source>Force download of all dives</source> <translation>Forçar recebimento de todos os mergulhos</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="80"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="269"/> <source>Always prefer downloaded dives</source> <translation>Sempre preferir mergulhos baixados</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="87"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="270"/> <source>Download into new trip</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="94"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="271"/> <source>Save libdivecomputer logfile</source> <translation>Salvar arquivo de log da biblioteca libdivecomputer</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="108"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="273"/> <source>Save libdivecomputer dumpfile</source> <translation>Salvar arquivo de saída da biblioteca libdivecomputer</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="122"/> <source>Choose Bluetooth download mode</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="129"/> <source>Select a remote Bluetooth device.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="139"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="275"/> <source>Vendor</source> <translation>Fabricante</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="149"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="276"/> <source>Dive computer</source> <translation>Computador de mergulho</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="179"/> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="52"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="277"/> <source>Download</source> <translation>Receber</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="226"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="278"/> <source>Downloaded dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="236"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="279"/> <source>Select all</source> <translation>Selecionar tudo</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="243"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="280"/> <source>Unselect all</source> <translation>Desfazer seleções</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="284"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="281"/> <source>OK</source> <translation>OK</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="291"/> <location filename="../build/ui_downloadfromdivecomputer.h" line="282"/> <source>Cancel</source> <translation>Cancelar</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="16"/> <source>Dive Computer</source> <translation>Computador de mergulho</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="38"/> <source> Vendor name : </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="42"/> <source> Dive Computer:</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="54"/> <source>Retry</source> <translation>Tentar novamente</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="60"/> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="101"/> <source>Quit</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="68"/> <source> Downloaded dives</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="79"/> <source>Date / Time</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="84"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="89"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="95"/> <source>Accept</source> <translation>Aceitar</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="111"/> <source>Select All</source> <translation>Selecionar tudo</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="115"/> <source>Unselect All</source> <translation type="unfinished"/> </message> </context> <context> <name>ExtraDataModel</name> <message> <location filename="../qt-models/divecomputerextradatamodel.cpp" line="10"/> <source>Key</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divecomputerextradatamodel.cpp" line="10"/> <source>Value</source> <translation type="unfinished"/> </message> </context> <context> <name>FacebookConnectWidget</name> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.ui" line="14"/> <source>Preferences</source> <translation>Preferências</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.ui" line="82"/> <source>Connect to facebook text placeholder</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="242"/> <source>To disconnect Subsurface from your Facebook account, use the button below</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="251"/> <source>To connect to Facebook, please log in. This enables Subsurface to publish dives to your timeline</source> <translation type="unfinished"/> </message> </context> <context> <name>FacebookManager</name> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="211"/> <source>Photo upload sucessfull</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="212"/> <source>Your dive profile was updated to Facebook.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="216"/> <source>Photo upload failed</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="217"/> <source>Your dive profile was not updated to Facebook, please send the following to the developer. </source> <translation type="unfinished"/> </message> </context> <context> <name>FacebookPlugin</name> <message> <location filename="../desktop-widgets/plugins/facebook/facebook_integration.cpp" line="36"/> <source>Facebook</source> <translation type="unfinished"/> </message> </context> <context> <name>FilterWidget</name> <message> <location filename="../desktop-widgets/listfilter.ui" line="14"/> <location filename="../build/ui_listfilter.h" line="74"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/listfilter.ui" line="40"/> <location filename="../build/ui_listfilter.h" line="75"/> <source>Text label</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/listfilter.ui" line="50"/> <location filename="../build/ui_listfilter.h" line="76"/> <source>Filter this list</source> <translation type="unfinished"/> </message> </context> <context> <name>FilterWidget2</name> <message> <location filename="../desktop-widgets/filterwidget.ui" line="73"/> <location filename="../build/ui_filterwidget.h" line="118"/> <source>Reset filters</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/filterwidget.ui" line="87"/> <location filename="../build/ui_filterwidget.h" line="121"/> <source>Show/hide filters</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/filterwidget.ui" line="101"/> <location filename="../build/ui_filterwidget.h" line="124"/> <source>Close and reset filters</source> <translation type="unfinished"/> </message> </context> <context> <name>FirmwareUpdateThread</name> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1739"/> <source>This feature is not yet available for the selected dive computer.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1744"/> <source>Firmware update failed!</source> <translation type="unfinished"/> </message> </context> <context> <name>GlobalDrawer</name> <message> <location filename="../mobile-widgets/qml/kirigami/src/controls/GlobalDrawer.qml" line="364"/> <source>Back</source> <translation type="unfinished"/> </message> </context> <context> <name>GlobeGPS</name> <message> <location filename="../desktop-widgets/globe.cpp" line="124"/> <source>Edit selected dive locations</source> <translation>Editar a localização dos mergulhos selecionados</translation> </message> </context> <context> <name>GpsList</name> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="16"/> <source>GPS Fixes</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="32"/> <source>Date: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="42"/> <source>Name: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="52"/> <source>Latitude: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="61"/> <source>Longitude: </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="105"/> <source>List of stored GPS fixes</source> <translation type="unfinished"/> </message> </context> <context> <name>GpsLocation</name> <message> <location filename="../core/gpslocation.cpp" line="121"/> <source>Unknown GPS location</source> <translation type="unfinished"/> </message> </context> <context> <name>KMessageWidget</name> <message> <location filename="../desktop-widgets/kmessagewidget.cpp" line="90"/> <source>&amp;Close</source> <translation>Fe&amp;char</translation> </message> <message> <location filename="../desktop-widgets/kmessagewidget.cpp" line="91"/> <source>Close message</source> <translation type="unfinished"/> </message> </context> <context> <name>LocationFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="646"/> <source>Location: </source> <translation type="unfinished"/> </message> </context> <context> <name>LocationFilterDelegate</name> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="497"/> <source> (same GPS fix)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="502"/> <source> (~%1 away</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location filename="../desktop-widgets/modeldelegates.cpp" line="503"/> <source>, %n dive(s) here)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="508"/> <source>(no existing GPS data, add GPS fix from this dive)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="510"/> <source>(no GPS data)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="512"/> <source>Pick site: </source> <translation type="unfinished"/> </message> </context> <context> <name>LocationFilterModel</name> <message> <location filename="../qt-models/filtermodels.cpp" line="304"/> <source>No location set</source> <translation type="unfinished"/> </message> </context> <context> <name>LocationInformation</name> <message> <location filename="../desktop-widgets/locationInformation.ui" line="14"/> <location filename="../build/ui_locationInformation.h" line="111"/> <source>GroupBox</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="29"/> <location filename="../build/ui_locationInformation.h" line="113"/> <source>Name</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="36"/> <location filename="../build/ui_locationInformation.h" line="115"/> <source>Description</source> <translation>Descrição</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="43"/> <location filename="../build/ui_locationInformation.h" line="116"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="53"/> <location filename="../build/ui_locationInformation.h" line="114"/> <source>Coordinates</source> <translation>Coordenadas</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="69"/> <source>Reverse geo lookup</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="72"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="93"/> <source>Dive sites on same coordinates</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="131"/> <source>Tags</source> <translation>Rótulos</translation> </message> <message> <location filename="../build/ui_locationInformation.h" line="112"/> <source>Dive Site</source> <translation type="unfinished"/> </message> </context> <context> <name>LocationInformationModel</name> <message> <location filename="../qt-models/divelocationmodel.cpp" line="68"/> <source>Create dive site with this name</source> <translation type="unfinished"/> </message> </context> <context> <name>LocationInformationWidget</name> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="25"/> <source>Apply changes</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="28"/> <source>Discard changes</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="31"/> <location filename="../desktop-widgets/locationinformation.cpp" line="217"/> <source>Dive site management</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="63"/> <source>Merge into current site</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="72"/> <source>Merging dive sites</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="73"/> <source>You are about to merge dive sites, you can't undo that action Are you sure you want to continue?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="224"/> <source>You are editing a dive site</source> <translation type="unfinished"/> </message> </context> <context> <name>Log</name> <message> <location filename="../mobile-widgets/qml/Log.qml" line="15"/> <location filename="../mobile-widgets/qml/Log.qml" line="23"/> <source>Application Log</source> <translation type="unfinished"/> </message> </context> <context> <name>MainTab</name> <message> <location filename="../desktop-widgets/maintab.ui" line="18"/> <location filename="../desktop-widgets/maintab.ui" line="439"/> <location filename="../build/ui_maintab.h" line="961"/> <location filename="../build/ui_maintab.h" line="963"/> <location filename="../desktop-widgets/maintab.cpp" line="539"/> <location filename="../desktop-widgets/maintab.cpp" line="571"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="21"/> <location filename="../build/ui_maintab.h" line="964"/> <source>General notes about the current selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="92"/> <location filename="../desktop-widgets/maintab.ui" line="646"/> <location filename="../build/ui_maintab.h" line="947"/> <location filename="../build/ui_maintab.h" line="967"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="102"/> <location filename="../build/ui_maintab.h" line="948"/> <source>Time</source> <translation>Horário</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="112"/> <location filename="../desktop-widgets/maintab.ui" line="836"/> <location filename="../build/ui_maintab.h" line="949"/> <location filename="../build/ui_maintab.h" line="987"/> <location filename="../desktop-widgets/maintab.cpp" line="306"/> <source>Air temp.</source> <translation>Temperatura do ar</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="122"/> <location filename="../desktop-widgets/maintab.ui" line="855"/> <location filename="../build/ui_maintab.h" line="950"/> <location filename="../build/ui_maintab.h" line="989"/> <location filename="../desktop-widgets/maintab.cpp" line="307"/> <source>Water temp.</source> <translation>Temperatura da água</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="184"/> <location filename="../build/ui_maintab.h" line="951"/> <location filename="../desktop-widgets/maintab.cpp" line="570"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="214"/> <source>Edit dive site</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="217"/> <location filename="../build/ui_maintab.h" line="953"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="252"/> <location filename="../build/ui_maintab.h" line="954"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="262"/> <location filename="../build/ui_maintab.h" line="955"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="308"/> <location filename="../build/ui_maintab.h" line="956"/> <source>Rating</source> <translation>Classificação</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="321"/> <location filename="../build/ui_maintab.h" line="957"/> <source>Visibility</source> <translation>Visibilidade</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="328"/> <location filename="../build/ui_maintab.h" line="958"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="387"/> <location filename="../build/ui_maintab.h" line="959"/> <source>Tags</source> <translation>Rótulos</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="397"/> <location filename="../build/ui_maintab.h" line="960"/> <source>Dive mode</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="491"/> <location filename="../build/ui_maintab.h" line="965"/> <source>Equipment</source> <translation>Equipamento</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="494"/> <location filename="../build/ui_maintab.h" line="966"/> <source>Used equipment in the current selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="586"/> <location filename="../build/ui_maintab.h" line="994"/> <source>Info</source> <translation>Info</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="589"/> <location filename="../build/ui_maintab.h" line="995"/> <source>Dive information</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="665"/> <location filename="../build/ui_maintab.h" line="969"/> <source>Interval</source> <translation>Intervalo</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="684"/> <location filename="../build/ui_maintab.h" line="971"/> <source>Gases used</source> <translation>Gases utilizados</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="703"/> <location filename="../build/ui_maintab.h" line="973"/> <source>Gas consumed</source> <translation>Gas consumido</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="722"/> <location filename="../desktop-widgets/maintab.ui" line="1094"/> <location filename="../build/ui_maintab.h" line="975"/> <location filename="../build/ui_maintab.h" line="1003"/> <source>SAC</source> <translation>SAC</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="741"/> <location filename="../build/ui_maintab.h" line="977"/> <source>CNS</source> <translation>CNS</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="760"/> <location filename="../build/ui_maintab.h" line="979"/> <source>OTU</source> <translation>OTU</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="779"/> <location filename="../build/ui_maintab.h" line="981"/> <source>Max. depth</source> <translation>Profundidade máxima</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="798"/> <location filename="../build/ui_maintab.h" line="983"/> <source>Avg. depth</source> <translation>Profundidade Média</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="817"/> <location filename="../build/ui_maintab.h" line="985"/> <source>Air pressure</source> <translation>Pressão do ar</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="874"/> <location filename="../build/ui_maintab.h" line="991"/> <source>Dive time</source> <translation>Tempo de mergulho</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="893"/> <location filename="../build/ui_maintab.h" line="993"/> <source>Salinity</source> <translation>Salinidade</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="930"/> <location filename="../build/ui_maintab.h" line="1006"/> <source>Stats</source> <translation>Estatísticas</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="933"/> <location filename="../build/ui_maintab.h" line="1007"/> <source>Simple statistics about the selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="986"/> <location filename="../build/ui_maintab.h" line="996"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="998"/> <location filename="../build/ui_maintab.h" line="997"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1027"/> <location filename="../build/ui_maintab.h" line="998"/> <source>Temperature</source> <translation>Temperatura</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1039"/> <location filename="../build/ui_maintab.h" line="999"/> <source>Total time</source> <translation>Tempo total</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1058"/> <location filename="../build/ui_maintab.h" line="1001"/> <source>Dives</source> <translation>Mergulhos</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1106"/> <location filename="../build/ui_maintab.h" line="1004"/> <source>Gas consumption</source> <translation>Consumo de gás</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1148"/> <location filename="../build/ui_maintab.h" line="1008"/> <source>Photos</source> <translation>Fotos</translation> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1151"/> <location filename="../build/ui_maintab.h" line="1009"/> <source>All photos from the current selection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1177"/> <location filename="../build/ui_maintab.h" line="1010"/> <source>Extra data</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.ui" line="1180"/> <location filename="../build/ui_maintab.h" line="1011"/> <source>Adittional data from the dive computer</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="63"/> <source>Apply changes</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="67"/> <source>Discard changes</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="88"/> <source>Cylinders</source> <translation>Cilindros</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="89"/> <source>Add cylinder</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="92"/> <source>Weights</source> <translation>Lastro</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="93"/> <source>Add weight system</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="97"/> <source>OC</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="97"/> <source>CCR</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="97"/> <source>pSCR</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="97"/> <source>Freedive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="303"/> <source>Air temp. [%1]</source> <translation>Temperatura do Ar [%1]</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="304"/> <source>Water temp. [%1]</source> <translation>Temperatura da água [%1]</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="343"/> <source>This trip is being edited.</source> <translation>Esta viagem está sendo editada.</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="350"/> <source>Multiple dives are being edited.</source> <translation>Vários mergulhos estão sendo editados.</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="352"/> <source>This dive is being edited.</source> <translation>Este mergulho está sendo editado.</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="501"/> <location filename="../desktop-widgets/maintab.cpp" line="534"/> <source>Trip notes</source> <translation>Notas da viagem</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="529"/> <source>Trip location</source> <translation>Local do mergulho</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="608"/> <location filename="../desktop-widgets/maintab.cpp" line="644"/> <location filename="../desktop-widgets/maintab.cpp" line="648"/> <location filename="../desktop-widgets/maintab.cpp" line="652"/> <source>/min</source> <translation>/min</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="641"/> <source>Deepest dive</source> <translation>Mergulho mais profundo</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="642"/> <source>Shallowest dive</source> <translation>Mergulho mais raso</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="655"/> <source>Highest total SAC of a dive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="656"/> <source>Lowest total SAC of a dive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="657"/> <source>Average total SAC of all selected dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="668"/> <source>Highest temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="669"/> <source>Lowest temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="670"/> <source>Average temperature of all selected dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="683"/> <source>Longest dive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="684"/> <source>Shortest dive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="685"/> <source>Average length of all selected dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="709"/> <source>These gases could be mixed from Air and using: </source> <translation>Esses gases podem ser misturados com ar usando: </translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="713"/> <source> and </source> <translation>e</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="843"/> <source>New dive site</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1139"/> <source>Discard the changes?</source> <translation>Descartar alterações?</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1140"/> <source>You are about to discard your changes.</source> <translation>Você está prestes a eliminar suas alterações.</translation> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1594"/> <source>Deleting Images</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1594"/> <source>Are you sure you want to delete all images?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1653"/> <source>Load image(s) from file(s)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1654"/> <source>Load image(s) from web</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1656"/> <source>Delete selected images</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/maintab.cpp" line="1657"/> <source>Delete all images</source> <translation type="unfinished"/> </message> </context> <context> <name>MainWindow</name> <message> <location filename="../desktop-widgets/mainwindow.ui" line="61"/> <location filename="../build/ui_mainwindow.h" line="568"/> <source>&amp;File</source> <translation>A&amp;rquivo</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="87"/> <location filename="../build/ui_mainwindow.h" line="569"/> <source>&amp;Log</source> <translation>&amp;Log</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="104"/> <location filename="../build/ui_mainwindow.h" line="570"/> <source>&amp;View</source> <translation>&amp;Ver</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="120"/> <location filename="../build/ui_mainwindow.h" line="571"/> <source>&amp;Help</source> <translation>&amp;Ajuda</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="129"/> <location filename="../build/ui_mainwindow.h" line="572"/> <source>&amp;Import</source> <translation>&amp;Importar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="138"/> <location filename="../build/ui_mainwindow.h" line="573"/> <source>&amp;Edit</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="143"/> <source>Share on</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="157"/> <location filename="../build/ui_mainwindow.h" line="453"/> <source>&amp;New logbook</source> <translation>&amp;Novo logbook</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="160"/> <location filename="../build/ui_mainwindow.h" line="455"/> <source>New</source> <translation>Novo</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="163"/> <location filename="../build/ui_mainwindow.h" line="457"/> <source>Ctrl+N</source> <translation>Ctrl+N</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="168"/> <location filename="../build/ui_mainwindow.h" line="458"/> <source>&amp;Open logbook</source> <translation>&amp;Abrir logbook</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="171"/> <location filename="../build/ui_mainwindow.h" line="460"/> <location filename="../desktop-widgets/mainwindow.cpp" line="502"/> <source>Open</source> <translation>Abrir</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="174"/> <location filename="../build/ui_mainwindow.h" line="462"/> <source>Ctrl+O</source> <translation>Ctrl+O</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="179"/> <location filename="../build/ui_mainwindow.h" line="463"/> <source>&amp;Save</source> <translation>&amp;Gravar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="182"/> <location filename="../build/ui_mainwindow.h" line="465"/> <source>Save</source> <translation>Salvar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="185"/> <location filename="../build/ui_mainwindow.h" line="467"/> <source>Ctrl+S</source> <translation>Ctrl+S</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="190"/> <location filename="../build/ui_mainwindow.h" line="468"/> <source>Sa&amp;ve as</source> <translation>Sal&amp;var como</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="193"/> <location filename="../build/ui_mainwindow.h" line="470"/> <source>Save as</source> <translation>Salvar como</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="196"/> <location filename="../build/ui_mainwindow.h" line="472"/> <source>Ctrl+Shift+S</source> <translation>Ctrl+Shift+S</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="201"/> <location filename="../build/ui_mainwindow.h" line="473"/> <source>&amp;Close</source> <translation>Fe&amp;char</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="204"/> <location filename="../build/ui_mainwindow.h" line="475"/> <source>Close</source> <translation>Fechar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="207"/> <location filename="../build/ui_mainwindow.h" line="477"/> <source>Ctrl+W</source> <translation>Ctrl+W</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="212"/> <location filename="../build/ui_mainwindow.h" line="478"/> <source>&amp;Print</source> <translation>&amp;Imprimir</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="215"/> <location filename="../build/ui_mainwindow.h" line="479"/> <source>Ctrl+P</source> <translation>Ctrl+P</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="220"/> <location filename="../build/ui_mainwindow.h" line="480"/> <source>P&amp;references</source> <translation>P&amp;referencias</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="223"/> <location filename="../build/ui_mainwindow.h" line="481"/> <source>Ctrl+,</source> <translation>Ctrl+,</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="231"/> <location filename="../build/ui_mainwindow.h" line="482"/> <source>&amp;Quit</source> <translation>&amp;Fechar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="234"/> <location filename="../build/ui_mainwindow.h" line="483"/> <source>Ctrl+Q</source> <translation>Ctrl+Q</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="242"/> <location filename="../build/ui_mainwindow.h" line="484"/> <source>Import from &amp;dive computer</source> <translation>Importar do &amp;computador de mergulho</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="245"/> <location filename="../build/ui_mainwindow.h" line="485"/> <source>Ctrl+D</source> <translation>Ctrl+D</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="250"/> <location filename="../build/ui_mainwindow.h" line="486"/> <source>Import &amp;GPS data from Subsurface web service</source> <translation>Importar dados de &amp;GPS pelo web service do Subsurface</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="253"/> <location filename="../build/ui_mainwindow.h" line="487"/> <source>Ctrl+G</source> <translation>Ctrl+G</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="258"/> <location filename="../build/ui_mainwindow.h" line="488"/> <source>Edit device &amp;names</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="263"/> <location filename="../build/ui_mainwindow.h" line="489"/> <source>&amp;Add dive</source> <translation>&amp;Adicionar mergulho</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="266"/> <location filename="../build/ui_mainwindow.h" line="490"/> <source>Ctrl++</source> <translation>Ctrl++</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="271"/> <location filename="../build/ui_mainwindow.h" line="491"/> <source>&amp;Edit dive</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="276"/> <location filename="../build/ui_mainwindow.h" line="492"/> <source>&amp;Copy dive components</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="279"/> <location filename="../build/ui_mainwindow.h" line="493"/> <source>Ctrl+C</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="284"/> <location filename="../build/ui_mainwindow.h" line="494"/> <source>&amp;Paste dive components</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="287"/> <location filename="../build/ui_mainwindow.h" line="495"/> <source>Ctrl+V</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="292"/> <location filename="../build/ui_mainwindow.h" line="496"/> <source>&amp;Renumber</source> <translation>&amp;Renumerar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="295"/> <location filename="../build/ui_mainwindow.h" line="497"/> <source>Ctrl+R</source> <translation>Ctrl+R</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="303"/> <location filename="../build/ui_mainwindow.h" line="498"/> <source>Auto &amp;group</source> <translation>Auto a&amp;grupar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="308"/> <location filename="../build/ui_mainwindow.h" line="499"/> <source>&amp;Yearly statistics</source> <translation>Estatisticas Anuais</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="311"/> <location filename="../build/ui_mainwindow.h" line="500"/> <source>Ctrl+Y</source> <translation>Ctrl+Y</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="316"/> <location filename="../build/ui_mainwindow.h" line="501"/> <source>&amp;Dive list</source> <translation>Lista de Mergulho</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="319"/> <location filename="../build/ui_mainwindow.h" line="502"/> <source>Ctrl+2</source> <translation>Ctrl+2</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="324"/> <location filename="../build/ui_mainwindow.h" line="503"/> <source>&amp;Profile</source> <translation>&amp;Perfil</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="327"/> <location filename="../build/ui_mainwindow.h" line="504"/> <source>Ctrl+3</source> <translation>Ctrl+3</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="332"/> <location filename="../build/ui_mainwindow.h" line="505"/> <source>&amp;Info</source> <translation>&amp;Informações</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="335"/> <location filename="../build/ui_mainwindow.h" line="506"/> <source>Ctrl+4</source> <translation>Ctrl+4</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="340"/> <location filename="../build/ui_mainwindow.h" line="507"/> <source>&amp;All</source> <translation>&amp;Todos</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="343"/> <location filename="../build/ui_mainwindow.h" line="508"/> <source>Ctrl+1</source> <translation>Ctrl+1</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="348"/> <location filename="../build/ui_mainwindow.h" line="509"/> <source>P&amp;revious DC</source> <translation>Computador de mergulho anterior</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="351"/> <location filename="../build/ui_mainwindow.h" line="510"/> <source>Left</source> <translation>Esquerda</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="356"/> <location filename="../build/ui_mainwindow.h" line="511"/> <source>&amp;Next DC</source> <translation>Próximo Computador</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="359"/> <location filename="../build/ui_mainwindow.h" line="512"/> <source>Right</source> <translation>Direita</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="364"/> <location filename="../build/ui_mainwindow.h" line="513"/> <source>&amp;About Subsurface</source> <translation>&amp;Sobre o Subsurface</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="372"/> <location filename="../build/ui_mainwindow.h" line="514"/> <source>User &amp;manual</source> <translation>Manual</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="375"/> <location filename="../build/ui_mainwindow.h" line="515"/> <source>F1</source> <translation>F1</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="380"/> <location filename="../build/ui_mainwindow.h" line="516"/> <source>&amp;Globe</source> <translation>&amp;Globo</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="383"/> <location filename="../build/ui_mainwindow.h" line="517"/> <source>Ctrl+5</source> <translation>Ctrl+5</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="388"/> <location filename="../build/ui_mainwindow.h" line="518"/> <source>P&amp;lan dive</source> <translation>Planejador</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="391"/> <location filename="../build/ui_mainwindow.h" line="519"/> <source>Ctrl+L</source> <translation>Ctrl+L</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="396"/> <location filename="../build/ui_mainwindow.h" line="520"/> <source>&amp;Import log files</source> <translation>Importar arquivos de mergulho</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="399"/> <location filename="../build/ui_mainwindow.h" line="522"/> <source>Import divelog files from other applications</source> <translation>Importar arquivos de mergulho de outros programas</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="402"/> <location filename="../build/ui_mainwindow.h" line="524"/> <source>Ctrl+I</source> <translation>Ctrl+I</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="407"/> <location filename="../build/ui_mainwindow.h" line="525"/> <source>Import &amp;from divelogs.de</source> <translation>Importar de &amp;divelogs.de</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="415"/> <location filename="../build/ui_mainwindow.h" line="526"/> <source>&amp;Full screen</source> <translation>&amp;F Tela Cheia</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="418"/> <location filename="../build/ui_mainwindow.h" line="528"/> <source>Toggle full screen</source> <translation>Alternar em Tela Cheia</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="421"/> <location filename="../build/ui_mainwindow.h" line="530"/> <source>F11</source> <translation>F11</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="446"/> <location filename="../build/ui_mainwindow.h" line="531"/> <source>&amp;Check for updates</source> <translation>&amp;Buscar atualizações</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="451"/> <location filename="../build/ui_mainwindow.h" line="532"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="454"/> <location filename="../build/ui_mainwindow.h" line="534"/> <source>Export dive logs</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="457"/> <location filename="../build/ui_mainwindow.h" line="536"/> <source>Ctrl+E</source> <translation>Ctrl+E</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="462"/> <location filename="../build/ui_mainwindow.h" line="537"/> <source>Configure &amp;dive computer</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="465"/> <location filename="../build/ui_mainwindow.h" line="538"/> <source>Ctrl+Shift+C</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="473"/> <location filename="../build/ui_mainwindow.h" line="539"/> <source>Edit &amp;dive in planner</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="485"/> <location filename="../build/ui_mainwindow.h" line="540"/> <source>Toggle pO₂ graph</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="497"/> <location filename="../build/ui_mainwindow.h" line="541"/> <source>Toggle pN₂ graph</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="509"/> <location filename="../build/ui_mainwindow.h" line="542"/> <source>Toggle pHe graph</source> <translation>Alterna gráfico pHe</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="521"/> <location filename="../build/ui_mainwindow.h" line="543"/> <source>Toggle DC reported ceiling</source> <translation>Alterna teto calculado pelo computador</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="533"/> <location filename="../build/ui_mainwindow.h" line="544"/> <source>Toggle calculated ceiling</source> <translation>Alterna teto calculado</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="545"/> <location filename="../build/ui_mainwindow.h" line="545"/> <source>Toggle calculating all tissues</source> <translation>Alterna calcular todos os tecidos</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="557"/> <location filename="../build/ui_mainwindow.h" line="546"/> <source>Toggle calculated ceiling with 3m increments</source> <translation>Alterna teto calculado com incrementos de 3m</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="569"/> <location filename="../build/ui_mainwindow.h" line="547"/> <source>Toggle heart rate</source> <translation>Alterna batimentos cardiacos</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="581"/> <location filename="../build/ui_mainwindow.h" line="548"/> <source>Toggle MOD</source> <translation>alterna MOD</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="593"/> <location filename="../build/ui_mainwindow.h" line="549"/> <source>Toggle EAD, END, EADD</source> <translation>Alterna EAD, END, EADD</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="605"/> <location filename="../build/ui_mainwindow.h" line="550"/> <source>Toggle NDL, TTS</source> <translation>Alterna NDL, TTS</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="617"/> <location filename="../build/ui_mainwindow.h" line="551"/> <source>Toggle SAC rate</source> <translation>alterna taxa SAC</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="629"/> <location filename="../build/ui_mainwindow.h" line="552"/> <source>Toggle ruler</source> <translation>Anternar visualização da régua</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="641"/> <location filename="../build/ui_mainwindow.h" line="553"/> <source>Scale graph</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="653"/> <location filename="../build/ui_mainwindow.h" line="554"/> <source>Toggle pictures</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="665"/> <location filename="../build/ui_mainwindow.h" line="555"/> <source>Toggle tank bar</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="673"/> <location filename="../build/ui_mainwindow.h" line="556"/> <source>&amp;Filter divelist</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="676"/> <location filename="../build/ui_mainwindow.h" line="557"/> <source>Ctrl+F</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="688"/> <source>Toggle tissue heat-map</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="693"/> <location filename="../build/ui_mainwindow.h" line="559"/> <source>User &amp;survey</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="698"/> <location filename="../build/ui_mainwindow.h" line="560"/> <location filename="../desktop-widgets/mainwindow.cpp" line="231"/> <source>&amp;Undo</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="701"/> <location filename="../build/ui_mainwindow.h" line="561"/> <source>Ctrl+Z</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="706"/> <location filename="../build/ui_mainwindow.h" line="562"/> <location filename="../desktop-widgets/mainwindow.cpp" line="232"/> <source>&amp;Redo</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="709"/> <location filename="../build/ui_mainwindow.h" line="563"/> <source>Ctrl+Shift+Z</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="714"/> <location filename="../build/ui_mainwindow.h" line="564"/> <source>&amp;Find moved images</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="719"/> <source>Open c&amp;loud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="724"/> <source>Save to clo&amp;ud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="729"/> <location filename="../build/ui_mainwindow.h" line="567"/> <source>&amp;Manage dive sites</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="734"/> <source>Dive Site &amp;Edit</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="739"/> <source>Facebook</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="744"/> <source>Take cloud storage online</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_mainwindow.h" line="558"/> <source>Toggle tissue graph</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_mainwindow.h" line="565"/> <source>Open cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_mainwindow.h" line="566"/> <source>Save to cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="331"/> <source>Connect to</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="493"/> <location filename="../desktop-widgets/mainwindow.cpp" line="538"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1545"/> <source>Please save or cancel the current dive edit before opening a new file.</source> <translation>Por favor, salve ou cancele a edição atual do mergulho antes de abrir um novo arquivo.</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="499"/> <source>Open file</source> <translation>Abrir arquivo</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="503"/> <location filename="../desktop-widgets/mainwindow.cpp" line="614"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1978"/> <source>Cancel</source> <translation>Cancelar</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="610"/> <source>Traverse image directories</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="613"/> <source>Scan</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="621"/> <source>Scanning images...(this can take a while)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="649"/> <location filename="../desktop-widgets/mainwindow.cpp" line="796"/> <location filename="../desktop-widgets/mainwindow.cpp" line="904"/> <location filename="../desktop-widgets/mainwindow.cpp" line="977"/> <location filename="../desktop-widgets/mainwindow.cpp" line="983"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1849"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="674"/> <source>Please save or cancel the current dive edit before closing the file.</source> <translation>Por favor, salve ou cancele a edição atual do mergulho antes de fechar o arquivo.</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="796"/> <source>Please save or cancel the current dive edit before trying to add a dive.</source> <translation>Por favor, salve ou cancele a edição atual do mergulho atual antes de tentar adicionar um mergulho.</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="848"/> <source>Print runtime table</source> <translation>Imprimir tabela</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="904"/> <source>Trying to replan a dive that&apos;s not a planned dive.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="977"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1849"/> <source>Please, first finish the current edition before trying to do another.</source> <translation>Primeiro termine a edição atual antes de editar outro.</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="983"/> <source>Trying to edit a dive that&apos;s not a manually added dive.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1030"/> <source>Yearly statistics</source> <translation>Estatisticas Anuais</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1244"/> <source>Do you want to save the changes that you made in the file %1?</source> <translation>Você quer salvar as alterações que fez no arquivo %1?</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1247"/> <source>Do you want to save the changes that you made in the data file?</source> <translation>Você quer salvar as alterações feitas no arquivo?</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1252"/> <source>Save changes?</source> <translation>Salvar Alteraḉões?</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1253"/> <source>Changes will be lost if you don&apos;t save them.</source> <translation>As alterações serão perdidas se não forem gravadas.</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1572"/> <source>Save file as</source> <translation>Salvar arquivo como</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1573"/> <source>Subsurface XML files (*.ssrf *.xml *.XML)</source> <translation>Arquivos XML do Subsurface (*.ssrf *.xml *.XML)</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1670"/> <source>[local cache for] %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1672"/> <source>[cloud storage for] %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1788"/> <source>Opening datafile from older version</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1789"/> <source>You opened a data file from an older version of Subsurface. We recommend you read the manual to learn about the changes in the new version, especially about dive site management which has changed significantly. Subsurface has already tried to pre-populate the data but it might be worth while taking a look at the new dive site management system and to make sure that everything looks correct.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1800"/> <source>Open dive log file</source> <translation>Abrir arquivo</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1801"/> <source>Dive log files (*.ssrf *.can *.csv *.db *.sql *.dld *.jlb *.lvd *.sde *.udcf *.uddf *.xml *.txt *.dlf *.apd *.zxu *.zxl*.SSRF *.CAN *.CSV *.DB *.SQL *.DLD *.JLB *.LVD *.SDE *.UDCF *.UDDF *.xml *.TXT *.DLF *.APD *.ZXU *.ZXL);;Cochran files (*.can *.CAN);;CSV files (*.csv *.CSV);;DiveLog.de files (*.dld *.DLD);;JDiveLog files (*.jlb *.JLB);;Liquivision files (*.lvd *.LVD);;MkVI files (*.txt *.TXT);;Suunto files (*.sde *.db *.SDE *.DB);;Divesoft files (*.dlf *.DLF);;UDDF/UDCF files (*.uddf *.udcf *.UDDF *.UDCF);;XML files (*.xml *.XML);;APD log viewer (*.apd *.APD);;Datatrak/WLog Files (*.log *.LOG);;OSTCtools Files (*.dive *.DIVE);;DAN DL7 (*.zxu *.zxl *.ZXU *.ZXL);;All files (*)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1978"/> <source>Contacting cloud service...</source> <translation type="unfinished"/> </message> </context> <context> <name>MultiFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="731"/> <source>Filter shows %1 (of %2) dives</source> <translation type="unfinished"/> </message> </context> <context> <name>OstcFirmwareCheck</name> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="271"/> <source>You should update the firmware on your dive computer: you have version %1 but the latest stable version is %2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="275"/> <source> Please start Bluetooth on your OSTC Sport and do the same preparations as for a logbook download before continuing with the update</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="276"/> <source>Not now</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="277"/> <source>Update firmware</source> <translation>Atualizar firmware</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="279"/> <source>Firmware upgrade notice</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="297"/> <source>Save the downloaded firmware as</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="298"/> <source>HEX files (*.hex)</source> <translation type="unfinished"/> </message> </context> <context> <name>PlannerSettingsWidget</name> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="302"/> <source>Open circuit</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="302"/> <source>CCR</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="302"/> <source>pSCR</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="388"/> <source>ft/min</source> <translation>pés/min</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="389"/> <source>Last stop at 20ft</source> <translation>Ultima parada em 20 pés</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="390"/> <source>50% avg. depth to 20ft</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="391"/> <source>20ft to surface</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="392"/> <source>ft</source> <translation>pé(s)</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="394"/> <source>m/min</source> <translation>m/min</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="395"/> <source>Last stop at 6m</source> <translation>Ultima parada em 6m</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="396"/> <source>50% avg. depth to 6m</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="397"/> <source>6m to surface</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="398"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="401"/> <location filename="../desktop-widgets/diveplanner.cpp" line="402"/> <source>cuft/min</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="410"/> <location filename="../desktop-widgets/diveplanner.cpp" line="411"/> <source>ℓ/min</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="420"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="425"/> <source>psi</source> <translation>psi</translation> </message> </context> <context> <name>Preferences</name> <message> <location filename="../mobile-widgets/qml/Preferences.qml" line="11"/> <location filename="../mobile-widgets/qml/Preferences.qml" line="37"/> <source>Preferences</source> <translation>Preferências</translation> </message> <message> <location filename="../mobile-widgets/qml/Preferences.qml" line="14"/> <source>Save</source> <translation>Salvar</translation> </message> <message> <location filename="../mobile-widgets/qml/Preferences.qml" line="43"/> <source>Subsurface GPS data webservice</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/Preferences.qml" line="51"/> <source>Distance threshold (meters)</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/Preferences.qml" line="62"/> <source>Time threshold (minutes)</source> <translation type="unfinished"/> </message> </context> <context> <name>PreferencesDefaults</name> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="20"/> <source>Lists and tables</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="29"/> <source>Font</source> <translation>Fonte</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="39"/> <source>Font size</source> <translation>Tamanho da fonte</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="52"/> <source>Dives</source> <translation>Mergulhos</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="67"/> <source>Default dive log file</source> <translation>Arquivo de log padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="76"/> <source>No default file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="83"/> <source>&amp;Local default file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="90"/> <source>Clo&amp;ud storage default file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="99"/> <source>Local dive log file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="111"/> <source>Use default</source> <translation>Usar padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="121"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="130"/> <source>Display invalid</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="147"/> <source>Default cylinder</source> <translation>Cilindro padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="162"/> <source>Use default cylinder</source> <translation>Usar o cilindro padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="179"/> <source>Animations</source> <translation>Animações</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="188"/> <source>Speed</source> <translation>Velocidade</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="215"/> <source>Clear all settings</source> <translation>Apagar todas as preferências</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="227"/> <source>Reset all settings to their default value</source> <translation>Voltar aos padrões</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.cpp" line="9"/> <source>Defaults</source> <translation>Padrões</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.cpp" line="22"/> <source>Open default log file</source> <translation>Abrir arquivo de log padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.cpp" line="22"/> <source>Subsurface XML files (*.ssrf *.xml *.XML)</source> <translation>Arquivos XML do Subsurface (*.ssrf *.xml *.XML)</translation> </message> </context> <context> <name>PreferencesDialog</name> <message> <location filename="../build/ui_preferences.h" line="1283"/> <source>Preferences</source> <translation>Preferências</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1288"/> <source>Defaults</source> <translation>Padrões</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1290"/> <source>Units</source> <translation>Unidades</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1292"/> <source>Graph</source> <translation>Gráfico</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1294"/> <source>Language</source> <translation>Língua</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1296"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1298"/> <source>Facebook</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1300"/> <source>Georeference</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1303"/> <source>Lists and tables</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1304"/> <source>Font</source> <translation>Fonte</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1305"/> <source>Font size</source> <translation>Tamanho da fonte</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1306"/> <source>Dives</source> <translation>Mergulhos</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1307"/> <source>Default dive log file</source> <translation>Arquivo de log padrão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1308"/> <source>No default file</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1309"/> <source>&amp;Local default file</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1310"/> <source>Clo&amp;ud storage default file</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1311"/> <source>Local dive log file</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1312"/> <source>Use default</source> <translation>Usar padrão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1313"/> <source>...</source> <translation>...</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1314"/> <source>Display invalid</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1316"/> <source>Default cylinder</source> <translation>Cilindro padrão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1317"/> <source>Use default cylinder</source> <translation>Usar o cilindro padrão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1318"/> <source>Animations</source> <translation>Animações</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1319"/> <source>Speed</source> <translation>Velocidade</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1320"/> <source>Clear all settings</source> <translation>Apagar todas as preferências</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1321"/> <source>Reset all settings to their default value</source> <translation>Voltar aos padrões</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1322"/> <source>Unit system</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1323"/> <source>System</source> <translation>Sistema</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1324"/> <source>&amp;Metric</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1325"/> <source>Imperial</source> <translation>Imperial</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1326"/> <source>Personali&amp;ze</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1327"/> <source>Individual settings</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1328"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1329"/> <source>meter</source> <translation>metro</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1330"/> <source>feet</source> <translation>pé</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1331"/> <source>Pressure</source> <translation>Pressão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1332"/> <location filename="../build/ui_preferences.h" line="1366"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1333"/> <source>psi</source> <translation>psi</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1334"/> <source>Volume</source> <translation>Volume</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1335"/> <source>&amp;liter</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1336"/> <source>cu ft</source> <translation>pé cúbico</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1337"/> <source>Temperature</source> <translation>Temperatura</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1338"/> <source>celsius</source> <translation>celsius</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1339"/> <source>fahrenheit</source> <translation>fahrenheit</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1340"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1341"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1342"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1343"/> <source>Time units</source> <translation>Unidades de tempo</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1344"/> <source>Ascent/descent speed denominator</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1345"/> <source>Minutes</source> <translation>Minutos</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1346"/> <source>Seconds</source> <translation>Segundos</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1347"/> <source>GPS coordinates</source> <translation>Coordenadas do GPS</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1348"/> <source>Location Display</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1349"/> <source>traditional (dms)</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1350"/> <source>decimal</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1351"/> <source>Show</source> <translation>Mostrar</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1352"/> <source>Threshold when showing pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1353"/> <source>Threshold when showing pN₂</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1354"/> <source>Threshold when showing pHe</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1355"/> <source>Max pO₂ when showing MOD</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1356"/> <source>Draw dive computer reported ceiling red</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1357"/> <source>Show unused cylinders in Equipment tab</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1358"/> <source>Show average depth</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1359"/> <source>Misc</source> <translation>Diversos</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1360"/> <source>GFLow</source> <translation>GFlow</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1361"/> <source>GFHigh</source> <translation>GFHigh</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1362"/> <source>GFLow at max depth</source> <translation>GFlow à profundidade máxima</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1363"/> <source>CCR: show setpoints when viewing pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1364"/> <source>CCR: show individual O₂ sensor values when viewing pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1365"/> <source>Default CCR set-point for dive planning</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1367"/> <source>pSCR O₂ metabolism rate</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1368"/> <source>pSCR ratio</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1369"/> <source>ℓ/min</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1371"/> <source>1:</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1372"/> <source>UI language</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1373"/> <source>System default</source> <translation>Padrão do sistema</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1374"/> <source>Filter</source> <translation>Filtro</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1375"/> <source>Proxy</source> <translation>Proxy</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1376"/> <source>Port</source> <translation>Porta</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1377"/> <source>Host</source> <translation>Host</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1378"/> <source>Requires authentication</source> <translation>Requer Autenticação</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1379"/> <source>Proxy type</source> <translation>Tipo de Proxy</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1380"/> <source>Username</source> <translation>Nome de usuario</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1381"/> <location filename="../build/ui_preferences.h" line="1387"/> <source>Password</source> <translation>Senha</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1382"/> <source>Subsurface cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1386"/> <source>Email address</source> <translation>Endereço de email</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1388"/> <source>Verification PIN</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1395"/> <source>Sync to cloud in the background?</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1396"/> <source>Save Password locally?</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1397"/> <source>Subsurface web service</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1398"/> <source>Default user ID</source> <translation>ID de usuário padrão</translation> </message> <message> <location filename="../build/ui_preferences.h" line="1399"/> <source>Save user ID locally?</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1400"/> <source>Disconnect from Facebook</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1401"/> <source>Dive site geo lookup</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1402"/> <source>Enable geocoding for dive site management</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1403"/> <source>Parse site without GPS data</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1404"/> <source>Same format for existing dives</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1405"/> <source>Dive Site Layout</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_preferences.h" line="1406"/> <location filename="../build/ui_preferences.h" line="1407"/> <source>/</source> <translation type="unfinished"/> </message> </context> <context> <name>PreferencesGeoreference</name> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="20"/> <source>Dive site geo lookup</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="26"/> <source>Enable geocoding for dive site management</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="33"/> <source>Parse site without GPS data</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="40"/> <source>Same format for existing dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="50"/> <source>Dive Site Layout</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="72"/> <location filename="../desktop-widgets/preferences/prefs_georeference.ui" line="89"/> <source>/</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_georeference.cpp" line="10"/> <source>Georeference</source> <translation type="unfinished"/> </message> </context> <context> <name>PreferencesGraph</name> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="20"/> <source>Gas pressure display setup</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="29"/> <source>Threshold for pO₂ (bar)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="49"/> <source>Threshold for pN₂ (bar)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="69"/> <source>Threshold for pHe (bar)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="89"/> <source>pO₂ in calculating MOD (bar)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="106"/> <source>CCR options:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="113"/> <source>Dive planner default setpoint (bar)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="133"/> <source>Show setpoints when viewing pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="140"/> <source>Show individual O₂ sensor values when viewing pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="150"/> <source>Ceiling display setup</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="159"/> <source>Draw dive computer reported ceiling red</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="169"/> <source>Algorithm for calculated ceiling:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="176"/> <source>VPM-B</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="183"/> <source>VPM-B Conservatism</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="193"/> <source>+</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="206"/> <source>Bühlmann</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="216"/> <source>GFHigh</source> <translation>GFHigh</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="236"/> <source>GFLow</source> <translation>GFlow</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="256"/> <source>GFLow at max depth</source> <translation>GFlow à profundidade máxima</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="263"/> <source>pSCR options:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="270"/> <source>Metabolic rate (ℓ O₂/min)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="287"/> <source>Dilution ratio</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="300"/> <source>1:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="310"/> <source>Misc</source> <translation>Diversos</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="316"/> <source>Show unused cylinders in Equipment tab</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="323"/> <source>Show mean depth in Profile</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.cpp" line="9"/> <source>Graph</source> <translation>Gráfico</translation> </message> </context> <context> <name>PreferencesLanguage</name> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="26"/> <source>UI language</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="32"/> <source>Use system default</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="55"/> <source>Filter</source> <translation>Filtro</translation> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="74"/> <source>Date format</source> <translation>Formato da data</translation> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="80"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Preferred date format. Commonly used fields are&lt;/p&gt;&lt;p&gt;d (day of month)&lt;/p&gt;&lt;p&gt;ddd (abbr. day name)&lt;/p&gt;&lt;p&gt;M (month number)&lt;/p&gt;&lt;p&gt;MMM (abbr. month name)&lt;/p&gt;&lt;p&gt;yy/yyyy (2/4 digit year)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="87"/> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="135"/> <source>Use UI language default</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="97"/> <source>This is used in places where there is less space to show the full date</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="100"/> <source>Short format</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="129"/> <source>Time format</source> <translation>Formato da hora</translation> </message> <message> <location filename="../desktop-widgets/preferences/prefs_language.ui" line="142"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Preferred time format&lt;/p&gt;&lt;p&gt;Commonly used format specifiers are&lt;/p&gt;&lt;p&gt;h (hours in 12h format)&lt;/p&gt;&lt;p&gt;H (hours in 24h format)&lt;/p&gt;&lt;p&gt;mm (2 digit minutes)&lt;/p&gt;&lt;p&gt;ss (2 digit seconds)&lt;/p&gt;&lt;p&gt;t/tt (a/p or am/pm)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="12"/> <source>Language</source> <translation>Língua</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="53"/> <source>Restart required</source> <translation>Reinicialização necessária</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="54"/> <source>To correctly load a new language you must restart Subsurface.</source> <translation>Para carregar corretamente uma nova língua você deve reiniciar o Subsurface.</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="76"/> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="82"/> <source>Literal characters</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="77"/> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="83"/> <source>Non-special character(s) in time format. These will be used as is. This might not be what you intended. See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <translation type="unfinished"/> </message> </context> <context> <name>PreferencesNetwork</name> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="20"/> <source>Proxy</source> <translation>Proxy</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="32"/> <source>Port</source> <translation>Porta</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="39"/> <source>Host</source> <translation>Host</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="46"/> <source>Proxy type</source> <translation>Tipo de Proxy</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="56"/> <source>Username</source> <translation>Nome de usuario</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="108"/> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="172"/> <source>Password</source> <translation>Senha</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="134"/> <source>Requires authentication</source> <translation>Requer Autenticação</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="156"/> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="134"/> <source>Subsurface cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="165"/> <source>Email address</source> <translation>Endereço de email</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="179"/> <source>Verification PIN</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="186"/> <source>New password</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="221"/> <source>Sync to cloud in the background?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="228"/> <source>Save Password locally?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="238"/> <source>Subsurface web service</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="250"/> <source>Default user ID</source> <translation>ID de usuário padrão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="260"/> <source>Save user ID locally?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="10"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="15"/> <source>No proxy</source> <translation>Sem proxy</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="16"/> <source>System proxy</source> <translation>Proxy do sistema</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="17"/> <source>HTTP proxy</source> <translation>Proxy HTTP</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="18"/> <source>SOCKS proxy</source> <translation>Proxy SOCKS</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="72"/> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="93"/> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="106"/> <source>Cloud storage email and password can only consist of letters, numbers, and &apos;.&apos;, &apos;-&apos;, &apos;_&apos;, and &apos;+&apos;.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="132"/> <source>Subsurface cloud storage (credentials verified)</source> <translation type="unfinished"/> </message> </context> <context> <name>PreferencesUnits</name> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="20"/> <source>Unit system</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="26"/> <source>System</source> <translation>Sistema</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="33"/> <source>&amp;Metric</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="40"/> <source>Imperial</source> <translation>Imperial</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="47"/> <source>Personali&amp;ze</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="57"/> <source>Individual settings</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="69"/> <source>Depth</source> <translation>Profundidade</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="76"/> <source>meter</source> <translation>metro</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="86"/> <source>feet</source> <translation>pé</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="96"/> <source>Pressure</source> <translation>Pressão</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="103"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="113"/> <source>psi</source> <translation>psi</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="123"/> <source>Volume</source> <translation>Volume</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="130"/> <source>&amp;liter</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="140"/> <source>cu ft</source> <translation>pé cúbico</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="150"/> <source>Temperature</source> <translation>Temperatura</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="157"/> <source>celsius</source> <translation>celsius</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="167"/> <source>fahrenheit</source> <translation>fahrenheit</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="177"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="184"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="194"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="207"/> <source>Time units</source> <translation>Unidades de tempo</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="213"/> <source>Ascent/descent speed denominator</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="220"/> <source>Minutes</source> <translation>Minutos</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="227"/> <source>Seconds</source> <translation>Segundos</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="237"/> <source>GPS coordinates</source> <translation>Coordenadas do GPS</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="243"/> <source>Location Display</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="250"/> <source>traditional (dms)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="257"/> <source>decimal</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.cpp" line="7"/> <source>Units</source> <translation>Unidades</translation> </message> </context> <context> <name>PrintDialog</name> <message> <location filename="../desktop-widgets/printdialog.cpp" line="102"/> <source>P&amp;rint</source> <translation>Imp&amp;rimir</translation> </message> <message> <location filename="../desktop-widgets/printdialog.cpp" line="105"/> <source>&amp;Preview</source> <translation>&amp;Prévisualizar</translation> </message> <message> <location filename="../desktop-widgets/printdialog.cpp" line="117"/> <source>Print</source> <translation>Imprimir</translation> </message> </context> <context> <name>PrintOptions</name> <message> <location filename="../desktop-widgets/printoptions.ui" line="29"/> <location filename="../build/ui_printoptions.h" line="148"/> <source>Print type</source> <translation>Tipo de impressão</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="41"/> <location filename="../build/ui_printoptions.h" line="149"/> <source>&amp;Dive list print</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="57"/> <location filename="../build/ui_printoptions.h" line="151"/> <source>&amp;Statistics print</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="67"/> <location filename="../build/ui_printoptions.h" line="152"/> <source>Print options</source> <translation>Opções de impressão</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="79"/> <location filename="../build/ui_printoptions.h" line="153"/> <source>Print only selected dives</source> <translation>Imprimir somente mergulhos selecionados</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="92"/> <location filename="../build/ui_printoptions.h" line="154"/> <source>Print in color</source> <translation>Imprimir em cores</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="102"/> <location filename="../build/ui_printoptions.h" line="155"/> <source>Template</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="127"/> <location filename="../build/ui_printoptions.h" line="161"/> <source>Edit</source> <translation>Editar</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="134"/> <source>Delete</source> <translation>Apagar</translation> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="141"/> <source>Export</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.ui" line="148"/> <source>Import</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_printoptions.h" line="150"/> <source>&amp;Table print</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_printoptions.h" line="158"/> <source>One dive per page</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_printoptions.h" line="159"/> <source>Two dives per page</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="128"/> <source>Import template file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="129"/> <location filename="../desktop-widgets/printoptions.cpp" line="142"/> <source>HTML files (*.html)</source> <translation>Arquivos HTML (*.html)</translation> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="141"/> <source>Export template files as</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="152"/> <source>This action cannot be undone!</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="153"/> <source>Delete template: %1?</source> <translation type="unfinished"/> </message> </context> <context> <name>ProfileWidget2</name> <message> <location filename="../profile-widget/profilewidget2.cpp" line="729"/> <source> (#%1 of %2)</source> <translation> (#%1 de %2)</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="732"/> <source>Unknown dive computer</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="752"/> <source>Show NDL / TTS was disabled because of excessive processing time</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1338"/> <source>Make first divecomputer</source> <translation>Marcar como primeiro computador de mergulho</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1340"/> <source>Delete this divecomputer</source> <translation>Apagar este computador de mergulho</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1354"/> <source>Add gas change</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1357"/> <source> (Tank %1)</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1365"/> <source>Add set-point change</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1367"/> <source>Add bookmark</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1371"/> <source>Edit the profile</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1375"/> <source>Remove event</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1380"/> <source>Hide similar events</source> <translation>Esconder eventos semelhantes</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1387"/> <source>Edit name</source> <translation>Editar nome</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1416"/> <location filename="../profile-widget/profilewidget2.cpp" line="1423"/> <source>Adjust pressure of tank %1 (currently interpolated as %2)</source> <translation type="unfinished"/> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1438"/> <source>Unhide all events</source> <translation>Mostrar todos os eventos</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1473"/> <source>Hide events</source> <translation>Ocultar eventos</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1473"/> <source>Hide all %1 events?</source> <translation>Esconder todos os %1 eventos?</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1508"/> <source>Remove the selected event?</source> <translation>Remover o evento selecionado?</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1509"/> <source>%1 @ %2:%3</source> <translation>%1 @ %2:%3</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1632"/> <source>Edit name of bookmark</source> <translation>Editar nome do favorito</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1633"/> <source>Custom name:</source> <translation>Apelido:</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1638"/> <source>Name is too long!</source> <translation type="unfinished"/> </message> </context> <context> <name>QMLManager</name> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="97"/> <source>Starting...</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="202"/> <source>working in no-cloud mode</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="216"/> <source>no cloud credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="217"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="269"/> <source>Please enter valid cloud credentials.</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="284"/> <source>Attempting to open cloud storage with new credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="306"/> <source>Testing cloud credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="320"/> <source>No response from cloud server to validate the credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="329"/> <source>Cannot connect to cloud storage - cloud account not verified</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="361"/> <source>Cloud credentials are invalid</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="374"/> <source>Cannot open cloud storage: Error creating https connection</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="387"/> <source>Cannot open cloud storage: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="399"/> <source>Cannot connect to cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="441"/> <source>Cloud storage error: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="531"/> <source>Failed to connect to cloud server, reverting to no cloud status</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="550"/> <source>Cloud storage open successfully. No dives in dive list.</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="720"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="721"/> <source>h</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="720"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="721"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="722"/> <source>min</source> <translation>min</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="720"/> <source>sec</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="1102"/> <source>Unknown GPS location</source> <translation type="unfinished"/> </message> </context> <context> <name>QObject</name> <message> <location filename="../core/gpslocation.h" line="13"/> <source>Waiting to aquire GPS location</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="766"/> <location filename="../core/qthelper.cpp" line="1275"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../core/qthelper.cpp" line="768"/> <location filename="../core/qthelper.cpp" line="1274"/> <source>ft</source> <translation>pé(s)</translation> </message> <message> <location filename="../core/qthelper.cpp" line="794"/> <source>C</source> <translation>C</translation> </message> <message> <location filename="../core/qthelper.cpp" line="796"/> <source>F</source> <translation>F</translation> </message> <message> <location filename="../core/qthelper.cpp" line="821"/> <location filename="../core/qthelper.cpp" line="1250"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../core/qthelper.cpp" line="823"/> <location filename="../core/qthelper.cpp" line="1251"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../core/qthelper.cpp" line="848"/> <location filename="../core/qthelper.cpp" line="1300"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../core/qthelper.cpp" line="850"/> <location filename="../core/qthelper.cpp" line="1299"/> <source>psi</source> <translation>psi</translation> </message> <message> <location filename="../core/qthelper.cpp" line="871"/> <location filename="../core/qthelper.cpp" line="1235"/> <source>AIR</source> <translation>AR</translation> </message> <message> <location filename="../core/qthelper.cpp" line="873"/> <source>EAN</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location filename="../core/qthelper.cpp" line="962"/> <source>(%n dive(s))</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location filename="../core/qthelper.cpp" line="1235"/> <source>OXYGEN</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="1322"/> <source>l</source> <translation>l</translation> </message> <message> <location filename="../core/qthelper.cpp" line="1323"/> <source>cuft</source> <translation>pés cúbicos</translation> </message> <message> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="29"/> <source>unknown</source> <translation>desconhecido</translation> </message> <message> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="114"/> <source>h:</source> <translation>h:</translation> </message> <message> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="114"/> <source>min</source> <translation>min</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="63"/> <source>Remove this point</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/globe.cpp" line="327"/> <source>Move the map and double-click to set the dive location</source> <translation>Mova o mapa e dê um duplo clique para definir a localização do ponto de mergulho.</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="32"/> <source>Average</source> <translation>Média</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="35"/> <source>Minimum</source> <translation>Mínimo</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="38"/> <source>Maximum</source> <translation>Máximo</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="625"/> <source>Invalid response from server</source> <translation>Resposta inválida do servidor</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="633"/> <source>Expected XML tag &apos;DiveDateReader&apos;, got instead &apos;%1</source> <translation>Esperava rótulo XML &apos;DiveDateReader&apos;, recebido &apos;%1</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="679"/> <source>Expected XML tag &apos;DiveDates&apos; not found</source> <translation>Rótulo XML &apos;DiveDates&apos; esperado não foi encontrado</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="686"/> <source>Malformed XML response. Line %1: %2</source> <translation>Resposta XML defeituosa. Linha %1: %2</translation> </message> </context> <context> <name>ReadSettingsThread</name> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1640"/> <location filename="../core/configuredivecomputerthreads.cpp" line="1665"/> <source>This feature is not yet available for the selected dive computer.</source> <translation type="unfinished"/> </message> </context> <context> <name>RenumberDialog</name> <message> <location filename="../desktop-widgets/renumber.ui" line="17"/> <location filename="../build/ui_renumber.h" line="79"/> <source>Renumber</source> <translation>Renumerar</translation> </message> <message> <location filename="../desktop-widgets/renumber.ui" line="43"/> <location filename="../build/ui_renumber.h" line="80"/> <location filename="../desktop-widgets/simplewidgets.cpp" line="142"/> <source>New starting number</source> <translation>Novo número inicial</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="140"/> <source>New number</source> <translation>Novo numero</translation> </message> </context> <context> <name>ResetSettingsThread</name> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1764"/> <source>Reset settings failed!</source> <translation type="unfinished"/> </message> </context> <context> <name>SearchBar</name> <message> <location filename="../desktop-widgets/searchbar.ui" line="14"/> <location filename="../build/ui_searchbar.h" line="120"/> <source>Form</source> <translation>Formulário</translation> </message> </context> <context> <name>SetpointDialog</name> <message> <location filename="../desktop-widgets/setpoint.ui" line="17"/> <location filename="../build/ui_setpoint.h" line="82"/> <source>Renumber</source> <translation>Renumerar</translation> </message> <message> <location filename="../desktop-widgets/setpoint.ui" line="43"/> <location filename="../build/ui_setpoint.h" line="83"/> <source>New set-point (0 for OC)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/setpoint.ui" line="61"/> <location filename="../build/ui_setpoint.h" line="84"/> <source>bar</source> <translation>bar</translation> </message> </context> <context> <name>ShiftImageTimesDialog</name> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="23"/> <location filename="../build/ui_shiftimagetimes.h" line="184"/> <source>Shift selected image times</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="34"/> <location filename="../build/ui_shiftimagetimes.h" line="185"/> <source>Shift times of image(s) by</source> <translation>Deslocar os tempos da(s) imagem(ns) por </translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="95"/> <location filename="../build/ui_shiftimagetimes.h" line="186"/> <source>h:mm</source> <translation>h:mm</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="105"/> <location filename="../build/ui_shiftimagetimes.h" line="187"/> <source>Earlier</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="112"/> <location filename="../build/ui_shiftimagetimes.h" line="188"/> <source>Later</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="128"/> <location filename="../build/ui_shiftimagetimes.h" line="189"/> <source>Warning! Not all images have timestamps in the range between 30 minutes before the start and 30 minutes after the end of any selected dive.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="137"/> <source>Load images even if the time does not match the dive time</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="180"/> <location filename="../build/ui_shiftimagetimes.h" line="193"/> <source>To compute the offset between the clocks of your dive computer and your camera use your camera to take a picture of your dive compuer displaying the current time. Download that image to your computer and press this button.</source> <translation>Para calcular a diferença entre os relógios de seu computador de mergulho e sua câmera, tire uma foto do seu computador de mergulho mostrando o tempo atual, coloque a imagem em seu computador e aperte este botão.</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="190"/> <location filename="../build/ui_shiftimagetimes.h" line="195"/> <source>Determine camera time offset</source> <translation>Determinar o offset de tempo da câmera</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="193"/> <location filename="../build/ui_shiftimagetimes.h" line="197"/> <source>Select image of divecomputer showing time</source> <translation>Escolha a imagem do computador de mergulho exibindo a hora</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="215"/> <location filename="../build/ui_shiftimagetimes.h" line="199"/> <source>Which date and time are displayed on the image?</source> <translation>Qual dia e hora são mostrados na imagem?</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="296"/> <source>Open image file</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="298"/> <source>Image files (*.jpg *.jpeg *.pnm *.tif *.tiff)</source> <translation>Imagens (*.jpg *.jpeg *.pnm *.tif *.tiff)</translation> </message> </context> <context> <name>ShiftTimesDialog</name> <message> <location filename="../desktop-widgets/shifttimes.ui" line="23"/> <location filename="../build/ui_shifttimes.h" line="136"/> <source>Shift selected dive times</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="49"/> <location filename="../build/ui_shifttimes.h" line="137"/> <source>Shift times of selected dives by</source> <translation>Deslocar os tempos dos mergulhos selecionados em</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="72"/> <location filename="../build/ui_shifttimes.h" line="138"/> <source>Shifted time:</source> <translation>Tempo deslocado:</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="79"/> <location filename="../build/ui_shifttimes.h" line="139"/> <source>Current time:</source> <translation>Hora atual:</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="86"/> <location filename="../desktop-widgets/shifttimes.ui" line="93"/> <location filename="../build/ui_shifttimes.h" line="140"/> <location filename="../build/ui_shifttimes.h" line="141"/> <source>0:0</source> <translation>0:0</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="126"/> <location filename="../build/ui_shifttimes.h" line="142"/> <source>h:mm</source> <translation>h:mm</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="136"/> <location filename="../build/ui_shifttimes.h" line="143"/> <source>Earlier</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="143"/> <location filename="../build/ui_shifttimes.h" line="144"/> <source>Later</source> <translation type="unfinished"/> </message> </context> <context> <name>SimpleDiveSiteEditDialog</name> <message> <location filename="../build/ui_simpledivesiteedit.h" line="99"/> <source>Dialog</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_simpledivesiteedit.h" line="100"/> <source>Name</source> <translation type="unfinished"/> </message> <message> <location filename="../build/ui_simpledivesiteedit.h" line="101"/> <source>Coordinates</source> <translation>Coordenadas</translation> </message> <message> <location filename="../build/ui_simpledivesiteedit.h" line="102"/> <source>Description</source> <translation>Descrição</translation> </message> <message> <location filename="../build/ui_simpledivesiteedit.h" line="103"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../build/ui_simpledivesiteedit.h" line="104"/> <source>Dive site quick edit. Hit ESC or click outside to close</source> <translation type="unfinished"/> </message> </context> <context> <name>Smrtk2ssrfcWindow</name> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="20"/> <source>SmartTrak files importer</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="79"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#6ebeb9;&quot;&gt;Subsurface divelog&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="111"/> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="177"/> <source>Choose</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="133"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#6ebeb9;&quot;&gt;Smartrak divelog&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="242"/> <source>Exit</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="270"/> <source>Import</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="295"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#6ebeb9;&quot;&gt;Select the .slg file(s) you want to import to Subsurface format, and the exported .xml file. It&apos;s advisable to use a new output file, as its actual content will be erased.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="377"/> <source>Import messages (Errors, warnings, etc)</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="50"/> <source>Open SmartTrak files</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="51"/> <source>SmartTrak files (*.slg *.SLG);;All files (*)</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="62"/> <source>Open Subsurface files</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="63"/> <source>Subsurface files (*.ssrf *SSRF *.xml *.XML);;All files (*)</source> <translation type="unfinished"/> </message> </context> <context> <name>SocialNetworkDialog</name> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="284"/> <source>Dive date: %1 </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="287"/> <source>Duration: %1 </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="288"/> <source>h:</source> <comment>abbreviation for hours plus separator</comment> <translation>h:</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="289"/> <source>min</source> <comment>abbreviation for minutes</comment> <translation>min</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="292"/> <source>Dive location: %1 </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="295"/> <source>Buddy: %1 </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="298"/> <source>Divemaster: %1 </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="301"/> <source> %1</source> <translation type="unfinished"/> </message> </context> <context> <name>SocialnetworksDialog</name> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="14"/> <location filename="../build/ui_socialnetworksdialog.h" line="140"/> <source>Dialog</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="57"/> <location filename="../build/ui_socialnetworksdialog.h" line="141"/> <source>The text to the right will be posted as the description with your profile picture to Facebook. The album name is required (the profile picture will be posted to that album).</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="70"/> <location filename="../build/ui_socialnetworksdialog.h" line="142"/> <source>Album</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="77"/> <location filename="../build/ui_socialnetworksdialog.h" line="144"/> <source>The profile picture will be posted in this album (required)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="84"/> <location filename="../build/ui_socialnetworksdialog.h" line="146"/> <source>Include</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="91"/> <location filename="../build/ui_socialnetworksdialog.h" line="147"/> <source>Date and time</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="98"/> <location filename="../build/ui_socialnetworksdialog.h" line="148"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="105"/> <location filename="../build/ui_socialnetworksdialog.h" line="149"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="112"/> <location filename="../build/ui_socialnetworksdialog.h" line="150"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="119"/> <location filename="../build/ui_socialnetworksdialog.h" line="151"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="126"/> <location filename="../build/ui_socialnetworksdialog.h" line="152"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="139"/> <location filename="../build/ui_socialnetworksdialog.h" line="153"/> <source>Facebook post preview</source> <translation type="unfinished"/> </message> </context> <context> <name>StartPage</name> <message> <location filename="../mobile-widgets/qml/StartPage.qml" line="19"/> <source>To use Subsurface-mobile with Subsurface cloud storage, please enter your cloud credentials. </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/StartPage.qml" line="20"/> <source>If this is the first time you use Subsurface cloud storage, enter a valid email (all lower case) and a password of your choice (letters and numbers). The server will send a PIN to the email address provided that you will have to enter here. </source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/StartPage.qml" line="23"/> <source>To use Subsurface-mobile only with local data on this device, tap on the no cloud icon below.</source> <translation type="unfinished"/> </message> </context> <context> <name>SubsurfaceAbout</name> <message> <location filename="../desktop-widgets/about.ui" line="23"/> <location filename="../build/ui_about.h" line="109"/> <source>About Subsurface</source> <translation>Sobre o Subsurface</translation> </message> <message> <location filename="../desktop-widgets/about.ui" line="80"/> <location filename="../build/ui_about.h" line="112"/> <source>&amp;License</source> <translation>&amp;Licença</translation> </message> <message> <location filename="../desktop-widgets/about.ui" line="87"/> <location filename="../build/ui_about.h" line="113"/> <source>&amp;Website</source> <translation>Sítio &amp;Web</translation> </message> <message> <location filename="../desktop-widgets/about.ui" line="94"/> <location filename="../build/ui_about.h" line="114"/> <source>&amp;Close</source> <translation>Fe&amp;char</translation> </message> <message> <location filename="../desktop-widgets/about.cpp" line="19"/> <source>&lt;span style=&apos;font-size: 18pt; font-weight: bold;&apos;&gt;Subsurface %1 &lt;/span&gt;&lt;br&gt;&lt;br&gt;Multi-platform divelog software&lt;br&gt;&lt;span style=&apos;font-size: 8pt&apos;&gt;Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, and others, 2011-2017&lt;/span&gt;</source> <translation type="unfinished"/> </message> </context> <context> <name>SubsurfaceWebServices</name> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="395"/> <source>Enter User ID and click Download</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="417"/> <source>Webservice</source> <translation>Serviço web</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="505"/> <source>Connecting...</source> <translation>Conectando...</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="524"/> <source>Download finished</source> <translation>Recebimento finalizado</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="538"/> <source>Download error: %1</source> <translation>Erro no recebimento: %1</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="548"/> <source>Connection error: </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="551"/> <source>Invalid user identifier!</source> <translation>Identificador de usuário inválido!</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="554"/> <source>Cannot parse response!</source> <translation>Não é possível analisar a resposta!</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="557"/> <source>Download successful</source> <translation type="unfinished"/> </message> </context> <context> <name>SuitFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="672"/> <source>Suits: </source> <translation type="unfinished"/> </message> </context> <context> <name>SuitsFilterModel</name> <message> <location filename="../qt-models/filtermodels.cpp" line="128"/> <source>No suit set</source> <translation type="unfinished"/> </message> </context> <context> <name>TableView</name> <message> <location filename="../desktop-widgets/tableview.ui" line="14"/> <location filename="../desktop-widgets/tableview.ui" line="17"/> <location filename="../build/ui_tableview.h" line="49"/> <location filename="../build/ui_tableview.h" line="50"/> <source>GroupBox</source> <translation type="unfinished"/> </message> </context> <context> <name>TagFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="593"/> <source>Tags: </source> <translation type="unfinished"/> </message> </context> <context> <name>TagFilterModel</name> <message> <location filename="../qt-models/filtermodels.cpp" line="153"/> <source>Empty tags</source> <translation type="unfinished"/> </message> </context> <context> <name>TankInfoModel</name> <message> <location filename="../qt-models/tankinfomodel.cpp" line="90"/> <source>Description</source> <translation>Descrição</translation> </message> <message> <location filename="../qt-models/tankinfomodel.cpp" line="90"/> <source>ml</source> <translation>ml</translation> </message> <message> <location filename="../qt-models/tankinfomodel.cpp" line="90"/> <source>bar</source> <translation>bar</translation> </message> </context> <context> <name>TemplateEdit</name> <message> <location filename="../desktop-widgets/templateedit.ui" line="14"/> <source>Edit template</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="37"/> <source>Preview</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="94"/> <source>Style</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="104"/> <source>Font</source> <translation>Fonte</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="112"/> <source>Arial</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="117"/> <source>Impact</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="122"/> <source>Georgia</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="127"/> <source>Courier</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="132"/> <source>Verdana</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="144"/> <source>Font size</source> <translation>Tamanho da fonte</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="165"/> <source>Color palette</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="173"/> <source>Default</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="178"/> <source>Almond</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="183"/> <source>Shades of blue</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="188"/> <source>Custom</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="200"/> <source>Line spacing</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="241"/> <source>Template</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="264"/> <source>Colors</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="280"/> <source>Background</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="293"/> <source>color1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="303"/> <location filename="../desktop-widgets/templateedit.ui" line="343"/> <location filename="../desktop-widgets/templateedit.ui" line="383"/> <location filename="../desktop-widgets/templateedit.ui" line="423"/> <location filename="../desktop-widgets/templateedit.ui" line="463"/> <location filename="../desktop-widgets/templateedit.ui" line="503"/> <source>Edit</source> <translation>Editar</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="320"/> <source>Table cells 1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="333"/> <source>color2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="360"/> <source>Table cells 2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="373"/> <source>color3</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="400"/> <source>Text 1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="413"/> <source>color4</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="440"/> <source>Text 2</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="453"/> <source>color5</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="480"/> <source>Borders</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="493"/> <source>color6</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/templateedit.cpp" line="133"/> <source>Do you want to save your changes?</source> <translation type="unfinished"/> </message> </context> <context> <name>TestParse</name> <message> <location filename="../tests/testparse.cpp" line="296"/> <source>Sample time</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="298"/> <source>Sample depth</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="300"/> <source>Sample temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="302"/> <source>Sample pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="304"/> <source>Sample sensor1 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="306"/> <source>Sample sensor2 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="308"/> <source>Sample sensor3 pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="310"/> <source>Sample CNS</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="312"/> <source>Sample NDL</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="314"/> <source>Sample TTS</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="316"/> <source>Sample stopdepth</source> <translation type="unfinished"/> </message> <message> <location filename="../tests/testparse.cpp" line="318"/> <source>Sample pressure</source> <translation type="unfinished"/> </message> </context> <context> <name>TextHyperlinkEventFilter</name> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="815"/> <source>%1click to visit %2</source> <translation type="unfinished"/> </message> </context> <context> <name>ToolTipItem</name> <message> <location filename="../profile-widget/divetooltipitem.cpp" line="136"/> <source>Information</source> <translation>Informação</translation> </message> </context> <context> <name>TripItem</name> <message> <location filename="../qt-models/divetripmodel.cpp" line="68"/> <source>(%1 shown)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="212"/> <source>#</source> <translation>nº</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="215"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="218"/> <source>Rating</source> <translation>Classificação</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="221"/> <source>Depth(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="221"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="221"/> <source>ft</source> <translation>pé(s)</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="224"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="227"/> <source>Temp(%1%2)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="230"/> <source>Weight(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="230"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="230"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="233"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="236"/> <source>Cyl</source> <translation>Cilindro</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="239"/> <source>Gas</source> <translation>Gás</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> <source>SAC(%1)</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> <source>/min</source> <translation>/min</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="247"/> <source>OTU</source> <translation>OTU</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="250"/> <source>Max CNS</source> <translation>CNS Máximo</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="253"/> <source>Photos before/during/after dive</source> <translation type="unfinished"/> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="256"/> <source>Location</source> <translation>Local</translation> </message> </context> <context> <name>URLDialog</name> <message> <location filename="../desktop-widgets/urldialog.ui" line="14"/> <location filename="../build/ui_urldialog.h" line="57"/> <source>Dialog</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/urldialog.ui" line="52"/> <location filename="../build/ui_urldialog.h" line="58"/> <source>Enter URL for images</source> <translation type="unfinished"/> </message> </context> <context> <name>UpdateManager</name> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="61"/> <source>Check for updates.</source> <translation>Buscar atualizações.</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="62"/> <source>Subsurface was unable to check for updates.</source> <translation>Subsurface não conseguiu localizar atualizações</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="67"/> <source>The following error occurred:</source> <translation>O seguinte erro ocorreu</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="68"/> <source>Please check your internet connection.</source> <translation>Por favor, verifique sua conexão a internet</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="78"/> <source>You are using the latest version of Subsurface.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="81"/> <source>A new version of Subsurface is available.&lt;br/&gt;Click on:&lt;br/&gt;&lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;&lt;br/&gt; to download it.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="87"/> <source>A new version of Subsurface is available.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="88"/> <source>Latest version is %1, please check %2 our download page %3 for information in how to update.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="98"/> <source>Newest release version is </source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="99"/> <source>The server returned the following information:</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="117"/> <source>Subsurface is checking every two weeks if a new version is available. If you don&apos;t want Subsurface to continue checking, please click Decline.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="119"/> <source>Decline</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="120"/> <source>Accept</source> <translation>Aceitar</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="122"/> <source>Automatic check for updates</source> <translation>Buscar atualizações automaticamente</translation> </message> </context> <context> <name>UserManual</name> <message> <location filename="../desktop-widgets/usermanual.cpp" line="54"/> <source>User manual</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usermanual.cpp" line="74"/> <location filename="../desktop-widgets/usermanual.cpp" line="80"/> <source>Cannot find the Subsurface manual</source> <translation>Não foi possível encontrar o manual do Subsurface</translation> </message> </context> <context> <name>UserSurvey</name> <message> <location filename="../desktop-widgets/usersurvey.ui" line="14"/> <location filename="../build/ui_usersurvey.h" line="149"/> <source>User survey</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="31"/> <location filename="../build/ui_usersurvey.h" line="150"/> <source>Subsurface user survey</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="44"/> <location filename="../build/ui_usersurvey.h" line="151"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;We would love to learn more about our users, their preferences and their usage habits. Please spare a minute to fill out this form and submit it to the Subsurface team.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="63"/> <location filename="../build/ui_usersurvey.h" line="152"/> <source>Technical diver</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="76"/> <location filename="../build/ui_usersurvey.h" line="153"/> <source>Recreational diver</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="89"/> <location filename="../build/ui_usersurvey.h" line="154"/> <source>Dive planner</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="102"/> <location filename="../build/ui_usersurvey.h" line="155"/> <source>Supported dive computer</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="115"/> <location filename="../build/ui_usersurvey.h" line="156"/> <source>Other software/sources</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="128"/> <location filename="../build/ui_usersurvey.h" line="157"/> <source>Manually entering dives</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="141"/> <location filename="../build/ui_usersurvey.h" line="158"/> <source>Android/iPhone companion app</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="154"/> <location filename="../build/ui_usersurvey.h" line="159"/> <source>Any suggestions? (in English)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="177"/> <location filename="../build/ui_usersurvey.h" line="160"/> <source>The following information about your system will also be submitted.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="231"/> <location filename="../build/ui_usersurvey.h" line="161"/> <source>What kind of diver are you?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="270"/> <location filename="../build/ui_usersurvey.h" line="162"/> <source>Where are you importing data from?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="18"/> <source>Send</source> <translation>Enviar</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="43"/> <source> Operating system: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="45"/> <source> CPU architecture: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="47"/> <source> OS CPU architecture: %1</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="48"/> <source> Language: %1</source> <translation> Lingua: %1</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="79"/> <source>Should we ask you later?</source> <translation>Perguntar depois?</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="80"/> <source>Don&apos;t ask me again</source> <translation>Não</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="81"/> <source>Ask later</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="82"/> <source>Ask again?</source> <translation>Perguntar depois?</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="101"/> <source>Submit user survey.</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="102"/> <source>Subsurface was unable to submit the user survey.</source> <translation>Subsurface não conseguiu enviar a pesquisa</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="107"/> <source>The following error occurred:</source> <translation>O seguinte erro ocorreu</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="108"/> <source>Please check your internet connection.</source> <translation>Por favor, verifique sua conexão a internet</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="117"/> <source>Survey successfully submitted.</source> <translation>Pesquisa enviada com sucesso</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.cpp" line="122"/> <source>There was an error while trying to check for updates.&lt;br/&gt;&lt;br/&gt;%1</source> <translation>Houve um erro enquanto buscavamos pela atualização.&lt;br/&gt;&lt;br/&gt;%1</translation> </message> </context> <context> <name>WSInfoModel</name> <message> <location filename="../qt-models/weigthsysteminfomodel.cpp" line="83"/> <source>Description</source> <translation>Descrição</translation> </message> <message> <location filename="../qt-models/weigthsysteminfomodel.cpp" line="83"/> <source>kg</source> <translation>kg</translation> </message> </context> <context> <name>WebServices</name> <message> <location filename="../desktop-widgets/webservices.ui" line="14"/> <location filename="../build/ui_webservices.h" line="129"/> <source>Web service connection</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="25"/> <location filename="../build/ui_webservices.h" line="130"/> <source>Status:</source> <translation>Situação:</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="32"/> <location filename="../build/ui_webservices.h" line="131"/> <source>Enter your ID here</source> <translation>Inserir o seu ID aqui</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="44"/> <location filename="../build/ui_webservices.h" line="132"/> <source>Download</source> <translation>Receber</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="68"/> <location filename="../build/ui_webservices.h" line="133"/> <source>User ID</source> <translation>ID do usuário</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="85"/> <location filename="../build/ui_webservices.h" line="135"/> <source>Save user ID locally?</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="92"/> <location filename="../build/ui_webservices.h" line="136"/> <source>Password</source> <translation>Senha</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="106"/> <location filename="../build/ui_webservices.h" line="137"/> <source>Upload</source> <translation>Enviar</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="325"/> <source>Operation timed out</source> <translation>Tempo limite para operação estourou</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="346"/> <source>Transferring data...</source> <translation type="unfinished"/> </message> </context> <context> <name>WeightModel</name> <message> <location filename="../qt-models/weightmodel.cpp" line="13"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location filename="../qt-models/weightmodel.cpp" line="13"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../qt-models/weightmodel.cpp" line="77"/> <source>Clicking here will remove this weight system.</source> <translation type="unfinished"/> </message> </context> <context> <name>WinBluetoothDeviceDiscoveryAgent</name> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="524"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="555"/> <source>No error</source> <translation type="unfinished"/> </message> </context> <context> <name>WriteSettingsThread</name> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1689"/> <location filename="../core/configuredivecomputerthreads.cpp" line="1710"/> <source>This feature is not yet available for the selected dive computer.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="1691"/> <location filename="../core/configuredivecomputerthreads.cpp" line="1698"/> <location filename="../core/configuredivecomputerthreads.cpp" line="1707"/> <source>Failed!</source> <translation type="unfinished"/> </message> </context> <context> <name>YearlyStatisticsModel</name> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="126"/> <source>Year &gt; Month / Trip</source> <translation>Ano &gt; Mês / Viagem</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="129"/> <source>#</source> <translation>nº</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="132"/> <source>Duration Total</source> <translation>Duração Total</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="135"/> <source> Average</source> <translation> Média</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="138"/> <source> Shortest</source> <translation> Mais curto</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="141"/> <source> Longest</source> <translation> Mais longo</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="144"/> <source>Depth (%1) Average</source> <translation>Profundidade (%1) Média</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="147"/> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="156"/> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="165"/> <source> Minimum</source> <translation> Mínimo</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="150"/> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="159"/> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="168"/> <source> Maximum</source> <translation> Máximo</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="153"/> <source>SAC (%1) Average</source> <translation>SAC (%1) Médio</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="162"/> <source>Temp. (%1) Average</source> <translation>Temp. (%1) Média</translation> </message> </context> <context> <name>getTextFromC</name> <message> <location filename="../core/taxonomy.c" line="6"/> <source>None</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="7"/> <source>Ocean</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="8"/> <source>Country</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="9"/> <source>State</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="10"/> <source>County</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="11"/> <source>Town</source> <translation type="unfinished"/> </message> <message> <location filename="../core/taxonomy.c" line="12"/> <source>City</source> <translation type="unfinished"/> </message> </context> <context> <name>getextFromC</name> <message> <location filename="../core/libdivecomputer.c" line="737"/> <source>Error parsing the header</source> <translation type="unfinished"/> </message> </context> <context> <name>gettextFromC</name> <message> <location filename="../core/cochran.c" line="309"/> <location filename="../core/cochran.c" line="315"/> <location filename="../core/cochran.c" line="385"/> <location filename="../core/libdivecomputer.c" line="223"/> <source>deco stop</source> <translation>parada de deco</translation> </message> <message> <location filename="../core/cochran.c" line="336"/> <location filename="../core/cochran.c" line="390"/> <location filename="../core/file.c" line="777"/> <location filename="../core/libdivecomputer.c" line="223"/> <source>ascent</source> <translation>subida</translation> </message> <message> <location filename="../core/cochran.c" line="342"/> <location filename="../core/file.c" line="755"/> <source>battery</source> <translation type="unfinished"/> </message> <message> <location filename="../core/cochran.c" line="348"/> <location filename="../core/libdivecomputer.c" line="227"/> <source>OLF</source> <translation>OLF</translation> </message> <message> <location filename="../core/cochran.c" line="353"/> <location filename="../core/libdivecomputer.c" line="227"/> <source>maxdepth</source> <translation>prof máx</translation> </message> <message> <location filename="../core/cochran.c" line="358"/> <location filename="../core/cochran.c" line="404"/> <location filename="../core/libdivecomputer.c" line="227"/> <source>pO₂</source> <translation>pO₂</translation> </message> <message> <location filename="../core/cochran.c" line="365"/> <location filename="../core/cochran.c" line="414"/> <location filename="../core/cochran.c" line="421"/> <location filename="../core/file.c" line="868"/> <location filename="../core/libdivecomputer.c" line="225"/> <location filename="../core/libdivecomputer.c" line="228"/> <source>gaschange</source> <translation>troca de gás</translation> </message> <message> <location filename="../core/cochran.c" line="370"/> <location filename="../core/cochran.c" line="409"/> <location filename="../core/libdivecomputer.c" line="223"/> <source>rbt</source> <translation>rbt</translation> </message> <message> <location filename="../core/cochran.c" line="379"/> <location filename="../core/cochran.c" line="426"/> <location filename="../core/libdivecomputer.c" line="223"/> <source>ceiling</source> <translation>teto</translation> </message> <message> <location filename="../core/cochran.c" line="395"/> <location filename="../core/libdivecomputer.c" line="224"/> <source>transmitter</source> <translation>transmissor</translation> </message> <message> <location filename="../core/datatrak.c" line="153"/> <source>Error: the file does not appear to be a DATATRAK divelog</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="286"/> <source>clear</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="289"/> <source>misty</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="292"/> <source>fog</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="295"/> <source>rain</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="298"/> <source>storm</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="301"/> <source>snow</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="321"/> <source>No suit</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="324"/> <source>Shorty</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="327"/> <source>Combi</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="330"/> <source>Wet suit</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="333"/> <source>Semidry suit</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="336"/> <source>Dry suit</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="396"/> <source>no stop</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="398"/> <location filename="../core/dive.c" line="29"/> <source>deco</source> <translation>deco</translation> </message> <message> <location filename="../core/datatrak.c" line="400"/> <source>single ascent</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="402"/> <source>multiple ascent</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="404"/> <location filename="../core/dive.c" line="27"/> <source>fresh</source> <translation>água doce</translation> </message> <message> <location filename="../core/datatrak.c" line="406"/> <source>salt water</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="431"/> <source>sight seeing</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="433"/> <source>club dive</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="435"/> <location filename="../core/dive.c" line="28"/> <source>instructor</source> <translation>instrutor</translation> </message> <message> <location filename="../core/datatrak.c" line="437"/> <source>instruction</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="439"/> <location filename="../core/dive.c" line="27"/> <source>night</source> <translation>noturno</translation> </message> <message> <location filename="../core/datatrak.c" line="441"/> <location filename="../core/dive.c" line="25"/> <source>cave</source> <translation>caverna</translation> </message> <message> <location filename="../core/datatrak.c" line="443"/> <location filename="../core/dive.c" line="24"/> <source>ice</source> <translation>gelo</translation> </message> <message> <location filename="../core/datatrak.c" line="445"/> <source>search</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="455"/> <location filename="../core/dive.c" line="25"/> <source>wreck</source> <translation>naufrágio</translation> </message> <message> <location filename="../core/datatrak.c" line="457"/> <location filename="../core/dive.c" line="26"/> <source>river</source> <translation>rio</translation> </message> <message> <location filename="../core/datatrak.c" line="459"/> <location filename="../core/dive.c" line="23"/> <source>drift</source> <translation>correnteza</translation> </message> <message> <location filename="../core/datatrak.c" line="461"/> <location filename="../core/dive.c" line="28"/> <source>photo</source> <translation>foto</translation> </message> <message> <location filename="../core/datatrak.c" line="463"/> <source>other</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="474"/> <source>Other activities</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="498"/> <source>Datatrak/Wlog notes</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="537"/> <source>Manually entered dive</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="588"/> <source>Unknown</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="674"/> <source>Error: couldn&apos;t open the file %s</source> <translation type="unfinished"/> </message> <message> <location filename="../core/datatrak.c" line="687"/> <source>Error: no dive</source> <translation type="unfinished"/> </message> <message> <location filename="../core/dive.c" line="23"/> <source>boat</source> <translation>barco</translation> </message> <message> <location filename="../core/dive.c" line="23"/> <source>shore</source> <translation>costa</translation> </message> <message> <location filename="../core/dive.c" line="24"/> <source>deep</source> <translation>profundo</translation> </message> <message> <location filename="../core/dive.c" line="24"/> <source>cavern</source> <translation>gruta (com luz natural)</translation> </message> <message> <location filename="../core/dive.c" line="25"/> <source>altitude</source> <translation>altitude</translation> </message> <message> <location filename="../core/dive.c" line="26"/> <source>pool</source> <translation>piscina</translation> </message> <message> <location filename="../core/dive.c" line="26"/> <source>lake</source> <translation>lago</translation> </message> <message> <location filename="../core/dive.c" line="27"/> <source>student</source> <translation>aluno</translation> </message> <message> <location filename="../core/dive.c" line="28"/> <source>video</source> <translation>vídeo</translation> </message> <message> <location filename="../core/dive.c" line="33"/> <source>OC-gas</source> <translation type="unfinished"/> </message> <message> <location filename="../core/dive.c" line="33"/> <source>diluent</source> <translation type="unfinished"/> </message> <message> <location filename="../core/dive.c" line="33"/> <location filename="../core/equipment.c" line="88"/> <location filename="../core/planner.c" line="1436"/> <location filename="../core/planner.c" line="1439"/> <source>oxygen</source> <translation type="unfinished"/> </message> <message> <location filename="../core/dive.c" line="181"/> <source>pascal</source> <translation>pascal</translation> </message> <message> <location filename="../core/dive.c" line="186"/> <location filename="../core/qthelper.cpp" line="674"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../core/dive.c" line="190"/> <location filename="../core/qthelper.cpp" line="677"/> <source>psi</source> <translation>psi</translation> </message> <message> <location filename="../core/dive.c" line="227"/> <source>ℓ</source> <translation>ℓ</translation> </message> <message> <location filename="../core/dive.c" line="232"/> <source>cuft</source> <translation>pés cúbicos</translation> </message> <message> <location filename="../core/dive.c" line="269"/> <location filename="../core/qthelper.cpp" line="595"/> <location filename="../core/qthelper.cpp" line="610"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../core/dive.c" line="274"/> <location filename="../core/qthelper.cpp" line="598"/> <location filename="../core/qthelper.cpp" line="612"/> <source>ft</source> <translation>pé(s)</translation> </message> <message> <location filename="../core/dive.c" line="297"/> <source>m/min</source> <translation>m/min</translation> </message> <message> <location filename="../core/dive.c" line="299"/> <source>m/s</source> <translation>m/s</translation> </message> <message> <location filename="../core/dive.c" line="304"/> <source>ft/min</source> <translation>pés/min</translation> </message> <message> <location filename="../core/dive.c" line="306"/> <source>ft/s</source> <translation>pés/s</translation> </message> <message> <location filename="../core/dive.c" line="325"/> <location filename="../core/qthelper.cpp" line="621"/> <location filename="../core/qthelper.cpp" line="631"/> <source>lbs</source> <translation>lbs</translation> </message> <message> <location filename="../core/dive.c" line="329"/> <location filename="../core/qthelper.cpp" line="619"/> <location filename="../core/qthelper.cpp" line="629"/> <source>kg</source> <translation>kg</translation> </message> <message> <location filename="../core/dive.c" line="1751"/> <source>(%s) or (%s)</source> <translation>(%s) ou (%s)</translation> </message> <message> <location filename="../core/divelist.c" line="487"/> <location filename="../core/equipment.c" line="84"/> <location filename="../core/planner.c" line="1432"/> <location filename="../core/planner.c" line="1435"/> <source>air</source> <translation>ar</translation> </message> <message> <location filename="../core/equipment.c" line="86"/> <source>EAN%d</source> <translation>EAN%d</translation> </message> <message> <location filename="../core/equipment.c" line="198"/> <source>integrated</source> <translation>integrado</translation> </message> <message> <location filename="../core/equipment.c" line="199"/> <source>belt</source> <translation>cinto</translation> </message> <message> <location filename="../core/equipment.c" line="200"/> <source>ankle</source> <translation>tornozelo</translation> </message> <message> <location filename="../core/equipment.c" line="201"/> <source>backplate weight</source> <translation>lastro no arnês</translation> </message> <message> <location filename="../core/equipment.c" line="202"/> <source>clip-on</source> <translation>clip-on</translation> </message> <message> <location filename="../core/file.c" line="111"/> <source>No dives in the input file &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="121"/> <location filename="../core/file.c" line="512"/> <location filename="../core/file.c" line="597"/> <location filename="../core/file.c" line="909"/> <location filename="../core/file.c" line="1092"/> <location filename="../core/ostctools.c" line="80"/> <source>Failed to read &apos;%s&apos;</source> <translation>Falha na leitura de &apos;%s&apos;</translation> </message> <message> <location filename="../core/file.c" line="398"/> <source>Cannot open CSV file %s; please use Import log file dialog</source> <comment>'Import log file' should be the same text as corresponding label in Import menu</comment> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="514"/> <source>Empty file &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="694"/> <source>Poseidon import failed: unable to read &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="730"/> <source>Mouth piece position OC</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="734"/> <source>Mouth piece position CC</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="738"/> <source>Mouth piece position unknown</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="742"/> <source>Mouth piece position not connected</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="749"/> <source>Power off</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="809"/> <source>O₂ calibration failed</source> <translation type="unfinished"/> </message> <message> <location filename="../core/file.c" line="811"/> <location filename="../core/file.c" line="820"/> <source>O₂ calibration</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="134"/> <source>Local cache directory %s corrupted - can&apos;t sync with Subsurface cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="157"/> <location filename="../core/git-access.c" line="177"/> <source>Could not update local cache to newer remote data</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="170"/> <source>Subsurface cloud storage corrupted</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="284"/> <source>Could not update Subsurface cloud storage, try again later</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="344"/> <source>Remote storage and local data diverged. Error: merge failed (%s)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="374"/> <source>Remote storage and local data diverged. Cannot combine local and remote changes</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="408"/> <source>Remote storage and local data diverged</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="411"/> <source>Remote storage and local data diverged. Error: writing the data failed (%s)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="420"/> <source>Problems with local cache of Subsurface cloud data</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="421"/> <source>Moved cache data to %s. Please try the operation again.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="743"/> <source>Error connecting to Subsurface cloud storage</source> <translation type="unfinished"/> </message> <message> <location filename="../core/git-access.c" line="746"/> <source>git clone of %s failed (%s)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/libdivecomputer.c" line="210"/> <location filename="../core/parse-xml.c" line="3317"/> <location filename="../core/uemis-downloader.c" line="134"/> <source>unknown</source> <translation>desconhecido</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="223"/> <source>none</source> <translation>nenhum</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="223"/> <source>workload</source> <translation>nível de esforço</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="224"/> <source>violation</source> <translation>violação</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="224"/> <source>bookmark</source> <translation>favorito</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="224"/> <source>surface</source> <translation>superfície</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="224"/> <source>safety stop</source> <translation>parada de segurança</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="225"/> <source>safety stop (voluntary)</source> <translation>parada de segurança (voluntária)</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="225"/> <source>safety stop (mandatory)</source> <translation>parada de segurança (obrigatória)</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="226"/> <source>deepstop</source> <translation>parada profunda</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="226"/> <source>ceiling (safety stop)</source> <translation>teto (parada de segurança)</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="226"/> <source>below floor</source> <comment>event showing dive is below deco floor and adding deco time</comment> <translation>abaixo da zona de descompressão</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="226"/> <source>divetime</source> <translation>duração do mergulho</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="227"/> <source>airtime</source> <translation>tempo de ar</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="227"/> <source>rgbm</source> <translation>rgbm</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="227"/> <source>heading</source> <translation>direção</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="228"/> <source>tissue level warning</source> <translation>Alarme do nível nos tecidos</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="228"/> <source>non stop time</source> <translation>tempo sem parada</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="237"/> <source>invalid event number</source> <translation>número de evento inválido</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="553"/> <source>Error parsing the datetime</source> <translation>Erro na análise da data/horário</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="571"/> <source>Dive %d: %s</source> <translation>Mergulho nº %d: %s</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="577"/> <source>Error parsing the divetime</source> <translation>Erro na análise da duração do mergulho</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="587"/> <source>Error parsing the maxdepth</source> <translation>Erro na análise da profundidade máxima</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="606"/> <source>Error parsing temperature</source> <translation type="unfinished"/> </message> <message> <location filename="../core/libdivecomputer.c" line="626"/> <source>Error parsing the gas mix count</source> <translation>Erro na análise da contagem de misturas de gases</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="638"/> <source>Error obtaining water salinity</source> <translation>Erro na obtenção da salinidade da água</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="647"/> <source>Error obtaining surface pressure</source> <translation>Erro na obtenção da pressão na superfície</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="672"/> <source>Error obtaining divemode</source> <translation type="unfinished"/> </message> <message> <location filename="../core/libdivecomputer.c" line="692"/> <source>Error parsing the gas mix</source> <translation>Erro na análise da mistura de gás</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="717"/> <source>Unable to create parser for %s %s</source> <translation>Não é possivel criar o analisador para %s %s</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="723"/> <source>Error registering the data</source> <translation>Erro no registo dos dados</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="744"/> <source>Error parsing the samples</source> <translation>Erro na análise das amostras</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="882"/> <source>Event: waiting for user action</source> <translation>Evento: aguardando ação do usuário</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="890"/> <source>model=%u (0x%08x), firmware=%u (0x%08x), serial=%u (0x%08x)</source> <translation>modelo=%u (0x%08x), firmware=%u (0x%08x), Nº de série=%u (0x%08x)</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="954"/> <source>Error registering the event handler.</source> <translation>Erro no registo do rótulo do evento.</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="959"/> <source>Error registering the cancellation handler.</source> <translation>Erro no registo do rótulo de cancelamento.</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="980"/> <source>Dive data import error</source> <translation>Erro ao importar os dados do mergulho</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="1019"/> <source>Unable to create libdivecomputer context</source> <translation>Não é possivel criar contexto da libdivecomputer</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="1026"/> <source>Unable to open %s %s (%s)</source> <translation>Não se consegue abrir %s %s (%s)</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="1048"/> <source>Insufficient privileges to open the device %s %s (%s)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/load-git.c" line="194"/> <location filename="../core/parse-xml.c" line="1242"/> <source>multiple GPS locations for this dive site; also %s </source> <translation type="unfinished"/> </message> <message> <location filename="../core/load-git.c" line="222"/> <location filename="../core/parse-xml.c" line="1304"/> <source>additional name for site: %s </source> <translation type="unfinished"/> </message> <message> <location filename="../core/ostctools.c" line="120"/> <location filename="../core/ostctools.c" line="152"/> <source>Unknown DC in dive %d</source> <translation type="unfinished"/> </message> <message> <location filename="../core/ostctools.c" line="165"/> <source>Error - %s - parsing dive %d</source> <translation type="unfinished"/> </message> <message> <location filename="../core/parse-xml.c" line="517"/> <source>Strange percentage reading %s </source> <translation>Percentagem estranha na leitura %s </translation> </message> <message> <location filename="../core/parse-xml.c" line="2051"/> <source>Failed to parse &apos;%s&apos;</source> <translation>Falha na análise de &apos;%s&apos;</translation> </message> <message> <location filename="../core/parse-xml.c" line="3774"/> <source>Can&apos;t open stylesheet %s</source> <translation>Falha na abertura da folha de estilo %s</translation> </message> <message> <location filename="../core/planner.c" line="555"/> <source>DISCLAIMER / WARNING: THIS IS A NEW IMPLEMENTATION OF THE %s ALGORITHM AND A DIVE PLANNER IMPLEMENTATION BASED ON THAT WHICH HAS RECEIVED ONLY A LIMITED AMOUNT OF TESTING. WE STRONGLY RECOMMEND NOT TO PLAN DIVES SIMPLY BASED ON THE RESULTS GIVEN HERE.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="569"/> <source>Decompression calculation aborted due to excessive time</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="571"/> <location filename="../core/planner.c" line="829"/> <location filename="../core/planner.c" line="834"/> <location filename="../core/planner.c" line="860"/> <location filename="../core/planner.c" line="870"/> <source>Warning:</source> <translation>Aviso:</translation> </message> <message> <location filename="../core/planner.c" line="581"/> <source>based on Bühlmann ZHL-16C with GFlow = %d and GFhigh = %d</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="586"/> <source>based on VPM-B at nominal conservatism</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="588"/> <source>based on VPM-B at +%d conservatism</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="590"/> <source>, effective GF=%d/%d</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="594"/> <source>recreational mode based on Bühlmann ZHL-16B with GFlow = %d and GFhigh = %d</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="598"/> <source>Subsurface dive plan</source> <translation>Plano de mergulho do subsurface</translation> </message> <message> <location filename="../core/planner.c" line="599"/> <source>&lt;div&gt;Runtime: %dmin&lt;/div&gt;&lt;br&gt;</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="604"/> <source>depth</source> <translation>profundidade</translation> </message> <message> <location filename="../core/planner.c" line="607"/> <source>duration</source> <translation>duração</translation> </message> <message> <location filename="../core/planner.c" line="610"/> <source>runtime</source> <translation>tempo</translation> </message> <message> <location filename="../core/planner.c" line="613"/> <source>gas</source> <translation>gás</translation> </message> <message> <location filename="../core/planner.c" line="656"/> <source>Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s (SP = %.1fbar)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="664"/> <source>Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s</source> <translation>Transição pra %.*f %s em %d:%02d min - tempo %d:%02u em %s</translation> </message> <message> <location filename="../core/planner.c" line="677"/> <source>Stay at %.*f %s for %d:%02d min - runtime %d:%02u on %s (SP = %.1fbar)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="684"/> <source>Stay at %.*f %s for %d:%02d min - runtime %d:%02u on %s</source> <translation>Fique em %.*f %s por %d:%02d min - durante %d:%02u em %s</translation> </message> <message> <location filename="../core/planner.c" line="729"/> <source>%3.0f%s</source> <translation>%3.0f%s</translation> </message> <message> <location filename="../core/planner.c" line="732"/> <location filename="../core/planner.c" line="736"/> <source>%3dmin</source> <translation>%3dmin</translation> </message> <message> <location filename="../core/planner.c" line="745"/> <location filename="../core/planner.c" line="757"/> <source>(SP = %.1fbar)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="780"/> <source>Switch gas to %s (SP = %.1fbar)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="782"/> <source>Switch gas to %s</source> <translation>Trocar o gás por %s</translation> </message> <message> <location filename="../core/planner.c" line="801"/> <source>CNS</source> <translation>CNS</translation> </message> <message> <location filename="../core/planner.c" line="803"/> <source>OTU</source> <translation>OTU</translation> </message> <message> <location filename="../core/planner.c" line="807"/> <source>Gas consumption (CCR legs excluded):</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="809"/> <source>Gas consumption:</source> <translation>Consumo de gás</translation> </message> <message> <location filename="../core/planner.c" line="830"/> <source>this is more gas than available in the specified cylinder!</source> <translation>Isso é mais gás que a capacidade do cilindro especificado</translation> </message> <message> <location filename="../core/planner.c" line="835"/> <source>not enough reserve for gas sharing on ascent!</source> <translation>Sem reserva para compartilhar ar na subida</translation> </message> <message> <location filename="../core/planner.c" line="837"/> <source>%.0f%s/%.0f%s of %s (%.0f%s/%.0f%s in planned ascent)</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="839"/> <source>%.0f%s (%.0f%s during planned ascent) of %s</source> <translation>%.0f%s (%.0f%s durante a subida planejada) de %s</translation> </message> <message> <location filename="../core/planner.c" line="857"/> <source>high pO₂ value %.2f at %d:%02u with gas %s at depth %.*f %s</source> <translation>valor pO₂ alto %.2f em %d:%02u com gás %s na profundidade %.*f %s</translation> </message> <message> <location filename="../core/planner.c" line="867"/> <source>low pO₂ value %.2f at %d:%02u with gas %s at depth %.*f %s</source> <translation type="unfinished"/> </message> <message> <location filename="../core/planner.c" line="1194"/> <source>Can&apos;t find gas %s</source> <translation>Não é possivel achar gas o %s</translation> </message> <message> <location filename="../core/planner.c" line="1440"/> <source>ean</source> <translation>ean</translation> </message> <message> <location filename="../core/profile.c" line="1298"/> <source>@: %d:%02d D: %.1f%s </source> <translation>@: %d:%02d D: %.1f%s </translation> </message> <message> <location filename="../core/profile.c" line="1301"/> <source>P: %d%s </source> <translation>P: %d%s </translation> </message> <message> <location filename="../core/profile.c" line="1305"/> <source>T: %.1f%s </source> <translation>T: %.1f%s </translation> </message> <message> <location filename="../core/profile.c" line="1311"/> <source>V: %.1f%s </source> <translation>V: %.1f%s </translation> </message> <message> <location filename="../core/profile.c" line="1314"/> <source>SAC: %.*f%s/min </source> <translation>SAC: %.*f%s/min </translation> </message> <message> <location filename="../core/profile.c" line="1316"/> <source>CNS: %u%% </source> <translation>CNS: %u%% </translation> </message> <message> <location filename="../core/profile.c" line="1318"/> <source>pO%s: %.2fbar </source> <translation>pO%s: %.2fbar </translation> </message> <message> <location filename="../core/profile.c" line="1320"/> <source>pN%s: %.2fbar </source> <translation>pN%s: %.2fbar </translation> </message> <message> <location filename="../core/profile.c" line="1322"/> <source>pHe: %.2fbar </source> <translation>pHe: %.2fbar </translation> </message> <message> <location filename="../core/profile.c" line="1325"/> <source>MOD: %d%s </source> <translation>MOD: %d%s </translation> </message> <message> <location filename="../core/profile.c" line="1332"/> <source>EAD: %d%s EADD: %d%s </source> <translation>EAD: %d%s EADD: %d%s </translation> </message> <message> <location filename="../core/profile.c" line="1336"/> <source>END: %d%s EADD: %d%s </source> <translation>END: %d%s EADD: %d%s </translation> </message> <message> <location filename="../core/profile.c" line="1349"/> <source>Safetystop: %umin @ %.0f%s </source> <translation>Parada de segurança: %umin @ %.0f%s </translation> </message> <message> <location filename="../core/profile.c" line="1352"/> <source>Safetystop: unkn time @ %.0f%s </source> <translation>Parada de segurança: tempo desconhecido @ %.0f%s </translation> </message> <message> <location filename="../core/profile.c" line="1357"/> <source>Deco: %umin @ %.0f%s </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1360"/> <source>Deco: unkn time @ %.0f%s </source> <translation>Deco: tempo desconhecido @ %.0f%s </translation> </message> <message> <location filename="../core/profile.c" line="1364"/> <source>In deco </source> <translation>Em deco </translation> </message> <message> <location filename="../core/profile.c" line="1366"/> <source>NDL: %umin </source> <translation>NDL: %umin </translation> </message> <message> <location filename="../core/profile.c" line="1369"/> <source>TTS: %umin </source> <translation>TTS: %umin </translation> </message> <message> <location filename="../core/profile.c" line="1372"/> <source>Deco: %umin @ %.0f%s (calc) </source> <translation>Deco: %umin @ %.0f%s (calc) </translation> </message> <message> <location filename="../core/profile.c" line="1380"/> <source>In deco (calc) </source> <translation>Em deco (calc) </translation> </message> <message> <location filename="../core/profile.c" line="1383"/> <source>NDL: %umin (calc) </source> <translation>NDL: %umin (calc) </translation> </message> <message> <location filename="../core/profile.c" line="1385"/> <source>NDL: &gt;2h (calc) </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1389"/> <source>TTS: %umin (calc) </source> <translation>TTS: %umin (calc) </translation> </message> <message> <location filename="../core/profile.c" line="1391"/> <source>TTS: &gt;2h (calc) </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1394"/> <source>RBT: %umin </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1397"/> <source>Calculated ceiling %.0f%s </source> <translation>Teto calculado %.0f%s </translation> </message> <message> <location filename="../core/profile.c" line="1403"/> <source>Tissue %.0fmin: %.1f%s </source> <translation>Tecido %.0fmin: %.1f%s </translation> </message> <message> <location filename="../core/profile.c" line="1409"/> <source>heartbeat: %d </source> <translation>Cardio: %d </translation> </message> <message> <location filename="../core/profile.c" line="1411"/> <source>bearing: %d </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1414"/> <source>mean depth to here %.1f%s </source> <translation type="unfinished"/> </message> <message> <location filename="../core/profile.c" line="1515"/> <source>%sT: %d:%02d min</source> <translation>%sT: %d:%02d min</translation> </message> <message> <location filename="../core/profile.c" line="1519"/> <location filename="../core/profile.c" line="1523"/> <location filename="../core/profile.c" line="1527"/> <source>%s %sD:%.1f%s</source> <translation>%s %sD:%.1f%s</translation> </message> <message> <location filename="../core/profile.c" line="1531"/> <source>%s %sD:%.1f%s </source> <translation>%s %sD:%.1f%s </translation> </message> <message> <location filename="../core/profile.c" line="1535"/> <source>%s%sV:%.2f%s</source> <translation>%s%sV:%.2f%s</translation> </message> <message> <location filename="../core/profile.c" line="1539"/> <location filename="../core/profile.c" line="1543"/> <source>%s %sV:%.2f%s</source> <translation>%s %sV:%.2f%s</translation> </message> <message> <location filename="../core/profile.c" line="1550"/> <source>%s %sP:%d %s</source> <translation>%s %sP:%d %s</translation> </message> <message> <location filename="../core/profile.c" line="1575"/> <source>%s SAC:%.*f %s</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="67"/> <source>%1km</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="69"/> <source>%1m</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="73"/> <source>%1mi</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="75"/> <source>%1yd</source> <translation type="unfinished"/> </message> <message> <location filename="../core/qthelper.cpp" line="91"/> <location filename="../core/qthelper.cpp" line="226"/> <source>N</source> <translation>N</translation> </message> <message> <location filename="../core/qthelper.cpp" line="91"/> <location filename="../core/qthelper.cpp" line="227"/> <source>S</source> <translation>S</translation> </message> <message> <location filename="../core/qthelper.cpp" line="92"/> <location filename="../core/qthelper.cpp" line="228"/> <source>E</source> <translation>L</translation> </message> <message> <location filename="../core/qthelper.cpp" line="92"/> <location filename="../core/qthelper.cpp" line="229"/> <source>W</source> <translation>O</translation> </message> <message> <location filename="../core/qthelper.cpp" line="640"/> <source>C</source> <translation>C</translation> </message> <message> <location filename="../core/qthelper.cpp" line="643"/> <source>F</source> <translation>F</translation> </message> <message> <location filename="../core/save-html.c" line="469"/> <location filename="../core/save-html.c" line="553"/> <location filename="../core/worldmap-save.c" line="111"/> <source>Can&apos;t open file %s</source> <translation>Não é possivel abrir o arquivo %s</translation> </message> <message> <location filename="../core/save-html.c" line="488"/> <source>Number</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="489"/> <source>Date</source> <translation>Data</translation> </message> <message> <location filename="../core/save-html.c" line="490"/> <source>Time</source> <translation>Horário</translation> </message> <message> <location filename="../core/save-html.c" line="491"/> <source>Location</source> <translation>Local</translation> </message> <message> <location filename="../core/save-html.c" line="492"/> <source>Air temp.</source> <translation>Temperatura do ar</translation> </message> <message> <location filename="../core/save-html.c" line="493"/> <source>Water temp.</source> <translation>Temperatura da água</translation> </message> <message> <location filename="../core/save-html.c" line="494"/> <source>Dives</source> <translation>Mergulhos</translation> </message> <message> <location filename="../core/save-html.c" line="495"/> <source>Expand all</source> <translation>Expandir todos</translation> </message> <message> <location filename="../core/save-html.c" line="496"/> <source>Collapse all</source> <translation>Esconder todos</translation> </message> <message> <location filename="../core/save-html.c" line="497"/> <source>Trips</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="498"/> <source>Statistics</source> <translation>Estatísticas</translation> </message> <message> <location filename="../core/save-html.c" line="499"/> <source>Advanced search</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="502"/> <source>Rating</source> <translation>Classificação</translation> </message> <message> <location filename="../core/save-html.c" line="503"/> <source>Visibility</source> <translation>Visibilidade</translation> </message> <message> <location filename="../core/save-html.c" line="504"/> <source>Duration</source> <translation>Duração</translation> </message> <message> <location filename="../core/save-html.c" line="505"/> <source>Divemaster</source> <translation>Divemaster</translation> </message> <message> <location filename="../core/save-html.c" line="506"/> <source>Buddy</source> <translation>Parceiro</translation> </message> <message> <location filename="../core/save-html.c" line="507"/> <source>Suit</source> <translation>Roupa</translation> </message> <message> <location filename="../core/save-html.c" line="508"/> <source>Tags</source> <translation>Rótulos</translation> </message> <message> <location filename="../core/save-html.c" line="509"/> <location filename="../smtk-import/smartrak.c" line="251"/> <location filename="../smtk-import/smartrak.c" line="321"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../core/save-html.c" line="510"/> <source>Show more details</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="513"/> <source>Yearly statistics</source> <translation>Estatisticas Anuais</translation> </message> <message> <location filename="../core/save-html.c" line="514"/> <source>Year</source> <translation>Ano</translation> </message> <message> <location filename="../core/save-html.c" line="515"/> <source>Total time</source> <translation>Tempo total</translation> </message> <message> <location filename="../core/save-html.c" line="516"/> <source>Average time</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="517"/> <source>Shortest time</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="518"/> <source>Longest time</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="519"/> <source>Average depth</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="520"/> <source>Min. depth</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="521"/> <source>Max. depth</source> <translation>Profundidade máxima</translation> </message> <message> <location filename="../core/save-html.c" line="522"/> <source>Average SAC</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="523"/> <source>Min. SAC</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="524"/> <source>Max. SAC</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="525"/> <source>Average temp.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="526"/> <source>Min. temp.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="527"/> <source>Max. temp.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="528"/> <source>Back to list</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="531"/> <source>Dive No.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="532"/> <source>Dive profile</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="533"/> <source>Dive information</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="534"/> <source>Dive equipment</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="535"/> <location filename="../core/save-html.c" line="542"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location filename="../core/save-html.c" line="536"/> <source>Size</source> <translation>Tamanho</translation> </message> <message> <location filename="../core/save-html.c" line="537"/> <source>Work pressure</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="538"/> <source>Start pressure</source> <translation>Pressão inicial</translation> </message> <message> <location filename="../core/save-html.c" line="539"/> <source>End pressure</source> <translation>Pressão final</translation> </message> <message> <location filename="../core/save-html.c" line="540"/> <source>Gas</source> <translation>Gás</translation> </message> <message> <location filename="../core/save-html.c" line="541"/> <source>Weight</source> <translation>Peso</translation> </message> <message> <location filename="../core/save-html.c" line="543"/> <source>Events</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="544"/> <source>Name</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="545"/> <source>Value</source> <translation type="unfinished"/> </message> <message> <location filename="../core/save-html.c" line="546"/> <source>Coordinates</source> <translation>Coordenadas</translation> </message> <message> <location filename="../core/save-html.c" line="547"/> <source>Dive status</source> <translation type="unfinished"/> </message> <message> <location filename="../core/statistics.c" line="242"/> <source>more than %d days</source> <translation>mais que %d dias</translation> </message> <message> <location filename="../core/statistics.c" line="249"/> <source>%dd %dh %dmin</source> <translation>%dd %dh %dmin</translation> </message> <message> <location filename="../core/statistics.c" line="252"/> <source>%dmin %dsecs</source> <translation type="unfinished"/> </message> <message> <location filename="../core/statistics.c" line="254"/> <source>%dh %dmin</source> <translation>%dh %dmin</translation> </message> <message> <location filename="../core/statistics.c" line="266"/> <source>for dives #</source> <translation>para mergulhos nº</translation> </message> <message> <location filename="../core/statistics.c" line="272"/> <source>for selected dives</source> <translation>para mergulhos selecionados</translation> </message> <message> <location filename="../core/statistics.c" line="307"/> <source>for dive #%d</source> <translation>para mergulho nº %d</translation> </message> <message> <location filename="../core/statistics.c" line="309"/> <source>for selected dive</source> <translation>para mergulho selecionado</translation> </message> <message> <location filename="../core/statistics.c" line="311"/> <source>for all dives</source> <translation>para todos os mergulhos</translation> </message> <message> <location filename="../core/statistics.c" line="313"/> <source>(no dives)</source> <translation>(nenhum mergulho)</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Sun</source> <translation>Dom</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Mon</source> <translation>Seg</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Tue</source> <translation>Ter</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Wed</source> <translation>Qua</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Thu</source> <translation>Qui</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Fri</source> <translation>Sex</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="125"/> <source>Sat</source> <translation>Sáb</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>Jan</source> <translation>Jan</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>Feb</source> <translation>Fev</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>Mar</source> <translation>Mar</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>Apr</source> <translation>Abr</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>May</source> <translation>Mai</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="134"/> <source>Jun</source> <translation>Jun</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Jul</source> <translation>Jul</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Aug</source> <translation>Ago</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Sep</source> <translation>Set</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Oct</source> <translation>Out</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Nov</source> <translation>Nov</translation> </message> <message> <location filename="../core/subsurfacestartup.c" line="135"/> <source>Dec</source> <translation>Dez</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="27"/> <source>Uemis Zurich: the file system is almost full. Disconnect/reconnect the dive computer and click &apos;Retry&apos;</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="28"/> <source>Uemis Zurich: the file system is full. Disconnect/reconnect the dive computer and click Retry</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="29"/> <source>Short write to req.txt file. Is the Uemis Zurich plugged in correctly?</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="30"/> <source>No dives to download.</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="447"/> <source>%s %s</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="467"/> <source>data</source> <translation>dados</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="495"/> <source>divelog #</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="497"/> <source>divespot #</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="499"/> <source>details for #</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="702"/> <source>wetsuit</source> <translation>roupa úmida</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="702"/> <source>semidry</source> <translation>semi-seca</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="702"/> <source>drysuit</source> <translation>roupa seca</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>shorty</source> <translation>short</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>vest</source> <translation>casaco</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>long john</source> <translation>macacão</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>jacket</source> <translation>colete</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>full suit</source> <translation>roupa completa</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="703"/> <source>2 pcs full suit</source> <translation>Roupa completa 2 peças</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="704"/> <source>membrane</source> <translation>membrana</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="1234"/> <source>Initialise communication</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis-downloader.c" line="1237"/> <source>Uemis init failed</source> <translation>Falha ao iniciar Uemis</translation> </message> <message> <location filename="../core/uemis-downloader.c" line="1249"/> <source>Start download</source> <translation>Iniciar recebimento</translation> </message> <message> <location filename="../core/uemis.c" line="201"/> <source>Safety stop violation</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="203"/> <source>Speed alarm</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="206"/> <source>Speed warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="208"/> <source>pO₂ green warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="211"/> <source>pO₂ ascend warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="213"/> <source>pO₂ ascend alarm</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="217"/> <source>Tank pressure info</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="219"/> <source>RGT warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="221"/> <source>RGT alert</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="223"/> <source>Tank change suggested</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="225"/> <source>Depth limit exceeded</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="227"/> <source>Max deco time warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="229"/> <source>Dive time info</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="231"/> <source>Dive time alert</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="233"/> <source>Marker</source> <translation>Marcador</translation> </message> <message> <location filename="../core/uemis.c" line="235"/> <source>No tank data</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="237"/> <source>Low battery warning</source> <translation type="unfinished"/> </message> <message> <location filename="../core/uemis.c" line="239"/> <source>Low battery alert</source> <translation type="unfinished"/> </message> <message> <location filename="../core/worldmap-save.c" line="39"/> <source>Date:</source> <translation>Data:</translation> </message> <message> <location filename="../core/worldmap-save.c" line="41"/> <source>Time:</source> <translation>Tempo:</translation> </message> <message> <location filename="../core/worldmap-save.c" line="43"/> <source>Duration:</source> <translation>Duração:</translation> </message> <message> <location filename="../core/worldmap-save.c" line="44"/> <source>min</source> <translation>min</translation> </message> <message> <location filename="../core/worldmap-save.c" line="47"/> <source>Max. depth:</source> <translation type="unfinished"/> </message> <message> <location filename="../core/worldmap-save.c" line="50"/> <source>Air temp.:</source> <translation type="unfinished"/> </message> <message> <location filename="../core/worldmap-save.c" line="53"/> <source>Water temp.:</source> <translation type="unfinished"/> </message> <message> <location filename="../core/worldmap-save.c" line="55"/> <source>Location:</source> <translation>Localidade:</translation> </message> <message> <location filename="../core/worldmap-save.c" line="59"/> <source>Notes:</source> <translation>Notas:</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="247"/> <source>Built</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="247"/> <source>Sank</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="247"/> <source>SankTime</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="248"/> <source>Reason</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="248"/> <source>Nationality</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="248"/> <source>Shipyard</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="249"/> <source>ShipType</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="249"/> <source>Length</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="249"/> <source>Beam</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="250"/> <source>Draught</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="250"/> <source>Displacement</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="250"/> <source>Cargo</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="263"/> <source>Wreck Data</source> <translation type="unfinished"/> </message> <message> <location filename="../smtk-import/smartrak.c" line="320"/> <source>Altitude</source> <translation>Altitude</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="320"/> <source>Depth</source> <translation>Profundidade</translation> </message> </context> <context> <name>main</name> <message> <location filename="../mobile-widgets/qml/main.qml" line="13"/> <source>Subsurface-mobile</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="103"/> <source>Subsurface</source> <translation>Subsurface</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="110"/> <source>Dive list</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="125"/> <source>Cloud credentials</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="139"/> <source>Manage dives</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="141"/> <source>Add dive manually</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="149"/> <source>Manual sync with cloud</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="167"/> <source>Offline mode</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="167"/> <source>Enable auto cloud sync</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="187"/> <source>GPS</source> <translation>GPS</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="190"/> <source>GPS-tag dives</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="197"/> <source>Upload GPS data</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="204"/> <source>Download GPS data</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="211"/> <source>Show GPS fixes</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="220"/> <source>Clear GPS cache</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="226"/> <source>Preferences</source> <translation>Preferências</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="237"/> <source>Developer</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="239"/> <source>App log</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="246"/> <source>Theme information</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="253"/> <source>User manual</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="259"/> <source>About</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="304"/> <source>Run location service</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="304"/> <source>No GPS source available</source> <translation type="unfinished"/> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="316"/> <source>Actions</source> <translation type="unfinished"/> </message> </context> <context> <name>plannerDetails</name> <message> <location filename="../desktop-widgets/plannerDetails.ui" line="14"/> <location filename="../build/ui_plannerDetails.h" line="90"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/plannerDetails.ui" line="43"/> <location filename="../build/ui_plannerDetails.h" line="91"/> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Dive plan details&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Detalhes do planejamento&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation> </message> <message> <location filename="../desktop-widgets/plannerDetails.ui" line="59"/> <location filename="../build/ui_plannerDetails.h" line="92"/> <source>Print</source> <translation>Imprimir</translation> </message> <message> <location filename="../desktop-widgets/plannerDetails.ui" line="92"/> <location filename="../build/ui_plannerDetails.h" line="93"/> <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; p, li { white-space: pre-wrap; } &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Courier'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;.Curier New&apos;;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <translation>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; p, li { white-space: pre-wrap; } &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Courier&apos;; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:&apos;.Curier New&apos;;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation> </message> </context> <context> <name>plannerSettingsWidget</name> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="14"/> <location filename="../build/ui_plannerSettings.h" line="420"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="74"/> <location filename="../build/ui_plannerSettings.h" line="421"/> <source>Rates</source> <translation>Estrelas:</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="95"/> <location filename="../build/ui_plannerSettings.h" line="422"/> <source>Ascent</source> <translation>Subida</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="104"/> <location filename="../build/ui_plannerSettings.h" line="423"/> <source>below 75% avg. depth</source> <translation>Abaixo de 75% profundidade média</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="111"/> <location filename="../desktop-widgets/plannerSettings.ui" line="128"/> <location filename="../desktop-widgets/plannerSettings.ui" line="145"/> <location filename="../desktop-widgets/plannerSettings.ui" line="162"/> <location filename="../desktop-widgets/plannerSettings.ui" line="206"/> <location filename="../build/ui_plannerSettings.h" line="424"/> <location filename="../build/ui_plannerSettings.h" line="426"/> <location filename="../build/ui_plannerSettings.h" line="428"/> <location filename="../build/ui_plannerSettings.h" line="430"/> <location filename="../build/ui_plannerSettings.h" line="432"/> <source>m/min</source> <translation>m/min</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="121"/> <location filename="../build/ui_plannerSettings.h" line="425"/> <source>75% to 50% avg. depth</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="138"/> <location filename="../build/ui_plannerSettings.h" line="427"/> <source>50% avg. depth to 6m</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="155"/> <location filename="../build/ui_plannerSettings.h" line="429"/> <source>6m to surface</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="175"/> <location filename="../build/ui_plannerSettings.h" line="431"/> <source>Descent</source> <translation>Decida</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="187"/> <location filename="../build/ui_plannerSettings.h" line="433"/> <source>surface to the bottom</source> <translation>Superficie até o fundo</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="240"/> <location filename="../build/ui_plannerSettings.h" line="434"/> <source>Planning</source> <translation>Planejando</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="261"/> <source>VPM-B deco</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="268"/> <source>Bühlmann deco</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="278"/> <location filename="../build/ui_plannerSettings.h" line="445"/> <source>Reserve gas</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="288"/> <location filename="../desktop-widgets/plannerSettings.ui" line="549"/> <location filename="../desktop-widgets/plannerSettings.ui" line="578"/> <location filename="../build/ui_plannerSettings.h" line="446"/> <location filename="../build/ui_plannerSettings.h" line="459"/> <location filename="../build/ui_plannerSettings.h" line="461"/> <source>bar</source> <translation>bar</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="307"/> <location filename="../desktop-widgets/plannerSettings.ui" line="416"/> <location filename="../build/ui_plannerSettings.h" line="437"/> <location filename="../build/ui_plannerSettings.h" line="440"/> <source>%</source> <translation>%</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="320"/> <location filename="../build/ui_plannerSettings.h" line="449"/> <source>Postpone gas change if a stop is not required</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="323"/> <location filename="../build/ui_plannerSettings.h" line="451"/> <source>Only switch at required stops</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="343"/> <location filename="../build/ui_plannerSettings.h" line="442"/> <source>GF low</source> <translation>GF baixo</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="353"/> <location filename="../build/ui_plannerSettings.h" line="436"/> <source>Plan backgas breaks</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="360"/> <location filename="../build/ui_plannerSettings.h" line="435"/> <source>GF high</source> <translation>GF alto</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="370"/> <location filename="../build/ui_plannerSettings.h" line="453"/> <source>min</source> <translation>min</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="389"/> <location filename="../build/ui_plannerSettings.h" line="438"/> <source>Last stop at 6m</source> <translation>Ultima parada em 6m</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="396"/> <source>Maximize bottom time allowed by gas and no decompression limits</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="399"/> <location filename="../build/ui_plannerSettings.h" line="443"/> <source>Recreational mode</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="429"/> <location filename="../build/ui_plannerSettings.h" line="441"/> <source>Drop to first depth</source> <translation>Descer até o primeiro ponto</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="436"/> <location filename="../build/ui_plannerSettings.h" line="452"/> <source>Min. switch duration</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="459"/> <location filename="../build/ui_plannerSettings.h" line="444"/> <source>Safety stop</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="495"/> <source>Conservatism level</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="515"/> <location filename="../build/ui_plannerSettings.h" line="455"/> <source>Gas options</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="565"/> <location filename="../desktop-widgets/plannerSettings.ui" line="698"/> <location filename="../build/ui_plannerSettings.h" line="462"/> <location filename="../build/ui_plannerSettings.h" line="463"/> <source>ℓ/min</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="594"/> <source>m</source> <translation>m</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="606"/> <source>Used to calculate best mix. Select best mix depth in &apos;Available gases&apos; table by entering gas depth, followed by &quot;B&quot; (best trimix mix) or &quot;BN&quot; (best nitrox mix)</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="613"/> <location filename="../build/ui_plannerSettings.h" line="456"/> <source>Bottom SAC</source> <translation>SAC no fundo</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="620"/> <location filename="../build/ui_plannerSettings.h" line="458"/> <source>Bottom pO₂</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="627"/> <source>Best mix END</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="634"/> <location filename="../build/ui_plannerSettings.h" line="464"/> <source>Notes</source> <translation>Notas</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="655"/> <location filename="../build/ui_plannerSettings.h" line="466"/> <source>In dive plan, show runtime (absolute time) of stops</source> <translation>No planejador, mostrar tempo de mergulho absoluto das paradas</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="658"/> <location filename="../build/ui_plannerSettings.h" line="468"/> <source>Display runtime</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="668"/> <location filename="../build/ui_plannerSettings.h" line="470"/> <source>In dive plan, show duration (relative time) of stops</source> <translation>No planejador mostrar tempo relativo das paradas</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="671"/> <location filename="../build/ui_plannerSettings.h" line="472"/> <source>Display segment duration</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="678"/> <location filename="../build/ui_plannerSettings.h" line="474"/> <source>In diveplan, list transitions or treat them as implicit</source> <translation>No planejador, listar transições ou tratar elas de forma implicita</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="681"/> <location filename="../build/ui_plannerSettings.h" line="476"/> <source>Display transitions in deco</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="688"/> <location filename="../build/ui_plannerSettings.h" line="477"/> <source>Verbatim dive plan</source> <translation type="unfinished"/> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="711"/> <location filename="../build/ui_plannerSettings.h" line="460"/> <source>Deco pO₂</source> <translation>Deco pO₂</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="718"/> <location filename="../build/ui_plannerSettings.h" line="457"/> <source>Deco SAC</source> <translation>Deco SAC</translation> </message> </context> </TS><|fim▁end|>
<location filename="../desktop-widgets/divelogexportdialog.ui" line="157"/> <location filename="../build/ui_divelogexportdialog.h" line="355"/>
<|file_name|>about_test.py<|end_file_name|><|fim▁begin|>def test_imprint(app, client): app.config["SKYLINES_IMPRINT"] = u"foobar" res = client.get("/imprint") assert res.status_code == 200 assert res.json == {u"content": u"foobar"} def test_team(client): res = client.get("/team") assert res.status_code == 200 content = res.json["content"] assert "## Developers" in content assert "* Tobias Bieniek (<[email protected]> // maintainer)\n" in content assert "## Developers" in content def test_license(client): res = client.get("/license")<|fim▁hole|> assert res.status_code == 200 content = res.json["content"] assert "GNU AFFERO GENERAL PUBLIC LICENSE" in content<|fim▁end|>
<|file_name|>log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <[email protected]>, # Benjamin Bean <[email protected]> # # This file is part of Tuxemon. # # Tuxemon is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Tuxemon is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Tuxemon. If not, see <http://www.gnu.org/licenses/>. # # Contributor(s): # # William Edwards <[email protected]> # # # core.components.log Logging module. #<|fim▁hole|>import logging from . import config as Config # read the configuration file config = Config.Config() loggers = {} # Set up logging if the configuration has it enabled if config.debug_logging == "1": for logger_name in config.loggers: # Enable logging logger = logging.getLogger(logger_name) logger.setLevel(int(config.debug_level)) log_hdlr = logging.StreamHandler(sys.stdout) log_hdlr.setLevel(logging.DEBUG) log_hdlr.setFormatter(logging.Formatter("%(asctime)s - %(name)s - " "%(levelname)s - %(message)s")) logger.addHandler(log_hdlr) loggers[logger_name] = logger<|fim▁end|>
# import sys
<|file_name|>myutil.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ This module put my utility functions """ __author__ = "Jiang Yu-Kuan <[email protected]>" __date__ = "2016/02/08 (initial version) ~ 2019/04/17 (last revision)" import re import os import sys #------------------------------------------------------------------------------ # File #------------------------------------------------------------------------------ def save_utf8_file(fn, lines): """Save string lines into an UTF8 text files. """ with open(fn, "w") as out_file: out_file.write("\n".join(lines).encode("utf-8")) def main_basename(path): r"""Return a main name of a basename of a given file path. Example ------- >>> main_basename('c:\code\langconv\MsgID.h') 'MsgID.h' """ base = os.path.basename(path) base_main, _base_ext = os.path.splitext(base) return base_main #------------------------------------------------------------------------------ # Math #------------------------------------------------------------------------------ def is_numeric(str): try: _offset = int(eval(str)) except: return False return True #------------------------------------------------------------------------------ # String #------------------------------------------------------------------------------ def replace_chars(text, replaced_pairs='', deleted_chars=''): """Return a char replaced text. Arguments --------- text -- the text replaced_pairs -- the replaced chars Example ------- >>> replaced = [('a','b'), ('c','d')] >>> removed = 'e' >>> replace_chars('abcde', replaced, removed) 'bbdd' """ for old, new in replaced_pairs: text = text.replace(old, new) for ch in deleted_chars: text = text.replace(ch, '') return text def camel_case(string): """Return camel case string from a space-separated string. Example ------- >>> camel_case('good job') 'GoodJob' """ return ''.join(w.capitalize() for w in string.split()) def replace_punctuations(text): """Replace punctuation characters with abbreviations for a string. """ punctuations = [ ('?', 'Q'), # Q: question mark ('.', 'P'), # P: period; full stop ('!', 'E'), # E: exclamation mark ("'", 'SQ'), # SQ: single quotation mark; single quote ('"', 'DQ'), # DQ: double quotation mark; double quotes ('(', 'LP'), # LP: left parenthese (')', 'RP'), # RP: right parenthese (':', 'Cn'), # Cn: colon (',', 'Ca'), # Ca: comma (';', 'S'), # S: semicolon ] deleted = '+-*/^=%$#@|\\<>{}[]' return replace_chars(text, punctuations, deleted) def remain_alnum(text): """Remain digits and English letters of a string. """ return ''.join(c for c in text if c.isalnum() and ord(' ') <= ord(c) <= ord('z')) #------------------------------------------------------------------------------ # For code generation #------------------------------------------------------------------------------ def c_identifier(text): """Convert input text into an legal identifier in C. Example ------- >>> c_identifier("Hello World") 'HelloWorld' >>> c_identifier("Anti-Shake") 'Antishake' """ if ' ' in text: text = camel_case(text) text = re.sub(r'\+\d+', lambda x: x.group().replace('+', 'P'), text) text = re.sub(r'\-\d+', lambda x: x.group().replace('-', 'N'), text) text = replace_punctuations(text) return remain_alnum(text) def wrap_header_guard(lines, h_fn): """Wrap a C header guard for a given line list. """ def underscore(txt): """Return an under_scores text from a CamelCase text. This function will leave a CamelCase text unchanged. """ s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', txt) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() h_fn_sig = '%s_H_' % underscore(main_basename(h_fn)).upper() begin = ['#ifndef %s' % h_fn_sig] begin += ['#define %s' % h_fn_sig, '', ''] end = ['', '', '#endif // %s' % h_fn_sig, ''] return begin + lines + end <|fim▁hole|> """ prefix = ['%s Generated by the %s v%s' % (comment_mark, software, version)] prefix += ['%s !author: %s' % (comment_mark, author)] prefix += ['%s !trail: %s %s' % (comment_mark, os.path.basename(sys.argv[0]), ' '.join(sys.argv[1:]))] return prefix + lines<|fim▁end|>
def prefix_info(lines, software, version, author, comment_mark='//'): """Prefix information to the given lines with given comment-mark.
<|file_name|>issue-8044.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license<|fim▁hole|> pub struct BTree<V> { pub node: TreeItem<V>, } pub enum TreeItem<V> { TreeLeaf { value: V }, } pub fn leaf<V>(value: V) -> TreeItem<V> { TreeItem::TreeLeaf { value: value } } fn main() { BTree::<int> { node: leaf(1i) }; }<|fim▁end|>
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms.