plasmoid 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,21 @@
1
1
  = plasmoid
2
2
 
3
- Description goes here.
3
+ kde plasmoid generator written in ruby
4
+ it supports both webkit and ruby plasmoids
5
+
6
+ == Install
7
+
8
+ sudo gem install plasmoid
9
+
10
+ == Usage
11
+
12
+ $ plasmoid --ruby foo --summary "foo" foo
13
+
14
+ or
15
+
16
+ $ plasmoid --webkit --haml --jquery foo
17
+
18
+ once the project is generated it provides rake tasks to deal with the project like "rake view", "rake install", "rake pkg"
4
19
 
5
20
  == Contributing to plasmoid
6
21
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/lib/plasmoid.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'plasmoid/generator'
2
2
  require 'plasmoid/webkit_generator'
3
3
  require 'plasmoid/ruby_generator'
4
+ require 'plasmoid/python_generator'
4
5
 
@@ -22,6 +22,10 @@ module Plasmoid
22
22
  self[:generator] = Plasmoid::RubyGenerator
23
23
  end
24
24
 
25
+ o.on("--python", "generate python plasmoid") do |o|
26
+ self[:generator] = Plasmoid::PythonGenerator
27
+ end
28
+
25
29
  o.separator "Webkit Options:"
26
30
 
27
31
  o.on("--webkit", "generate webkit plasmoid") do |o|
@@ -15,6 +15,8 @@ module Plasmoid
15
15
  "webkit"
16
16
  elsif self.class == Plasmoid::RubyGenerator
17
17
  "ruby"
18
+ elsif self.class == Plasmoid::PythonGenerator
19
+ "python"
18
20
  end
19
21
  end
20
22
 
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'plasmoid'
3
+ require 'plasmoid/tasks'
@@ -0,0 +1,26 @@
1
+ # -*- coding: utf-8 -*-
2
+ from PyQt4.QtCore import *
3
+ from PyQt4.QtGui import *
4
+ from PyKDE4.plasma import Plasma
5
+ from PyKDE4 import plasmascript
6
+ from PyKDE4.kdecore import *
7
+ from PyKDE4.kdeui import *
8
+
9
+ class <%= options[:project_name].capitalize %>(plasmascript.Applet):
10
+ def __init__(self,parent,args=None):
11
+ plasmascript.Applet.__init__(self,parent)
12
+
13
+ def init(self):
14
+ self.setHasConfigurationInterface(False)
15
+ self.resize(375, 525)
16
+ self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
17
+
18
+ self.layout = QGraphicsLinearLayout(Qt.Horizontal, self.applet)
19
+ self.webView = Plasma.WebView(self.applet)
20
+ self.webView.setUrl(KUrl("http://www.kde.org"))
21
+
22
+ self.layout.addItem(self.webView)
23
+ self.setLayout(self.layout)
24
+
25
+ def CreateApplet(parent):
26
+ return <%= options[:project_name].capitalize %>(parent)
@@ -0,0 +1,18 @@
1
+ [Desktop Entry]
2
+ Encoding=UTF-8
3
+ Name=<%= options[:project_name] %>
4
+ Name[nl]=<%= options[:project_name] %>
5
+ Type=Service
6
+ ServiceTypes=Plasma/Applet
7
+ Icon=chronometer
8
+ X-Plasma-API=python
9
+ X-Plasma-MainScript=code/main.py
10
+ X-KDE-PluginInfo-Author=<%= options[:user_name] %>
11
+ X-KDE-PluginInfo-Email=<%= options[:project_email] %>
12
+ X-KDE-PluginInfo-Name=<%= options[:project_name] %>
13
+ X-KDE-PluginInfo-Version=1.0
14
+ X-KDE-PluginInfo-Website=http://plasma.kde.org/
15
+ X-KDE-PluginInfo-Category=Example
16
+ X-KDE-PluginInfo-Depends=
17
+ X-KDE-PluginInfo-License=GPL
18
+ X-KDE-PluginInfo-EnabledByDefault=true
@@ -0,0 +1,19 @@
1
+ module Plasmoid
2
+ class PythonGenerator < Generator
3
+ def create_files
4
+ puts "Creating files in #{target_dir}"
5
+ FileUtils.mkpath(target_dir)
6
+
7
+ Find.find(template_dir) do |path|
8
+ dest = path.sub(template_dir, "")
9
+
10
+ next if path =~ /^\.+$/ || dest.empty? || path =~ /~$/
11
+ if File.directory?(path)
12
+ mkdir(dest)
13
+ else
14
+ write_template(dest, dest)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
data/plasmoid.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{plasmoid}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David A. Cuadrado"]
@@ -33,6 +33,9 @@ Gem::Specification.new do |s|
33
33
  "lib/plasmoid/generator.rb",
34
34
  "lib/plasmoid/generator/options.rb",
35
35
  "lib/plasmoid/generator/template_helper.rb",
36
+ "lib/plasmoid/generator/templates/python/Rakefile",
37
+ "lib/plasmoid/generator/templates/python/contents/code/main.py",
38
+ "lib/plasmoid/generator/templates/python/metadata.desktop",
36
39
  "lib/plasmoid/generator/templates/ruby/Rakefile",
37
40
  "lib/plasmoid/generator/templates/ruby/contents/code/main.rb",
38
41
  "lib/plasmoid/generator/templates/ruby/metadata.desktop",
@@ -43,6 +46,7 @@ Gem::Specification.new do |s|
43
46
  "lib/plasmoid/generator/templates/webkit/metadata.desktop",
44
47
  "lib/plasmoid/haml.rb",
45
48
  "lib/plasmoid/package.rb",
49
+ "lib/plasmoid/python_generator.rb",
46
50
  "lib/plasmoid/ruby_generator.rb",
47
51
  "lib/plasmoid/tasks.rb",
48
52
  "lib/plasmoid/webkit_generator.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - David A. Cuadrado
@@ -71,6 +71,9 @@ files:
71
71
  - lib/plasmoid/generator.rb
72
72
  - lib/plasmoid/generator/options.rb
73
73
  - lib/plasmoid/generator/template_helper.rb
74
+ - lib/plasmoid/generator/templates/python/Rakefile
75
+ - lib/plasmoid/generator/templates/python/contents/code/main.py
76
+ - lib/plasmoid/generator/templates/python/metadata.desktop
74
77
  - lib/plasmoid/generator/templates/ruby/Rakefile
75
78
  - lib/plasmoid/generator/templates/ruby/contents/code/main.rb
76
79
  - lib/plasmoid/generator/templates/ruby/metadata.desktop
@@ -81,6 +84,7 @@ files:
81
84
  - lib/plasmoid/generator/templates/webkit/metadata.desktop
82
85
  - lib/plasmoid/haml.rb
83
86
  - lib/plasmoid/package.rb
87
+ - lib/plasmoid/python_generator.rb
84
88
  - lib/plasmoid/ruby_generator.rb
85
89
  - lib/plasmoid/tasks.rb
86
90
  - lib/plasmoid/webkit_generator.rb
@@ -101,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
105
  requirements:
102
106
  - - ">="
103
107
  - !ruby/object:Gem::Version
104
- hash: -805994551903766880
108
+ hash: 4089151965487651332
105
109
  segments:
106
110
  - 0
107
111
  version: "0"