shoeset

Check-in [ad50732410]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:First tentative steps towards porting to Green Shoes This one is much closer to working than Shoefiti: https://github.com/i5m/shoefiti/commit/e171e3d714d4e8b8f5889d8995ead8af357510b5 Same issues apply: * Remove any debug() replace with "puts" * Remove threading, at least for now * Issues with clear{...} * link in para is incorrect, doens't work properly so thought about using edit_line, but there is an issue in Cairo(?) at the time of writing that prevents text being copied: http://librelist.com/browser//shoes/2011/7/19/green-shoes-edit-box-copy-and-paste/ So no easy way to do authorisation at the minute) I can almost walk this on through and get it working, just can't get the tag cloud to display (although I think it is being built)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk | origin/green
Files: files | file ages | folders
SHA3-256: ad5073241075a7051885681b8c2665637e6cda024aa3982ee80ad1ebeb1b9d2d
User & Date: i5ivem@gmail.com 2011-08-03 14:21:21
Context
2011-08-03
14:21
First tentative steps towards porting to Green Shoes This one is much closer to working than Shoefiti: https://github.com/i5m/shoefiti/commit/e171e3d714d4e8b8f5889d8995ead8af357510b5 Same issues apply: * Remove any debug() replace with "puts" * Remove threading, at least for now * Issues with clear{...} * link in para is incorrect, doens't work properly so thought about using edit_line, but there is an issue in Cairo(?) at the time of writing that prevents text being copied: http://librelist.com/browser//shoes/2011/7/19/green-shoes-edit-box-copy-and-paste/ So no easy way to do authorisation at the minute) I can almost walk this on through and get it working, just can't get the tag cloud to display (although I think it is being built) Leaf check-in: ad50732410 user: i5ivem@gmail.com tags: trunk, origin/green
2010-03-29
13:45
ListBox cloudgen block now runs in serial * Because of threading used, if the user selected another item in the listbox whilst the app was already running and generating a tag cloud, another progress bar would appear, etc. This forces selections to run in serial, i.e. will ignore the selection if cloud generator is already running * Also resets list box selection to the set currently being used if user tries to change whilst running * Better future approach could be to cancel current cloud generation and start again for new set selected. Debatable though... Leaf check-in: 4624b9404c user: i5ivem@gmail.com tags: trunk, v0.0.2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to shoeset.rb.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
21
22
23
24
25
26
27
28

29
30
31



32
33
34
35
36
37
38
...
122
123
124
125
126
127
128
129
130




131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Shoes.setup do
	gem 'flickraw'
end

require 'flickraw'
require 'yaml'
require 'cloud'

	
Shoes.app :title => "Shoeset" do

	
	KEYFILE = "keys.yml"
	KEYS = YAML::load(File.read(KEYFILE))
................................................................................
	#Need to improve GUI feedback/responsive on opening. Thread??
	def login
		if File.exists?(TOKENFILE) #Load token if it exists
					$SETTINGS = YAML::load(File.read(TOKENFILE))
					@token = $SETTINGS["Token"]
					@auth = flickr.auth.checkToken :auth_token => @token
					@login = flickr.test.login
					@container.clear{ui} #draw ui 		

		else
			frob = flickr.auth.getFrob
			auth_url = FlickRaw.auth_url :frob => frob, :perms => 'read'



		
			para "Click to ", link("authorise", :click =>auth_url), " with Flickr."
			para "Click OK when you are finished."
			@okbutton = button "OK" do
				begin
					@auth = flickr.auth.getToken :frob => frob
					$SETTINGS = { "Token" => @auth.token }
................................................................................
				$p.fraction = counter/count
				#debug (counter/count)
				# Caching - anyway? Could cache list of photos from set, but then what about if updated?
			end
			#debug $array
			cloud = TagCloud.new($array.join(" "))
			$p.hide
			#debug cloud.build
			@tagcloud.clear{eval cloud.build}




		end
	end

	

	@container = stack do
		@loading = para "Loading..."
	end
	@animate = animate(5) do |frame|
		weight = ["bold", "normal"]
		@loading.style(:weight => weight[frame&1])
	end
	Thread.new do 
		login
	end

end



|
<
<
<


|







 







|
>



>
>
>







 







|
|
>
>
>
>








|



|

|





1



2
3
4
5
6
7
8
9
10
11
..
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
require 'green_shoes'



require 'flickraw'
require 'yaml'
require './cloud.rb'

	
Shoes.app :title => "Shoeset" do

	
	KEYFILE = "keys.yml"
	KEYS = YAML::load(File.read(KEYFILE))
................................................................................
	#Need to improve GUI feedback/responsive on opening. Thread??
	def login
		if File.exists?(TOKENFILE) #Load token if it exists
					$SETTINGS = YAML::load(File.read(TOKENFILE))
					@token = $SETTINGS["Token"]
					@auth = flickr.auth.checkToken :auth_token => @token
					@login = flickr.test.login
					#@container.clear{ui} #draw ui 		
					ui
		else
			frob = flickr.auth.getFrob
			auth_url = FlickRaw.auth_url :frob => frob, :perms => 'read'
			puts auth_url
#http://flickr.com/services/auth/?api_key=dc4e7111a9e2d0273c364d41eff09181&perms=read&frob=72157627114000141-c7ce4760e24f013a-936625&api_sig=47e76db2c77138efc3c35bb09f2c0f34
			
		
			para "Click to ", link("authorise", :click =>auth_url), " with Flickr."
			para "Click OK when you are finished."
			@okbutton = button "OK" do
				begin
					@auth = flickr.auth.getToken :frob => frob
					$SETTINGS = { "Token" => @auth.token }
................................................................................
				$p.fraction = counter/count
				#debug (counter/count)
				# Caching - anyway? Could cache list of photos from set, but then what about if updated?
			end
			#debug $array
			cloud = TagCloud.new($array.join(" "))
			$p.hide
			puts cloud.build
			#@tagcloud.clear{eval cloud.build}
			#Not working here....
			flow do
				eval cloud.build
			end
		end
	end

	

	@container = stack do
		@loading = para "Loading..."
	end
   @animate = animate(5) do |frame|
		weight = ["bold", "normal"]
		@loading.style(:weight => weight[frame&1])
	end
	#Thread.new do 
		login
	#end

end