text:
require Pathname.new(File.dirname(__FILE__)).join('wurflhandset')
require 'rubygems'
require 'nokogiri'

# Modified to use nokogiri. GREATLY increased speed.
# $Id: wurflloader.rb,v 1.1 2003/11/23 12:26:05 zevblut Exp $
# Authors: Zev Blut (zb@ubit.com)
# Copyright (c) 2003, Ubiquitous Business Technology (http://ubit.com)
# 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 the WURFL 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 THE COPYRIGHT
# OWNER OR CONTRIBUTORS 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.

class WurflLoader
  def initialize
    @handsets = Hash::new
    @fallbacks = Hash::new
  end

  def load_wurfl(wurflfile)
    file = File.new(wurflfile)
    doc = Nokogiri::XML::Document.parse file

    # read counter
    rcount = 0

    # iterate over all of the devices in the file
    doc.xpath("wurfl/devices/device").each do |element|

      rcount += 1
      hands = nil # the reference to the current handset
      if element.attributes["id"].to_s == "generic"
        # setup the generic Handset
        element.attributes["user_agent"] = "generic"
        if @handsets.key?("generic") then
          hands = @handsets["generic"]
          puts "Updating the generic handset at count #{rcount}" if @verbose
        else
          # the generic handset has not been created.  Make it
          hands = WurflHandset::new "generic","generic"
          @handsets["generic"] = hands
          @fallbacks["generic"] = Array::new
          puts "Made the generic handset at count #{rcount}" if @verbose
        end

      else
        # Setup an actual handset

        # check if handset already exists.
        wurflid = element.attributes["id"].to_s
        if @handsets.key?(wurflid)
          # Must have been created by someone who named it as a fallback earlier.
          hands = @handsets[wurflid]
        else
          hands = WurflHandset::new "",""
        end
        hands.wurfl_id = wurflid
        hands.user_agent = element.attributes["user_agent"].to_s
        hands.user_agent = 'generic' if hands.user_agent.empty?

        # get the fallback and copy it's values into this handset's hashtable
        fallb = element.attributes["fall_back"].to_s

        # for tracking of who has fallbacks
        if !@fallbacks.key?(fallb)
          @fallbacks[fallb] = Array::new
        end
        @fallbacks[fallb]<< hands.user_agent

        # Now set the handset to the proper fallback reference
        if !@handsets.key?(fallb)
          # We have a fallback that does not exist yet, create the reference.
          @handsets[fallb] = WurflHandset::new "",""
        end
        hands.fallback = @handsets[fallb]
      end

      # now copy this handset's specific capabilities into it's hashtable
      element.xpath("./*/capability").each do |el2|
        hands[el2.attributes["name"].to_s] = el2.attributes["value"].to_s
      end
      @handsets[hands.wurfl_id] = hands

      # Do some error checking
      if hands.wurfl_id.nil?
        puts "a handset with a nil id at #{rcount}"
      elsif hands.user_agent.nil?
        puts "a handset with a nil agent at #{rcount}"
      end
    end
    return @handsets, @fallbacks
  end

end


text:
<?php
/*
 * (c) Christian Gärtner <christiangaertner.film@googlemail.com>
 * This file is part of the Modulework Framework Tests
 * License: View distributed LICENSE file
 *
 *
 * This file is meant to be used in PHPUnit Tests
 */

use DaGardner\DaContainer\Container;
use DaGardner\DaContainer\InjectorDetection\SimpleDetector;

/**
* PHPUnit Test
*/
class ContainerTest extends PHPUnit_Framework_TestCase
{

    public function testGeneral()
    {
        $interfaces = class_implements(new Container);

        $this->assertTrue(in_array('ArrayAccess', $interfaces), 'DaContainer should support ArrayAccess');
        $this->assertTrue(in_array('DaGardner\DaContainer\ResolverInterface', $interfaces), 'DaContainer should implement the Resolver interface');
    }

