XDCC-Fetch 1.386

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/COPYING +23 -0
  2. data/XDCC-Fetch.rbw +54 -0
  3. data/doc/ark.png +0 -0
  4. data/doc/connect_established.png +0 -0
  5. data/doc/index.html +300 -0
  6. data/doc/mega_ark.png +0 -0
  7. data/doc/package.png +0 -0
  8. data/doc/package_unknown.png +0 -0
  9. data/doc/shot1.png +0 -0
  10. data/doc/shot1_mini.png +0 -0
  11. data/doc/shot2.png +0 -0
  12. data/doc/shot2_mini.png +0 -0
  13. data/doc/xdccfetch.css +155 -0
  14. data/icons/ark.png +0 -0
  15. data/icons/ark_big.png +0 -0
  16. data/icons/camera_test.png +0 -0
  17. data/icons/cancel.png +0 -0
  18. data/icons/connect_creating.png +0 -0
  19. data/icons/connect_established.png +0 -0
  20. data/icons/connect_failed.png +0 -0
  21. data/icons/connect_no.png +0 -0
  22. data/icons/edit_add.png +0 -0
  23. data/icons/edit_remove.png +0 -0
  24. data/icons/exit.png +0 -0
  25. data/icons/fileclose.png +0 -0
  26. data/icons/folder_inbox.png +0 -0
  27. data/icons/idea.png +0 -0
  28. data/icons/mega_ark.png +0 -0
  29. data/icons/messagebox_critical.png +0 -0
  30. data/icons/messagebox_info.png +0 -0
  31. data/icons/messagebox_warning.png +0 -0
  32. data/icons/messagebox_warning_small.png +0 -0
  33. data/icons/package.png +0 -0
  34. data/icons/package_favourite.png +0 -0
  35. data/icons/package_unknown.png +0 -0
  36. data/src/Console/Console_Parser.rb +71 -0
  37. data/src/Console/XDCC_Pack_Match_Template.rb +29 -0
  38. data/src/Console/xdcc-fetch.rb +123 -0
  39. data/src/GUI/About_Dialog.rb +50 -0
  40. data/src/GUI/Application_Builder.rb +280 -0
  41. data/src/GUI/Context_Menu.rb +81 -0
  42. data/src/GUI/Custom_Tabs.rb +60 -0
  43. data/src/GUI/Dialog_Box.rb +116 -0
  44. data/src/GUI/Download_Finished_Box.rb +41 -0
  45. data/src/GUI/Empty_Text_Field_Handler.rb +86 -0
  46. data/src/GUI/Gui_Logic.rb +629 -0
  47. data/src/GUI/Icon_Loader.rb +58 -0
  48. data/src/GUI/Main_Window.rb +227 -0
  49. data/src/GUI/Packet_Item.rb +171 -0
  50. data/src/GUI/Packet_List.rb +145 -0
  51. data/src/GUI/Speed_Widget.rb +101 -0
  52. data/src/GUI/Talk_Back.rb +118 -0
  53. data/src/GUI/Toggle_Button.rb +56 -0
  54. data/src/Network/CTCP_Handler.rb +61 -0
  55. data/src/Network/DCC_File.rb +323 -0
  56. data/src/Network/DCC_Parser.rb +71 -0
  57. data/src/Network/IPAddr_Ext.rb +76 -0
  58. data/src/Network/IRC_Message.rb +161 -0
  59. data/src/Network/IRC_Server.rb +273 -0
  60. data/src/Network/IRC_Server_Respond_Map.rb +223 -0
  61. data/src/Network/IRC_User.rb +58 -0
  62. data/src/Network/TCP_Connection.rb +168 -0
  63. data/src/Network/XDCC_Announcement.rb +120 -0
  64. data/src/Network/XDCC_Announcement_Storage.rb +167 -0
  65. data/src/Network/XDCC_Download_Handler.rb +412 -0
  66. data/src/Network/XDCC_Pack.rb +58 -0
  67. data/src/Network/XDCC_Parser.rb +253 -0
  68. data/src/Translations/README +61 -0
  69. data/src/Translations/check_translations +83 -0
  70. data/src/Translations/de.rb +140 -0
  71. data/src/Translations/en.rb +145 -0
  72. data/src/Utilities/Configuration.rb +91 -0
  73. data/src/Utilities/Events.rb +87 -0
  74. data/src/Utilities/Globals.rb +138 -0
  75. data/src/Utilities/PrettyException.rb +1091 -0
  76. data/src/Utilities/Recursive_Open_Struct.rb +159 -0
  77. data/src/Utilities/Timer.rb +71 -0
  78. metadata +135 -0
