This file is indexed.

/usr/share/pyshared/pymurmur/entrydialog.py is in murmur 1:0.2+svn20100315.r1208-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# This is part of the Murmur Museek Client, and distributed under the GPLv2
# Copyright (c) 2007 daelstorm.
import gtk
import os
import imagedata
from pymurmur.utils import _

class MetaDialog( gtk.Dialog):
	def __init__(self, frame, message="", data=None, modal= True):
		gtk.Dialog.__init__(self)
		self.connect("destroy", self.quit)
		self.connect("delete_event", self.quit)
		self.nicotine = frame
		if modal:
			self.set_modal(True)
		self.box = gtk.VBox(spacing=10)
		self.box.set_border_width(10)
		self.box.show()
		self.vbox.pack_start(self.box)
		
		if message:
			label = gtk.Label()
			label.set_markup(message)
			label.set_line_wrap(False)
			self.box.pack_start(label, False, False)
			label.show()
			label.set_alignment(0, 0.5)

		self.current = 0
		self.data = data
		

		hbox2 = gtk.HBox(spacing=5)
		hbox2.show()
	
		self.UF = gtk.Frame()
		self.UF.show()
		self.UF.set_shadow_type(gtk.SHADOW_ETCHED_IN)
		self.box.pack_start(self.UF, False, False)
		
		vbox3 = gtk.VBox(spacing=5)
		vbox3.set_border_width(5)
		vbox3.show()
		
		self.UF.add(vbox3)
		
		self.Username = self.MakeLabelStaticEntry( hbox2, "<b>Username:</b>", "", expand=False)
		self.BrowseUser = self.nicotine.CreateIconButton(gtk.STOCK_HARDDISK, "stock", self.OnBrowseUser, _("Browse"))
		hbox2.pack_start(self.BrowseUser, False, False)
		self.Position = self.MakeLabelStaticEntry( hbox2, "<b>List Position:</b>", "", expand=False, width=7, xalign=1)
		
		vbox3.pack_start(hbox2, False, False)
		
		
		
		hbox3 = gtk.HBox(spacing=5)
		hbox3.show()
		vbox3.pack_start(hbox3, False, False)

		self.Filename = self.MakeLabelStaticEntry( hbox3, _("<b>File Name:</b>"), "", fill=True)
		
		
		hbox5 = gtk.HBox(spacing=5)
		hbox5.show()
		vbox3.pack_start(hbox5, False, False)

		self.Directory = self.MakeLabelStaticEntry( hbox5, _("<b>Directory:</b>"), "", fill=True)
		
		self.Media = gtk.Frame()
		self.Media.show()
		self.Media.set_shadow_type(gtk.SHADOW_ETCHED_IN)
		hbox6 = gtk.HBox(spacing=5, homogeneous=False)
		hbox6.set_border_width(5)
		hbox6.show()

		self.Size = self.MakeLabelStaticEntry( hbox6, _("<b>File Size:</b>"), "", expand=False, width=11, xalign=1)
		self.Length = self.MakeLabelStaticEntry( hbox6, _("<b>Length:</b>"), "", expand=False, width=7, xalign=0.5)
		self.Bitrate = self.MakeLabelStaticEntry( hbox6, _("<b>Bitrate:</b>"), "", expand=False, width=12, xalign=0.5)
		
		self.Media.add(hbox6)
		self.box.pack_start(self.Media, False, False)

		hbox7 = gtk.HBox(spacing=5, homogeneous=False)
		hbox7.show()
		self.box.pack_start(hbox7, False, False)
	
		
		self.Immediate = self.MakeLabelStaticEntry( hbox7, _("<b>Immediate Downloads:</b>"), "", expand=False, width=6, xalign=0.5)
		
		self.Queue = self.MakeLabelStaticEntry( hbox7, _("<b>Queue:</b>"), "", expand=False, width=6, xalign=1)


		hbox4 = gtk.HBox(spacing=5, homogeneous=False)
		hbox4.show()
		self.box.pack_start(hbox4, False, False)

		self.Speed = self.MakeLabelStaticEntry( hbox4, _("<b>Last Speed:</b>"), "", expand=False, width=11, xalign=1)
		
		self.Country = gtk.Label()
		self.Country.hide()
		
		hbox4.pack_start(self.Country, False, False)

		
		self.buttonbox = gtk.HBox(False, 2)
		self.buttonbox.show()
		self.buttonbox.set_spacing(2)
		
		self.box.pack_start(self.buttonbox, False, False)
		
		# Download Button
		self.DownloadItem = self.nicotine.CreateIconButton(gtk.STOCK_GO_DOWN, "stock", self.OnDownloadItem, _("Download"))
		self.buttonbox.pack_start(self.DownloadItem, False, False)
		# Download All Button
		
		self.DownloadAll = self.nicotine.CreateIconButton(gtk.STOCK_GO_DOWN, "stock", self.OnDownloadAll, _("Download All"))
		self.buttonbox.pack_start(self.DownloadAll, False, False)
		self.Selected = self.MakeLabel( self.buttonbox, "<b>%s</b> File(s) Selected" % len(self.data.keys()),  expand=False,  xalign=1)
		self.Previous = self.nicotine.CreateIconButton(gtk.STOCK_GO_BACK, "stock", self.OnPrevious, _("Previous"))
		
		self.Next = self.nicotine.CreateIconButton(gtk.STOCK_GO_FORWARD, "stock", self.OnNext, _("Next"))
		
		self.buttonbox.pack_end(self.Next, False, False)
		self.buttonbox.pack_end(self.Previous, False, False)
		
		button = self.nicotine.CreateIconButton(gtk.STOCK_CLOSE, "stock", self.click, _("Close"))

		button.set_flags(gtk.CAN_DEFAULT)
		self.action_area.pack_start(button)

		button.grab_default()

		self.ret = None
		
		self.Display(self.current)
		
	def OnDownloadItem(self, widget):
		meta = self.data[self.current]

		self.nicotine.np.transfers.getFile(meta["user"], meta["fn"], "")
		
	def OnBrowseUser(self, widget):
		meta = self.data[self.current]
		self.nicotine.BrowseUser(meta["user"])
		
	def OnDownloadAll(self, widget):
		for item, meta in self.data.items():
			self.nicotine.np.transfers.getFile(meta["user"], meta["fn"], "")
			
	def OnPrevious(self, widget):

		if len(self.data.keys()) > 1:
			_list = self.data.keys()
			if not self.current in _list:
				ix -= 1
			else:
				ix = _list.index(self.current)

				ix -= 1

					
				if ix < 0:
					ix = -1
				elif ix >= len(_list):
					ix = 0
			if ix != None:
				self.current = _list[ix]
		if self.current == None:
			return
		self.Display(self.current)
		
	def OnNext(self, widget):
		if len(self.data.keys()) > 1: 
			_list = self.data.keys()
			if not self.current in _list:
				ix += 1
			else:
				ix = _list.index(self.current)

				ix += 1

					
				if ix < 0:
					ix = -1
				elif ix >= len(_list):
					ix = 0
			if ix != None:
				self.current = _list[ix]
		if self.current == None:
			return
		self.Display(self.current)
		
	def Display(self, item):
		if not self.data.has_key(item):
			return
		self.current = item
		
		More = False
		if len(self.data.keys()) > 1:
			More = True
		self.Next.set_sensitive(More)
		self.Previous.set_sensitive(More)
		self.DownloadAll.set_sensitive(More)
		
		self.Username.set_text	(self.data[self.current]["user"])
		self.Filename.set_text	(self.data[self.current]["filename"])
		self.Directory.set_text	(self.data[self.current]["directory"])
		self.Size.set_text	(str(self.data[self.current]["size"]))
		self.Speed.set_text	(self.data[self.current]["speed"])
		self.Position.set_text	(str(self.data[self.current]["position"]))
		if self.data[self.current]["bitrate"] not in ("", None):
			self.Bitrate.set_text(self.data[self.current]["bitrate"] + " Kbps")
		else:
			self.Bitrate.set_text("")
		self.Length.set_text	(self.data[self.current]["length"])
		self.Queue.set_text	(self.data[self.current]["queue"])
		self.Immediate.set_text	(str(self.data[self.current]["immediate"] == "Y"))
		
		if self.data[self.current]["country"] not in ("", None):
			self.Country.set_markup("<b>Country Code:</b> "+self.data[self.current]["country"] )
			self.Country.show()
		else:
			self.Country.set_text("")
			self.Country.hide()
		
	def quit(self, w=None, event=None):
		self.hide()
		self.destroy()
		gtk.main_quit()
	def click(self, button):

		self.quit()
	
	def MakeLabel(self, parent, labeltitle, expand=True, fill=False, xalign=0):
		
		label = gtk.Label()
		label.set_markup(labeltitle)
		label.show()
		#label.set_property("selectable", True)
		parent.pack_start(label, expand, fill)

		try:label.set_property("xalign", xalign)
		except Exception, e:
			print e
			pass

		return label
		
	def MakeLabelStaticEntry(self, parent, labeltitle, entrydata, editable=False, expand=True, fill=False, width=-1, xalign=0):
		
		label = gtk.Label()
		label.set_markup(labeltitle)
		label.show()

		parent.pack_start(label, False, False)
		
		entry = gtk.Entry()
		entry.set_property("editable", editable)
		entry.set_property("width-chars", width)
		try:entry.set_property("xalign", xalign)
		except:pass
		entry.show()
		if entrydata is not None:
			entry.set_text(entrydata)
		parent.pack_start(entry, expand, fill)
		return entry
		
class HelpDialog( gtk.Dialog):
	def __init__(self, frame, message="", modal= True,  helpdict={}, sort=False):
		gtk.Dialog.__init__(self)
		self.connect("destroy", self.quit)
		self.connect("delete_event", self.quit)

		if modal:
			self.set_modal(True)
		box = gtk.VBox(spacing=5)
		box.set_border_width(5)
		self.vbox.pack_start(box)
		box.show()
		if message:
			label = gtk.Label()
			label.set_alignment(0, 0)
			label.set_markup(message)
			box.pack_start(label, False, False)
			label.set_line_wrap(True)
			label.show()
		helplist = helpdict
		if sort:
			helplist.sort()
		self.table1 = gtk.Table( homogeneous=False)
		self.table1.show()
		self.table1.set_col_spacings(5)
		self.table1.set_row_spacings(5)

		
		count = 0
		for key in helplist:
		
			keylabel = gtk.Label()
			keylabel.set_alignment(0, 0)
			keylabel.set_markup(key[1])
			keylabel.show()
			
			self.table1.attach(keylabel, 0, 1, count, count+1, gtk.FILL,  gtk.SHRINK, 0, 0)
	
			valuelabel = gtk.Label()
			valuelabel.set_alignment(0, 0)
			valuelabel.set_markup(key[2])
			valuelabel.set_line_wrap(True)
			valuelabel.show()
			self.table1.attach(valuelabel, 1, 2, count, count+1, gtk.FILL, gtk.SHRINK, 0, 0)

			count += 1
		box.pack_start(self.table1, False, False)
		button = frame.CreateIconButton(gtk.STOCK_OK, "stock", self.quit, _("OK"))
		self.action_area.pack_start(button)
	
		self.ret = None
	def quit(self, w=None, event=None):
		self.hide()
		self.destroy()
		gtk.main_quit()

def OpenHelpDialog(frame, title="Help", message="", 
	modal= True, helpdict={}, sort=False):

	win = HelpDialog(frame, message, modal=modal, helpdict=helpdict, sort=sort)
	win.set_title(title)
	win.set_icon(frame.images["icon"])
	win.set_default_size(300, 100)
	win.show()
	gtk.main()
		
class EntryDialog( gtk.Dialog):
	def __init__(self, frame, message="", default_text='', modal= True, option=False, optionmessage="", optionvalue=False, droplist=[]):
		gtk.Dialog.__init__(self)
		self.connect("destroy", self.quit)
		self.connect("delete_event", self.quit)
		self.gotoption = option
		if modal:
			self.set_modal(True)
		box = gtk.VBox(spacing=10)
		box.set_border_width(10)
		self.vbox.pack_start(box)
		box.show()
		if message:
			label = gtk.Label(message)
			box.pack_start(label, False, False)
			label.set_line_wrap(True)
			label.show()
		self.combo = gtk.combo_box_entry_new_text()
		for i in droplist:
			self.combo.append_text( i)
		self.combo.child.set_text(default_text)
	
		box.pack_start(self.combo, False, False)
		self.combo.show()
		self.combo.grab_focus()
		
		
		self.option = gtk.CheckButton()
		self.option.set_active(optionvalue)
		self.option.set_label(optionmessage)
		self.option.show()
		if self.gotoption:
			box.pack_start(self.option, False, False)
		button = gtk.Button(_("OK"))
		button.connect("clicked", self.click)
		button.set_flags(gtk.CAN_DEFAULT)
		self.action_area.pack_start(button)
		button.show()
		button.grab_default()
		button = gtk.Button(_("Cancel"))
		button.connect("clicked", self.quit)
		button.set_flags(gtk.CAN_DEFAULT)
		self.action_area.pack_start(button)
		button.show()
		self.ret = None
		
	def quit(self, w=None, event=None):
		self.hide()
		self.destroy()
		gtk.main_quit()
		
	def click(self, button):
		if self.gotoption:
			self.ret = [self.combo.child.get_text(), self.option.get_active()]
		else:
			self.ret = self.combo.child.get_text()
		self.quit()

def input_box(frame, title="Input Box", message="", default_text='', 
	modal= True, option=False, optionmessage="", optionvalue=False, droplist=[]):

	win = EntryDialog(frame, message, default_text, modal=modal, option=option, optionmessage=optionmessage, optionvalue=optionvalue, droplist=droplist)
	win.set_title(title)
	win.set_icon(frame.images["icon"])
	win.set_default_size(300, 100)
	win.show()
	gtk.main()
	return win.ret


def Option_Box(frame, title="Option Box", message="", default_text='', 
	modal= True, option1="", option2="", option3="", status=None ):
	
	win = OptionDialog(frame, message, modal=modal, option3=option3, option1=option1, option2=option2, status=status)
	win.set_title(title)
	win.set_icon(frame.images["icon"])
	win.show()
	gtk.main()
	return win.ret

class OptionDialog( gtk.Dialog):
	def __init__(self, frame, message="",modal= False, option1="", option2="", option3="", status=None):
		gtk.Dialog.__init__(self)
		self.connect("destroy", self.quit)
		self.connect("delete_event", self.quit)
		
		self.set_modal(modal)
		box = gtk.VBox(spacing=10)
		box.set_border_width(10)
		self.vbox.pack_start(box)
		box.show()
		hbox = gtk.HBox(spacing=5)
		hbox.set_border_width(5)
		hbox.show()
		box.pack_start(hbox)
		if status:
			image = gtk.Image()
			image.set_padding(0, 0)
			if status == "warning":
				icon = gtk.STOCK_DIALOG_WARNING
			else:
				icon = gtk.STOCK_DIALOG_QUESTION
			image.set_from_stock(icon, 4)
			image.show()
			hbox.pack_start(image)
		if message:
			label = gtk.Label(message)
			hbox.pack_start(label)
			label.set_line_wrap(True)
			label.show()
		
			
		if option1 is not None:
			button1 = gtk.Button(option1)
			button1.connect("clicked", self.option1)
			button1.set_flags(gtk.CAN_DEFAULT)
			self.action_area.pack_start(button1)
			button1.show()
		if option2 is not None:
			button2 = gtk.Button(option2)
			button2.connect("clicked", self.option2)
			button2.set_flags(gtk.CAN_DEFAULT)
			self.action_area.pack_start(button2)
			button2.show()
			button2.grab_default()
		if option3 is not None:
			button3 = gtk.Button(option3)
			button3.connect("clicked", self.option3)
			button3.set_flags(gtk.CAN_DEFAULT)
			self.action_area.pack_start(button3)
			button3.show()
			self.ret = None
        
	def quit(self, w=None, event=None):
		self.hide()
		self.destroy()
		gtk.main_quit()
		
	def option3(self, button3):
		self.ret = 3
		self.quit()
		
	def option1(self, button1):
		self.ret = 1
		self.quit()
		
	def option2(self, button2):
		self.ret = 2
		self.quit()