    public function testClosureBinding()
    {
        $con = new Container;
        $con->bind('foo', function () {
            return 'Bar';
        });

        $this->assertEquals('Bar', $con->resolve('foo'));
    }

    public function testSingletonClosureBinding()
    {
        $con = new Container;
        $obj = new StdClass;

        $con->singleton('foo', function () use ($obj) {
            return $obj;
        });

        $this->assertEquals($obj, $con->resolve('foo'));
    }

    public function testNonBindedConreteResolving()
    {
        $con = new Container;

        $this->assertInstanceOf('ConcreteStub', $con->resolve('ConcreteStub'));
    }

    public function testSingeltonConrecteResolving()
    {
        $con = new Container;
        $con->singleton('ConcreteStub');

        $this->assertEquals($con->resolve('ConcreteStub'), $con->resolve('ConcreteStub'));
    }

    public function testContainerGettingPassedToResolver()
    {
        $con = new Container;
        $con->bind('foo', function($container) {
            return $container;
        });

        $c = $con->resolve('foo');

        $this->assertEquals($c, $con);
    }

    public function testParamertersGettingPassedToResolver()
    {
        $con = new Container;
        $con->bind('foo', function ($c, $p) {
            return $p;
        });

        $params = array('foo', 'bar', 'baz');

        $this->assertEquals($params, $con->resolve('foo', $params));
    }

    public function testInstance()
    {
        $con = new Container;

        $obj = new StdClass;
        $obj->name = 'Foo';

        $con->instance('foo', $obj);

        $this->assertEquals($obj, $con->resolve('foo'));

    }

    public function testResolverCallbacks()
    {
        $con = new Container;

        $con->onResolving(function($object) {
            $object->bar = 'baz';
        });

        $con->bind('foo', function()
        {
            return new stdClass;
        });

        $this->assertEquals('baz', $con->resolve('foo')->bar);
    }

    public function testDependenyInjectionConstructor()
    {
        $con = new Container;
        $con->bind('ConcreteStubInterface', 'ConcreteStub');

        $this->isInstanceOf('ConcreteDependsOn', $con->resolve('ConcreteDependsOn'));

    }

    /**
     * This test is skipped if we' re not an 5.4 or higher
     */
    public function testDependenyInjectionMethodDetection()
    {
        if (version_compare(PHP_VERSION, '5.4.0') <= 0) {
            return true;
        }

        $con = new Container;
        $con->enableInjecterDetection(array(
            'setString',
            '_CLASSES_' => array(
                'ConcreteInjectorMethods' => array(
                    'setArray'
                )
            )
        ));
        $obj = $con->resolve('ConcreteInjectorMethods');

        $this->assertTrue($obj->debug);
    }

    /**
     * This test is skipped if we' re not an 5.4 or higher
     * @requires PHP 5.4
     */
    public function testDisableDependenyInjectionMethodDetection()
    {
        if (version_compare(PHP_VERSION, '5.4.0') <= 0) {
            return true;
        }

        $con = new Container;
        $con->enableInjecterDetection(array(
            'setString',
            '_CLASSES_' => array(
                'ConcreteInjectorMethods' => array(
                    'setArray'
                )
            )
        ));
        $con->disableInjecterDetection();
        $obj = $con->resolve('ConcreteInjectorMethods');
        $this->assertNull($obj->debug);
    }

    public function testDeepResolving()
    {
        $con = new Container;
        $con->bind('foo', 'bar');
        $con->bind('bar', function() {
            return 'baz';
        });

        $this->assertEquals('baz', $con->resolve('foo'));
    }

    /**
     * @expectedException \DaGardner\DaContainer\Exceptions\ResolveException
     */
    public function testRemove()
    {
        $con = new Container;
        $con->bind('foo', function() {
            return 'foo';
        });

        $con->remove('foo');

        $con->resolve('foo');
    }