@@ -0,0 +1,159 @@
1
+ # Author:: Martin Ankerl (mailto:martin.ankerl@gmail.com)
2
+ # Copyright:: Copyright (c) 2004-2005 Martin Ankerl
3
+ # License:: BSD
4
+ #
5
+ # All rights reserved.
6
+ #
7
+ # Redistribution and use in source and binary forms, with or without modification,
8
+ # are permitted provided that the following conditions are met:
9
+ #
10
+ # * Redistributions of source code must retain the above copyright notice, this list
11
+ # of conditions and the following disclaimer.
12
+ # * Redistributions in binary form must reproduce the above copyright notice, this list
13
+ # of conditions and the following disclaimer in the documentation and/or other materials
14
+ # provided with the distribution.
15
+ # * Neither the name of Martin Ankerl nor the names of its contributors may be used to
16
+ # endorse or promote products derived from this software without specific prior written
17
+ # permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
20
+ # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
+ # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25
+ # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26
+ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+
29
+ # Recursive_Open_Struct provides a convenient interface to a hierarchy of configuration
30
+ # parameters. You do not need to define the accessors, they are created automatically
31
+ # on demand.
32
+ #
33
+ # Have a look at this example:
34
+ #
35
+ # ac = Recursive_Open_Struct.new
36
+ # ac.window.name = "SuperDuper"
37
+ # ac.app.version = "2.1.3"
38
+ # ac.this.is.automatically.created = "blabla"
39
+ #
40
+ # After you have created all of your configuration parameters, to prevent
41
+ # typos when using the parameters, the structure can be closed:
42
+ #
43
+ # ac.close
44
+ #
45
+ # After closing,
46
+ #
47
+ # ac.widnow.name = "UberSuperDuper"
48
+ #
49
+ # You get the usual NoMethodError, because 'widnow' does not exist.
50
+ #
51
+ class Recursive_Open_Struct
52
+ # Create a new Recursive_Open_Struct.
53
+ def initialize
54
+ @methods = Hash.new
55
+ @open = true
56
+ end
57
+
58
+ # automatically add parameters
59
+ def method_missing(method, params=nil) # :nodoc:
60
+ key = method.id2name
61
+ key.chop! if params # remove trailing =
62
+
63
+ # if structure is closed, disable hierarchy creation
64
+ super if !@methods.has_key?(key) && !@open
65
+
66
+ if params.nil?
67
+ # no param: create new Recursive_Open_Struct object
68
+ @methods[key] ||= Recursive_Open_Struct.new
69
+ else
70
+ # assigning a new value
71
+ if @methods[key].class == Recursive_Open_Struct
72
+ raise TypeError, "overwriting previously created hierarchy entry '#{key}' not allowed", caller(1)
73
+ else
74
+ @methods[key] = params
75
+ end
76
+ end
77
+ @methods[key]
78
+ end
79
+
80
+ # An alternative way to access the value of an attribute
81
+ # s = Recursive_Open_Struct.new
82
+ # s.name = "Hugo"
83
+ # s["name"] # "Hugo"
84
+ def [](key)
85
+ @methods[key]
86
+ end
87
+
88
+ # An alternative way to set the value of an attribute
89
+ # s = Recursive_Open_Struct.new
90
+ # s["name"] = "Hugo"
91
+ # s.name # "Hugo"
92
+ def []=(key, value)
93
+ self.send((key+"=").to_sym, value)
94
+ end
95
+
96
+ # call-seq:
97
+ # attrs() -> an_array
98
+ #
99
+ # Return a sorted array of attribute names, similar to #methods.
100
+ #
101
+ # s = Recursive_Open_Struct.new
102
+ # s.name = "martinus"
103
+ # s.age = 25
104
+ # s.attrs # returns ["age", "name"]
105
+ def attrs
106
+ @methods.keys.sort
107
+ end
108
+
109
+ # After calling #close, no further modification of the configuration hierarchy
110
+ # is allowed. This is not as strict as #freeze, because you are still allowed
111
+ # to modify data.
112
+ #
113
+ # s = Recursive_Open_Struct.new
114
+ # s.name = "Hugo"
115
+ # s.close
116
+ # s.name = "martinus" # does still work
117
+ # s.age = 25 # raises NoMethodError
118
+ def close
119
+ do_set_open_status(false)
120
+ end
121
+
122
+ # Reopens a Recursive_Open_Struct which was closed with #close earlier.
123
+ # After this call, it is possible to modify the structure again.
124
+ def re_open
125
+ do_set_open_status(true)
126
+ end
127
+
128
+ # call-seq:
129
+ # open?() -> boolean
130
+ #
131
+ # Return whether the structure is still open or not.
132
+ #
133
+ # s = Recursive_Open_Struct.new
134
+ # s.open? # returns true
135
+ # s.close
136
+ # s.open? # returns false
137
+ def open?
138
+ @open
139
+ end
140
+
141
+ # call-seq:
142
+ # each() { |elem| ... }
143
+ #
144
+ # Iterates through all elements of the Recursive_Open_Struct in alphabetic order.
145
+ def each
146
+ attrs.each do |attr|
147
+ yield @methods[attr]
148
+ end
149
+ end
150
+
151
+ protected
152
+
153
+ def do_set_open_status(status)
154
+ @methods.each_value do |val|
155
+ val.do_set_open_status(status) if val.class == Recursive_Open_Struct
156
+ end
157
+ @open = status
158
+ end
159
+ end
@@ -0,0 +1,71 @@
1
+ # Copyright (c) 2004, Christoph Heindl
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification,
5
+ # are permitted provided that the following conditions are met:
6
+ #
7
+ # * Redistributions of source code must retain the above copyright notice, this list
8
+ # of conditions and the following disclaimer.
9
+ # * Redistributions in binary form must reproduce the above copyright notice, this list
10
+ # of conditions and the following disclaimer in the documentation and/or other materials
11
+ # provided with the distribution.
12
+ # * Neither the name of Christoph Heindl nor the names of its contributors may be used to
13
+ # endorse or promote products derived from this software without specific prior written
14
+ # permission.
15
+ #
16
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
17
+ # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18
+ # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22
+ # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
23
+ # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+
25
+
26
+ require 'src/Utilities/Events.rb'
27
+ require 'thread'
28
+
29
+ # Provides a not-so-accurate timer class
30
+ class Timer
31
+ include Event_Publisher
32
+
33
+ # -- Connectable events
34
+
35
+ # Periodically, when the specified timeout_secs have passed. Args: Timestamp
36
+ ON_TIMER = Event_Publisher.next_global_eventID
37
+
38
+ # Initializes and starts the timer with the given timeout attribute in seconds
39
+ # This can also be a float value. I.e. timeout_secs == 0.5 triggers the timer
40
+ # each 0.5 seconds
41
+ def initialize(timeout_secs)
42
+ self.init_events
43
+ @mutex = Mutex.new
44
+ @stop = false
45
+ @thread = Thread.new(self, timeout_secs) do |caller, timeout|
46
+ while (!caller.stop?)
47
+ sleep(timeout)
48
+ caller.fire_event(ON_TIMER, Time.now)
49
+ end
50
+ end
51
+ end
52
+
53
+ # Stop the timer
54
+ def stop!
55
+ @mutex.synchronize do
56
+ @stop = true
57
+ end
58
+ end
59
+
60
+ # Is the timer about to stop. or has already stopped?
61
+ def stop?
62
+ @mutex.synchronize do
63
+ @stop
64
+ end
65
+ end
66
+
67
+ # Wait for the timer to be killed. I.e. someone issues a stop!
68
+ def join
69
+ @thread.join
70
+ end
71
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.4
3
+ specification_version: 1
4
+ name: XDCC-Fetch
5
+ version: !ruby/object:Gem::Version
6
+ version: "1.386"
7
+ date: 2005-01-30
8
+ summary: "XDCC-Fetch, written entirely in Ruby, is an intuitive, no-nonsense tool for
9
+ searching, collecting and downloading XDCC announcements within IRC channels.
10
+ XDCC-Fetch is released under the BSD license and available for free."
11
+ require_paths:
12
+ - src
13
+ email: xdccfetch@gmail.com
14
+ homepage: http://xdccfetch.sourceforge.net
15
+ rubyforge_project:
16
+ description:
17
+ autorequire:
18
+ default_executable:
19
+ bindir: "."
20
+ has_rdoc: false
21
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
22
+ requirements:
23
+ -
24
+ - ">"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.0
27
+ version:
28
+ platform: ruby
29
+ authors:
30
+ - XDCC-Fetch Team
31
+ files:
32
+ - "."
33
+ - "./COPYING"
34
+ - "./icons"
35
+ - "./icons/package.png"
36
+ - "./icons/camera_test.png"
37
+ - "./icons/messagebox_warning.png"
38
+ - "./icons/package_favourite.png"
39
+ - "./icons/folder_inbox.png"
40
+ - "./icons/package_unknown.png"
41
+ - "./icons/messagebox_warning_small.png"
42
+ - "./icons/connect_no.png"
43
+ - "./icons/ark.png"
44
+ - "./icons/messagebox_critical.png"
45
+ - "./icons/exit.png"
46
+ - "./icons/cancel.png"
47
+ - "./icons/mega_ark.png"
48
+ - "./icons/fileclose.png"
49
+ - "./icons/messagebox_info.png"
50
+ - "./icons/idea.png"
51
+ - "./icons/edit_remove.png"
52
+ - "./icons/connect_creating.png"
53
+ - "./icons/ark_big.png"
54
+ - "./icons/edit_add.png"
55
+ - "./icons/connect_failed.png"
56
+ - "./icons/connect_established.png"
57
+ - "./src"
58
+ - "./src/Utilities"
59
+ - "./src/Utilities/PrettyException.rb"
60
+ - "./src/Utilities/Recursive_Open_Struct.rb"
61
+ - "./src/Utilities/Events.rb"
62
+ - "./src/Utilities/Configuration.rb"
63
+ - "./src/Utilities/Timer.rb"
64
+ - "./src/Utilities/Globals.rb"
65
+ - "./src/Network"
66
+ - "./src/Network/XDCC_Announcement.rb"
67
+ - "./src/Network/IRC_User.rb"
68
+ - "./src/Network/DCC_File.rb"
69
+ - "./src/Network/CTCP_Handler.rb"
70
+ - "./src/Network/XDCC_Download_Handler.rb"
71
+ - "./src/Network/IRC_Server_Respond_Map.rb"
72
+ - "./src/Network/DCC_Parser.rb"
73
+ - "./src/Network/IRC_Server.rb"
74
+ - "./src/Network/IPAddr_Ext.rb"
75
+ - "./src/Network/XDCC_Announcement_Storage.rb"
76
+ - "./src/Network/IRC_Message.rb"
77
+ - "./src/Network/XDCC_Pack.rb"
78
+ - "./src/Network/XDCC_Parser.rb"
79
+ - "./src/Network/TCP_Connection.rb"
80
+ - "./src/GUI"
81
+ - "./src/GUI/Toggle_Button.rb"
82
+ - "./src/GUI/Talk_Back.rb"
83
+ - "./src/GUI/Application_Builder.rb"
84
+ - "./src/GUI/Main_Window.rb"
85
+ - "./src/GUI/About_Dialog.rb"
86
+ - "./src/GUI/Download_Finished_Box.rb"
87
+ - "./src/GUI/Context_Menu.rb"
88
+ - "./src/GUI/Dialog_Box.rb"
89
+ - "./src/GUI/Packet_Item.rb"
90
+ - "./src/GUI/Custom_Tabs.rb"
91
+ - "./src/GUI/Empty_Text_Field_Handler.rb"
92
+ - "./src/GUI/Speed_Widget.rb"
93
+ - "./src/GUI/Packet_List.rb"
94
+ - "./src/GUI/Gui_Logic.rb"
95
+ - "./src/GUI/Icon_Loader.rb"
96
+ - "./src/Console"
97
+ - "./src/Console/XDCC_Pack_Match_Template.rb"
98
+ - "./src/Console/xdcc-fetch.rb"
99
+ - "./src/Console/Console_Parser.rb"
100
+ - "./src/Translations"
101
+ - "./src/Translations/check_translations"
102
+ - "./src/Translations/README"
103
+ - "./src/Translations/de.rb"
104
+ - "./src/Translations/en.rb"
105
+ - "./XDCC-Fetch.rbw"
106
+ - "./doc"
107
+ - "./doc/package.png"
108
+ - "./doc/shot2_mini.png"
109
+ - "./doc/shot1_mini.png"
110
+ - "./doc/index.html"
111
+ - "./doc/connect_established.png"
112
+ - "./doc/mega_ark.png"
113
+ - "./doc/shot2.png"
114
+ - "./doc/xdccfetch.css"
115
+ - "./doc/package_unknown.png"
116
+ - "./doc/ark.png"
117
+ - "./doc/shot1.png"
118
+ test_files: []
119
+ rdoc_options: []
120
+ extra_rdoc_files: []
121
+ executables:
122
+ - XDCC-Fetch.rbw
123
+ extensions: []
124
+ requirements: []
125
+ dependencies:
126
+ - !ruby/object:Gem::Dependency
127
+ name: fxruby
128
+ version_requirement:
129
+ version_requirements: !ruby/object:Gem::Version::Requirement
130
+ requirements:
131
+ -
132
+ - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 1.2.0
135
+ version: