bee_python 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/README +1 -1
  3. data/lib/bee_task_python.rb +32 -10
  4. data/python.yml +12 -3
  5. metadata +39 -58
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7bb9e26f6b4cbe70cdcf5606e0c5786f0bd25856
4
+ data.tar.gz: fa9f05a6340b9dc60c08a686437ca1134c46d014
5
+ SHA512:
6
+ metadata.gz: 21d76bc39e57a3e5d40a6b0963a26d058ef5e9c2aae618734386d8aabc2aabb4a716baf4712f598cf075a3cc0bb5f9c55e4d2135fcf8ea72972d74bdb3826a68
7
+ data.tar.gz: a9a82265c5c79f3741717cf6b955fde6528394f3596ab7c6d20c56d0635b182fcf7f2338d94bd743f4d049b2861c26ff9d54a2226647966a6ce9ecff9b63a0ab
data/README CHANGED
@@ -20,4 +20,4 @@ or go to URL http://www.apache.org/licenses/LICENSE-2.0).
20
20
 
21
21
  = Copyright
22
22
 
23
- Bee_python version 0.2.1 (C) Michel Casabianca - 2008-2010
23
+ Bee_python version 0.2.2 (C) Michel Casabianca - 2008-2010
@@ -1,4 +1,4 @@
1
- # Copyright 2006-2010 Michel Casabianca <michel.casabianca@gmail.com>
1
+ # Copyright 2006-2010 Michel Casabianca <michel.casabianca@gmail.com>
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -50,19 +50,41 @@ module Bee
50
50
  end
51
51
  end
52
52
 
53
- # Run a given Python source file. Parameter is the source file to run.
54
- # Source file must be an existing readable file.
53
+ # Run a given Python source file. Parameter is the source file to run
54
+ # (source file must be an existing readable file) or the following ones:
55
+ #
56
+ # - source: The source file to run.
57
+ # - args: the command line arguments to pass to the scripts.
58
+ # - lenient: If true, will not fail if return value if the process
59
+ # is different from 0 (which is the default).
55
60
  #
56
61
  # Example
57
62
  #
58
63
  # - python.python: "my_script.py"
59
- def python(source)
60
- error "python.python parameter is a String" unless
61
- source.kind_of?(String)
62
- error "python.python parameter must be an existing file" unless
63
- File.exists?(source) and File.readable?(source)
64
- ok = system("python #{source}")
65
- error "Error running Python source file '#{source}'" unless ok
64
+ # - python.python:
65
+ # source: "my_script.py"
66
+ # args: ["foo", "bar"]
67
+ # lenient: true
68
+ def python(params)
69
+ lenient = false
70
+ if params.kind_of?(String)
71
+ error "python.python parameter must be an existing file" unless
72
+ File.exists?(params) and File.readable?(params)
73
+ ok = system("python #{params}")
74
+ else
75
+ params_desc = {
76
+ :source => { :mandatory => true, :type => :string },
77
+ :args => { :mandatory => false, :type => :string_or_array },
78
+ :lenient => { :mandatory => false, :type => :boolean,
79
+ :default => false }
80
+ }
81
+ check_parameters(params, params_desc)
82
+ source = params[:source]
83
+ args = [source] + params[:args]
84
+ lenient = params[:lenient]
85
+ ok = system('python', *args)
86
+ end
87
+ error "Error running Python source file '#{source}'" unless ok or lenient
66
88
  end
67
89
 
68
90
  # Check source files using Pychecker tool. You may find documentation
data/python.yml CHANGED
@@ -4,10 +4,11 @@
4
4
  abstract: true
5
5
  default: [clean, test]
6
6
  alias:
7
+ clean: py_clean
7
8
  test: [py_deps, py_check, py_test]
8
- doc: py_doc
9
+ check: py_check
9
10
  run: py_run
10
- clean: py_clean
11
+ doc: py_doc
11
12
 
12
13
  # Build properties
13
14
  - properties:
@@ -46,6 +47,11 @@
46
47
  py_cov_inc: ["*.py"]
47
48
  # main scrip to run
48
49
  py_main: "#{py_src_dir}/#{name}.py"
50
+ # main script arguments as a list
51
+ py_main_args: []
52
+ # tells if the main script is lenient (doesn't stop on error if return
53
+ # code is different from 0, the dfault)
54
+ py_main_len: false
49
55
  # dependencies as a map, for instance:
50
56
  #
51
57
  # py_deps:
@@ -127,7 +133,10 @@
127
133
  - target: py_run
128
134
  description: Run Python script
129
135
  script:
130
- - python.python: :py_main
136
+ - python.python:
137
+ source: :py_main
138
+ args: :py_main_args
139
+ lenient: :py_main_len
131
140
 
132
141
  - target: py_clean
133
142
  description: Clean generated files