    public function testIsBound()
    {
        $con = new Container;
        $con->bind('foo', function() {
            return 'foo';
        });

        $this->assertTrue($con->isBound('foo'));
    }

    public function testArrayAccess()
    {
        $con = new Container;

        $con['foo'] = function() {
            return 'bar';
        };

        $this->assertTrue(isset($con['foo']));

        $this->assertEquals('bar', $con['foo']);

        unset($con['foo']);

        $this->assertFalse($con->isBound('foo'));
    }

    /**
     * @expectedException \DaGardner\DaContainer\Exceptions\ResolveException
     */
    public function testExceptionOnBuild()
    {
        $con = new Container;
        $con->build('foo');
    }

    /**
     * @expectedException \DaGardner\DaContainer\Exceptions\ResolveException
     */
    public function testExceptionOnBuildCustom()
    {
        $con = new Container;
        $con->build('PrivateConcreteStub');
    }

    /**
     * @expectedException \DaGardner\DaContainer\Exceptions\ResolveException
     */
    public function testDependsOnMissingClass()
    {
        $con = new Container;
        $con->resolve('DependsOnMissingClass');
    }

    public function testResolveParameter()
    {
        $con = new Container;

        $obj = $con->resolve('DependsOnStringDefault');
    }

    /**
     * @expectedException \DaGardner\DaContainer\Exceptions\ParameterResolveException
     */
    public function testResolveException()
    {
        $con = new Container;

        $obj = $con->resolve('DependsOnString');
    }

    public function testEventPriority()
    {
        $con = new Container;
        $con->onResolving(function($object) {
            $object->name = 'foo';
        }, -10);

        $con->onResolving(function($object) {
            $object->name = 'bar';
        }, 10);

        $con->bind('foo', function() {
            return new stdClass;
        });

        $this->assertEquals('bar', $con->resolve('foo')->name);
    }

    /**
     * DIMD => dependeny injection method detection
     * @expectedException RunTimeException
     */
    public function testPHPThreeThrowsExceptionWithDIMD()
    {
        $con = new Container;
        $con->enableInjecterDetection(array(), '5.3.0');
    }

    /**
     * This test is skipped if we' re not an 5.4 or higher
     * @requires PHP 5.4
     */
    public function testBuildDimdBlacklist()
    {
        if (version_compare(PHP_VERSION, '5.4.0') <= 0) {
            return true;
        }

        $con = new Container;

        $con->enableInjecterDetection();
        $con->disableInjecterDetection();

        $this->assertEquals(array(), $con->getDimdBlacklist());

        $con->enableInjecterDetection(array('foo'));
        $con->disableInjecterDetection();

        $this->assertEquals(array('foo'), $con->getDimdBlacklist());

        $con->enableInjecterDetection();

        $this->assertEquals(array('foo'), $con->getDimdBlacklist());
    }

    /**
     * This test is skipped if we' re not an 5.4 or higher
     * @requires PHP 5.4
     */
    public function testSetDetector()
    {
        $con = new Container;

        $con->setDetector(new MockDetector);
        $con->enableInjecterDetection();
        $this->expectOutputString('TESTING');

        $con->resolve('ConcreteInjectorMethods');

    }
}

class MockDetector implements DaGardner\DaContainer\InjectorDetection\DetectorInterface {

    private $silent = false;

    public function detect(ReflectionMethod $method)
    {
        if (!$this->silent) {
            echo "TESTING";
        }
        $this->silent = true;
        return false;
    }
}

class ConcreteStub implements ConcreteStubInterface {}

interface ConcreteStubInterface {}

class ConcreteDependsOn
{
    function __construct(ConcreteStubInterface $dep, $str = 'Foo') {}
}

class PrivateConcreteStub
{
    private function __construct() {}
}

class ConcreteInjectorMethods
{
    public $debug;
    function setStdClass(stdClass $class) {
        $this->debug = true;
    }

    public function setString($str = '')
    {
        $this->debug = false;
    }

    public function setArray(array $test)
    {
        $this->debug = false;
    }
}

class DependsOnMissingClass
{
    public function __construct(Foo $foo) {}
}

class DependsOnMissingClassDefault
{
    public function __construct(Foo $foo = null) {}
}

class DependsOnStringDefault
{
    public function __construct($str = "String") {}
}

class DependsOnString
{
    public function __construct($str) {}
}

redpajama_set_name: RedPajamaGithub


text:
*************************
Configure Mongo Databases
*************************

Here we will look into creating sample data bases in Mongo for integrating and querying with Data Cafe.

* Import the collections from the csv files

 mongoimport --db pathology --collection pathologyData --type csv --headerline --file pathology.csv

 mongoimport --db clinical --collection clinicalData --type csv --headerline --file clinical.csv

* Execute mongo commands.

 $ mongo

 > use pathology

 > db.pathologyData.find()

 > use clinical

 > db.clinicalData.find()


text:
package org.artifactory.schedule.aop.test;

import org.artifactory.api.repo.Async;

import java.util.concurrent.Future;

/**
 * This class is here only to simplify the async testing.
 *
 * @author Yossi Shaul
 */
public interface AsyncComponent {

    /**
     * @return Number of async invocations done on this component.
     */
    int asyncInvocationsCount();

    @Async
    Future<Integer> invokeAsync();

    /**
     * Sends a signal to the async method {@link AsyncComponent#invokeAsyncAndWaitForSignal()} to finish.
     */
    void signal();

    @Async
    void invokeAsyncAndWaitForSignal();

    @Async(delayUntilAfterCommit = true)
    void invokeAsyncDelayUntilAfterCommit();

    @Async(delayUntilAfterCommit = true, shared = true)
    void invokeAsyncShared();

}


text:
<?php

/*
 * Check writing on FS
 * Check DB
 * Install db
 * Install user
 *
 */

class InstallFixturesSetupController extends SetupController {

	protected static $route = 'setup_installfixtures';

	/**
	 * @param HTTPRequest $request The input HTTP request
	 * @return HTTPResponse The output HTTP response
	 * @see HTTPController::run()
	 */
	public function run(HTTPRequest $request) {

		$FORM_TOKEN	= new FormToken();
		$env		= array(
			'FORM_TOKEN'	=> $FORM_TOKEN,
			'allowContinue'	=> false,
		);

		if( $request->hasData('submitInstallFixtures') ) {

			try {
				$c = $t = 0;
				foreach( FixtureRepository::listAll() as $class ) {
					$t++;
					try {
						$class::loadFixtures();
						$c++;
					} catch( UserException $e ) {
						throw $e;
					} catch( Exception $e ) {
						throw $e;
// 						throw new UserException(t('errorLoadingFixture', DOMAIN_SETUP, $class), DOMAIN_SETUP, 0, $e);
					}
				}
				$env['allowContinue']	= true;
				$this->validateStep();
				if( $c ) {
					reportSuccess(t('successInstallFixtures', DOMAIN_SETUP, array('PROCESSED'=>$c, 'TOTAL'=>$t)));
				}

			} catch(UserException $e) {
				reportError($e);
			}
		}

		// At end
		$env['wasAlreadyDone']	= $this->isStepValidated();
		if( $env['wasAlreadyDone'] ) {
			reportWarning('fixturesAlreadyLoaded', DOMAIN_SETUP);
			$env['allowContinue']	= true;
		}

		return $this->renderHTML('setup/setup_installfixtures', $env);
	}

}


text:
var chai = require('chai')
  , Strategy = require('../lib/strategy');