metadata CHANGED
@@ -1,13 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bee_python
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
4
+ version: 0.2.2
11
5
  platform: ruby
12
6
  authors:
13
7
  - Michel Casabianca
@@ -15,21 +9,15 @@ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
11
 
18
- date: 2013-09-12 00:00:00 Z
12
+ date: 2013-10-15 00:00:00 Z
19
13
  dependencies:
20
14
  - !ruby/object:Gem::Dependency
21
15
  name: bee
22
16
  prerelease: false
23
17
  requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
18
  requirements:
26
19
  - - ">="
27
20
  - !ruby/object:Gem::Version
28
- hash: 53
29
- segments:
30
- - 0
31
- - 11
32
- - 3
33
21
  version: 0.11.3
34
22
  type: :runtime
35
23
  version_requirements: *id001
@@ -44,81 +32,74 @@ extra_rdoc_files:
44
32
  - LICENSE
45
33
  files:
46
34
  - lib/bee_task_python.rb
47
- - egg/xmlrpc.yml
48
- - egg/project/test.py
49
- - egg/project/pylint.cfg
35
+ - egg/egg/build.yml
36
+ - egg/egg/ez_setup.py
37
+ - egg/egg/pylint.cfg
38
+ - egg/egg/script.py
39
+ - egg/egg/setup.erb
40
+ - egg/egg/test.py
41
+ - egg/egg.yml
42
+ - egg/http/build.erb
43
+ - egg/http/libhttp.py
44
+ - egg/http/pylint.cfg
45
+ - egg/http/server.py
46
+ - egg/http/test.erb
47
+ - egg/http.yml
48
+ - egg/mysql/mysql.py
49
+ - egg/mysql.yml
50
50
  - egg/project/build.erb
51
+ - egg/project/pylint.cfg
51
52
  - egg/project/script.py
52
- - egg/soap/pylint.cfg
53
+ - egg/project/test.py
54
+ - egg/project.yml
55
+ - egg/script/build.erb
56
+ - egg/script/pylint.cfg
57
+ - egg/script/script.py
58
+ - egg/script.yml
53
59
  - egg/soap/build.erb
54
60
  - egg/soap/client.py
61
+ - egg/soap/pylint.cfg
55
62
  - egg/soap/server.py
56
- - egg/test/test.py
57
- - egg/egg.yml
58
- - egg/project.yml
63
+ - egg/soap.yml
59
64
  - egg/source/source.py
60
- - egg/xmlrpc/pylint.cfg
65
+ - egg/source.yml
66
+ - egg/test/test.py
67
+ - egg/test.yml
61
68
  - egg/xmlrpc/build.erb
62
69
  - egg/xmlrpc/client.py
70
+ - egg/xmlrpc/pylint.cfg
63
71
  - egg/xmlrpc/server.py
64
- - egg/http/test.erb
65
- - egg/http/pylint.cfg
66
- - egg/http/build.erb
67
- - egg/http/server.py
68
- - egg/http/libhttp.py
69
- - egg/soap.yml
70
- - egg/script/pylint.cfg
71
- - egg/script/build.erb
72
- - egg/script/script.py
73
- - egg/source.yml
74
- - egg/mysql/mysql.py
75
- - egg/script.yml
76
- - egg/test.yml
77
- - egg/mysql.yml
78
- - egg/http.yml
79
- - egg/egg/build.yml
80
- - egg/egg/test.py
81
- - egg/egg/setup.erb
82
- - egg/egg/pylint.cfg
83
- - egg/egg/ez_setup.py
84
- - egg/egg/script.py
85
- - tools/test/suite.py
72
+ - egg/xmlrpc.yml
86
73
  - tools/compile/compile.py
74
+ - tools/test/suite.py
87
75
  - python.yml
88
76
  - README
89
77
  - LICENSE
90
78
  homepage: http://bee.rubyforge.org
91
79
  licenses: []
92
80
 
81
+ metadata: {}
82
+
93
83
  post_install_message: Enjoy bee!
94
84
  rdoc_options: []
95
85
 
96
86
  require_paths:
97
87
  - lib
98
88
  required_ruby_version: !ruby/object:Gem::Requirement
99
- none: false
100
89
  requirements:
101
- - - ">="
90
+ - &id002
91
+ - ">="
102
92
  - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
93
  version: "0"
107
94
  required_rubygems_version: !ruby/object:Gem::Requirement
108
- none: false
109
95
  requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
96
+ - *id002
116
97
  requirements: []
117
98
 
118
99
  rubyforge_project: none
119
- rubygems_version: 1.8.11
100
+ rubygems_version: 2.1.5
120
101
  signing_key:
121
- specification_version: 3
102
+ specification_version: 4
122
103
  summary: Bee package to manage Python projects
123
104
  test_files: []
124
105