describe('Strategy', function() {

  describe('failing a request with message string', function() {
    var strategy = new Strategy(function(token, done) {
      if (token == 'vF9dft4qmT') {
        return done(null, { id: '1234' }, { scope: 'read' });
      }
      return done(null, false, 'The access token expired');
    });

    describe('handling a request with wrong token', function() {
      var challenge;

      before(function(done) {
        chai.passport(strategy)
          .fail(function(c) {
            challenge = c;
            done();
          })
          .req(function(req) {
            req.headers.authorization = 'Bearer WRONG';
          })
          .authenticate();
      });

      it('should fail with challenge', function() {
        expect(challenge).to.be.a.number;
        expect(challenge).to.equal(401);
      });
    });
  });

  describe('failing a request with hash containing message', function() {
    var strategy = new Strategy(function(token, done) {
      if (token == 'vF9dft4qmT') {
        return done(null, { id: '1234' }, { scope: 'read' });
      }
      return done(null, false, { message: 'The access token expired' });
    });

    describe('handling a request with wrong token', function() {
      var challenge;

      before(function(done) {
        chai.passport(strategy)
          .fail(function(c) {
            challenge = c;
            done();
          })
          .req(function(req) {
            req.headers.authorization = 'Bearer WRONG';
          })
          .authenticate();
      });

      it('should fail with challenge', function() {
        expect(challenge).to.be.a.number;
        expect(challenge).to.equal(401);
      });
    });
  });

});


text:
import Ember from 'ember';
import { default as environment } from '../config/environment';

const {
  camelize
} = Ember.String;

let assertionCache;

function assertions() {
  if (!assertionCache) {
    const { modulePrefix } = environment;
    const entries = Ember.A(Object.keys(requirejs.entries));
    const pattern = new RegExp(`^${modulePrefix}/tests/assertions/[\\w-]+$`);

    assertionCache = entries.reduce(function(entries, entry) {
      if (entry.match(pattern)) {
        let splitEntry = entry.split('/');
        let fn = requirejs(entry)['default'];

        entry = splitEntry[splitEntry.length - 1];
        entry = camelize(entry);
        entries[entry] = fn;
      }

      return entries;
    }, {});
  }

  return assertionCache;
}

function assertionInjector(context) {
  let _assertions = assertions();

  Object.keys(_assertions).forEach(function(assertion) {
    window.QUnit.assert[assertion] = function() {
      let fn = _assertions[assertion];
      let args = Array.prototype.slice.call(arguments);

      if (context) {
        args.unshift(context);
      }

      return fn.apply(this, args);
    };
  });
}

function assertionCleanup() {
  let _assertions = assertions();

  Object.keys(_assertions).forEach(function(assertion) {
    delete window.QUnit.assert[assertions];
  });
}

export { assertionInjector, assertionCleanup };


text:
use go::{Group, Player, Stone};

use std::hash::Hash;
use std::collections::HashSet;

#[cfg(test)]
mod test;

/// The board trait
///
/// If something implements this, go can be played on it
pub trait Board: Sized + Eq + Hash + Clone {
    /// The Position the board uses
    type Position: Sized + Eq + Hash + Copy + Clone;

    /// Constructs a new empty board
    fn new() -> Self;

    /// Returns true if the position is on the board
    fn on_board(&self, position: &Self::Position) -> bool;

    /// Returns the stone at the given position
    fn at(&self, position: &Self::Position) -> Stone;

    /// Sets the stone at the given position
    fn set(&mut self, position: &Self::Position, stone: &Stone);

    /// Sets the requested amount of handicap stones
    fn set_handicap(&mut self, stones: u8);

    /// Returns all positions.
    fn positions(&self) -> Vec<Self::Position>;

    /// Returns the vector of stone next to the given position
    ///
    /// Does not only return occupied fields but also empty ones.
    fn neighbors(&self, position: &Self::Position) -> Vec<Self::Position>;

    /// Returns the vector of groups that have a liberty at the given position
    fn groups_with_liberty_at<'boardlt>(&'boardlt self,
                                        position: &Self::Position)
                                        -> Vec<Group<'boardlt, Self>> {
        if self.at(position) != Stone::Empty {
            return Vec::new();
        }

        let mut found_groups = Vec::<Group<Self>>::new();
        for pos in &self.neighbors(position) {
            if found_groups.iter().any(|g| g.positions.contains(pos)) {
                continue;
            }

            found_groups.push(Group::new(self, pos));
        }

        found_groups
    }

    /// Returns the set of stones that would be captured if the given player plays at
    /// the given position
    fn would_be_captured(&self,
                         player: &Player,
                         position: &Self::Position)
                         -> HashSet<Self::Position> {
        self.groups_with_liberty_at(position)
            .iter()
            .filter(|g| {
                g.stone().unwrap_or(Stone::Empty) != player.stone() && g.liberties().len() == 1
            })
            .flat_map(|g| g.positions.iter())
            .cloned()
            .collect()
    }

    /// Returns if a play here would be suicide
    ///
    /// Returns false if a play at position by player would:
    /// * kill something
    /// * connect own groups that have at least two remaining liberties
    ///
    /// If none of those match, returns true if a friendly neighboring group looses
    /// its last liberty. Note that it returns true if it is a suicidal move.
    fn would_be_suicide(&self, position: &Self::Position, player: &Player) -> bool {
        //  OOOO   consider X to play in the middle
        // .X.XO   the left X has still a remaining liberty
        //  OOOO   => no group of X can die
        let mut friendly_looses_last_liberty = false;

        for group in self.groups_with_liberty_at(position).iter() {
            let liberties = group.liberties();
            let group_owner = group.stone().unwrap_or(Stone::Empty);

            if liberties.len() == 1 && group_owner == player.other().stone() {
                return false; //we kill something
            }

            if liberties.len() == 1 && group_owner == player.stone() {
                friendly_looses_last_liberty = true;
            }

            if liberties.len() > 1 && group_owner == player.stone() {
                return false; //a friendly stone has a remaining liberty
            }
        }

        friendly_looses_last_liberty
    }

    /// Fills all empty intersections that neighbor a stone with the given color by
    /// stones of that color. Repeats until nothing changes.
    fn erode(&mut self, stone: Stone) {
        let mut change = true;
        let positions = self.positions();

        while change {
            change = false;

            let empty_positions: Vec<_> = positions.iter()
                .filter(|pos| self.at(pos) == Stone::Empty)
                .collect();

            for empty_position in empty_positions {
                let any_set = self.neighbors(empty_position)
                    .iter()
                    .any(|pos| self.at(pos) == stone);

                if any_set {
                    self.set(empty_position, &stone);
                    change = true;
                }
            }
        }
    }

    fn area_scoring(&self) -> (usize, usize) {
        let mut white_board = self.clone();
        let mut black_board = self.clone();

        white_board.erode(Stone::White);
        black_board.erode(Stone::Black);

        // A position is either:
        // + played by me (me_board = me, other_board = me),
        // + my territory (me_board = me, other_board = empty),
        // ~ seki (me_board = me, other_board = other),
        // ~ not mine (me_board != me).

        let white_score = self.positions()
            .iter()
            .filter(|pos| {
                white_board.at(pos) == Stone::White || black_board.at(pos) != Stone::Black
            })
            .count();

        let black_score = self.positions()
            .iter()
            .filter(|pos| {
                black_board.at(pos) == Stone::Black || white_board.at(pos) != Stone::White
            })
            .count();

        (black_score, white_score)
    }
}


text:
/*
 * Maker note stub table to avoid linking in maker note modules.
 */

#include <stdlib.h>

#include "makers.h"

struct makerfun makers[] = {
	{ 0, "unknown", NULL, NULL },		/* default value */
	{ EXIF_MKR_UNKNOWN, "unknown", NULL, NULL },
};


text:
from __future__ import print_function

import fileinput
import os
import shutil
import subprocess

import click

def _get_version():
    with open('flexget/_version.py') as f:
        g = globals()
        l = {}
        exec(f.read(), g, l)  # pylint: disable=W0122
    if not l['__version__']:
        raise click.ClickException('Could not find __version__ from flexget/_version.py')
    return l['__version__']

@click.group()
def cli():
    pass

@cli.command()
def version():
    """Prints the version number of the source"""
    click.echo(_get_version())

@cli.command()
@click.argument('bump_type', type=click.Choice(['dev', 'release']))
def bump_version(bump_type):
    """Bumps version to the next release, or development version."""
    cur_ver = _get_version()
    click.echo('current version: %s' % cur_ver)
    ver_split = cur_ver.split('.')
    if 'dev' in ver_split[-1]:
        if bump_type == 'dev':
            # If this is already a development version, increment the dev count by 1
            ver_split[-1] = 'dev%d' % (int(ver_split[-1].strip('dev') or 0) + 1)
        else:
            # Just strip off dev tag for next release version
            ver_split = ver_split[:-1]
    else:
        # Increment the revision number by one
        if len(ver_split) == 2:
            # We don't have a revision number, assume 0
            ver_split.append('1')
        else:
            if 'b' in ver_split[2]:
                # beta version
                minor, beta = ver_split[-1].split('b')
                ver_split[-1] = '%sb%s' % (minor, int(beta) + 1)
            else:
                ver_split[-1] = str(int(ver_split[-1]) + 1)
        if bump_type == 'dev':
            ver_split.append('dev')
    new_version = '.'.join(ver_split)
    for line in fileinput.FileInput('flexget/_version.py', inplace=1):
        if line.startswith('__version__ ='):
            line = "__version__ = '%s'\n" % new_version
        print(line, end='')
    click.echo('new version: %s' % new_version)

@cli.command()
def build_webui():
    """Build webui for release packaging"""
    cwd = os.path.join('flexget', 'ui')

    # Cleanup previous builds
    click.echo('cleaning previous builds')
    for folder in ['bower_components' 'node_modules']:
        folder = os.path.join(cwd, folder)
        if os.path.exists(folder):
            click.echo('Deleting recursively {}'.format(folder))
            shutil.rmtree(folder)

    # Install npm packages
    click.echo('running `npm install`')
    subprocess.check_call('npm install', cwd=cwd, shell=True)

    # Build the ui
    click.echo('running `bower install`')
    subprocess.check_call('bower install -p', cwd=cwd, shell=True)

    # Build the ui
    click.echo('running `gulp buildapp`')
    subprocess.check_call('gulp buildapp', cwd=cwd, shell=True)

if __name__ == '__main__':
    cli()


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Credits - 68KB User Guide</title>
		<link href="../css/style.css" rel="stylesheet" type="text/css" media="all" />

		<meta http-equiv='expires' content='-1' />
		<meta http-equiv='pragma' content='no-cache' />
		<meta name='robots' content='all' />

							Table of Contents

							Close

User Guide v1.0.0 RC3

						<form method="get" action="http://www.google.com/search">
							<input type="hidden" name="as_sitesearch" id="as_sitesearch" value="68kb.com/user_guide/" /><input id="search" type="text" size="31" maxlength="255" name="s" value="Search the user guide" /> <input type="submit" class="submit" name="sa" value="Go" />
						</form>

					68KB Home  →
					User Guide Home   →
					Credits

Credits

CodeIgniter - Codeigniter is an excellent php framework that iClassEngine v5 is built upon. I also want to thank them for the inspiration of this user guide.

SixOneFive Design for some of the images used in this user guide and our Deepsea template.

Icons by IconDrawer & FamFam.

jQuery with the following plugins - jQuery UI, DataTables, ToolTips, and Scroll To Top

					© 2009 68KB - All Rights Reserved.

					A division of 68 Designs, LLC

					Back to Top