Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

find * -name '*.py' | xargs sed -i -r 's,\s+$,,'

... my trailing whitespace autoremove vim plugin is constantly editing/autocorrecting files as i work.  as i do not mix cosmetic and functional commits, this is a real annoyance; this patch removes all trailing blanks, once-and-for-all.  ideally, this would be enforced.  as a bonus, the pipeline also fixes [dos] and [noeol] files.

LibTest results unaffected; assumed correct.
  • Loading branch information...
commit 64eff557466754baa2a85d8f665a1b16452c53e5 1 parent 9be1397
@xtfxme xtfxme authored
Showing with 4,689 additions and 4,698 deletions.
  1. +1 −1  addons/CountryListBox.py
  2. +9 −9 addons/DeferredHandler.py
  3. +246 −247 addons/FlowPlayer.py
  4. +1 −1  addons/RichTextEditor.py
  5. +171 −171 addons/SWFUpload.py
  6. +1 −1  addons/TinyMCEditor.py
  7. +2 −2 contrib/copyright_check.py
  8. +5 −5 contrib/create_imports.py
  9. +1 −1  contrib/java2py.py
  10. +15 −15 contrib/pyjscompressor.py
  11. +2 −2 doc/book/Bookreader.py
  12. +5 −5 doc/book/Chapter.py
  13. +4 −4 doc/book/Sink.py
  14. +1 −1  doc/book/SinkList.py
  15. +60 −60 doc/gendocs.py
  16. +3 −3 examples/addonsgallery/AddonsGallery.py
  17. +2 −2 examples/addonsgallery/AutoCompleteTab.py
  18. +38 −38 examples/addonsgallery/Canvas2DTab.py
  19. +31 −31 examples/addonsgallery/CanvasTab.py
  20. +5 −5 examples/addonsgallery/TooltipTab.py
  21. +6 −6 examples/asteroids/Space.py
  22. +2 −3 examples/buildall.py
  23. +1 −1  examples/builder/Builder.py
  24. +3 −3 examples/canvasprocessing/CanvasProcessing.py
  25. +2 −2 examples/clickoverride/Override.py
  26. +1 −1  examples/cssmesser/CSSMess.py
  27. +1 −1  examples/deprecated/gears/GearsDemo.py
  28. +5 −5 examples/deprecated/pywebgtkbuilder/AutoGtk.py
  29. +10 −10 examples/dnd/AbsolutePositionExample.py
  30. +7 −7 examples/dynamictable/DayFilterWidget.py
  31. +1 −1  examples/dynamictable/DynaTable.py
  32. +26 −26 examples/dynamictable/DynaTableWidget.py
  33. +1 −1  examples/dynamictable/Person.py
  34. +2 −2 examples/dynamictable/Professor.py
  35. +1 −1  examples/dynamictable/Schedule.py
  36. +11 −11 examples/dynamictable/SchoolCalendarWidget.py
  37. +1 −1  examples/dynamictable/Student.py
  38. +2 −2 examples/dynamictable/TimeSlot.py
  39. +7 −7 examples/employeeadmin/ApplicationConstants.py
  40. +3 −3 examples/employeeadmin/EmployeeAdmin.py
  41. +1 −1  examples/employeeadmin/Grid.py
  42. +26 −26 examples/employeeadmin/components.py
  43. +3 −3 examples/employeeadmin/controller.py
  44. +15 −15 examples/employeeadmin/model.py
  45. +35 −35 examples/employeeadmin/view.py
  46. +5 −5 examples/employeeadmin/vo.py
  47. +3 −3 examples/flowpanel/FlowPanel.py
  48. +1 −1  examples/gcharttestapp/GChartExample00.py
  49. +1 −1  examples/gcharttestapp/GChartExample01.py
  50. +8 −8 examples/gcharttestapp/GChartExample02.py
  51. +5 −5 examples/gcharttestapp/GChartExample03.py
  52. +6 −6 examples/gcharttestapp/GChartExample04.py
  53. +4 −4 examples/gcharttestapp/GChartExample07.py
  54. +15 −15 examples/gcharttestapp/GChartExample14.py
  55. +1 −1  examples/gcharttestapp/GChartExample20.py
  56. +6 −6 examples/gcharttestapp/GChartExample21.py
  57. +63 −63 examples/gcharttestapp/GChartExample24.py
  58. +19 −19 examples/gcharttestapp/GChartTestApp.py
  59. +1 −1  examples/gcharttestapp/GChartTestAppUtil.py
  60. +1 −1  examples/gcharttestapp/TestGChart00.py
  61. +3 −3 examples/gcharttestapp/TestGChart02.py
  62. +15 −15 examples/gcharttestapp/TestGChart05.py
  63. +1 −1  examples/getattr/MainTest.py
  64. +4 −4 examples/gridedit/GridEdit.py
  65. +7 −7 examples/gridtest/GridTest.py
  66. +21 −21 examples/gwtcanvas/GradientDemo.py
  67. +39 −39 examples/gwtcanvas/StaticDemo.py
  68. +71 −71 examples/gwtcanvas/SuiteDemo.py
  69. +2 −2 examples/hangman/HangMan.py
  70. +8 −8 examples/hangman/HangManWidget.py
  71. +7 −7 examples/hangman/Wordlist_20.py
  72. +7 −7 examples/infohierarchy/InfoDirectory.py
  73. +6 −6 examples/infohierarchy/Trees.py
  74. +41 −41 examples/infohierarchy/public/services/jsonrpc/__init__.py
  75. +10 −10 examples/infohierarchy/public/services/jsonrpc/apacheServiceHandler.py
  76. +10 −10 examples/infohierarchy/public/services/jsonrpc/cgihandler.py
  77. +3 −3 examples/infohierarchy/public/services/jsonrpc/errors.py
  78. +2 −3 examples/infohierarchy/public/services/jsonrpc/http.py
  79. +9 −9 examples/infohierarchy/public/services/jsonrpc/proxy.py
  80. +14 −14 examples/infohierarchy/public/services/jsonrpc/socketserver.py
  81. +1 −1  examples/jsimport/examplejs.py
  82. +7 −7 examples/jsonrpc/JSONRPCExample.py
  83. +1 −1  examples/jsonrpc/public/services/EchoService.py
  84. +45 −45 examples/jsonrpc/public/services/jsonrpc/__init__.py
  85. +13 −13 examples/jsonrpc/public/services/jsonrpc/apacheServiceHandler.py
  86. +10 −10 examples/jsonrpc/public/services/jsonrpc/cgihandler.py
  87. +3 −3 examples/jsonrpc/public/services/jsonrpc/errors.py
  88. +2 −3 examples/jsonrpc/public/services/jsonrpc/http.py
  89. +9 −9 examples/jsonrpc/public/services/jsonrpc/proxy.py
  90. +16 −16 examples/jsonrpc/public/services/jsonrpc/socketserver.py
  91. +4 −4 examples/kitchensink/Buttons.py
  92. +2 −2 examples/kitchensink/Frames.py
  93. +6 −6 examples/kitchensink/Images.py
  94. +2 −2 examples/kitchensink/KitchenSink.py
  95. +22 −22 examples/kitchensink/Layouts.py
  96. +6 −6 examples/kitchensink/Lists.py
  97. +14 −14 examples/kitchensink/Logger.py
  98. +7 −7 examples/kitchensink/Menus.py
  99. +10 −10 examples/kitchensink/Popups.py
  100. +2 −2 examples/kitchensink/Tables.py
  101. +1 −1  examples/kitchensink/Tabs.py
  102. +7 −7 examples/kitchensink/Text.py
  103. +26 −26 examples/kitchensink/Trees.py
  104. +941 −941 examples/libtest/ArgsTest.py
  105. +12 −12 examples/libtest/AttributeTest.py
  106. +2 −2 examples/libtest/Base64ModuleTest.py
  107. +2 −2 examples/libtest/BoolTest.py
  108. +12 −12 examples/libtest/BuiltinTest.py
  109. +18 −18 examples/libtest/ClassTest.py
  110. +10 −10 examples/libtest/CompileTest.py
  111. +11 −11 examples/libtest/CsvModuleTest.py
  112. +5 −5 examples/libtest/DictTest.py
  113. +2 −2 examples/libtest/ExceptionTest.py
  114. +5 −5 examples/libtest/FunctionTest.py
  115. +2 −2 examples/libtest/GeneratorTest.py
  116. +2 −2 examples/libtest/LibTest.py
  117. +18 −18 examples/libtest/ListTest.py
  118. +1 −1  examples/libtest/NameTest.py
  119. +3 −3 examples/libtest/NoInlineCodeTest.py
  120. +1 −1  examples/libtest/ReModuleTest.py
  121. +1 −1  examples/libtest/StringTest.py
  122. +22 −22 examples/libtest/Syntax27Test.py
  123. +26 −26 examples/libtest/VarsTest.py
  124. +18 −19 examples/libtest/WithTest.py
  125. +1 −1  examples/libtest/builtin.py
  126. +7 −7 examples/lightout/lightout.py
  127. +3 −3 examples/mail/AboutDialog.py
  128. +4 −4 examples/mail/Contacts.py
  129. +9 −9 examples/mail/Logger.py
  130. +3 −3 examples/mail/Mail.py
  131. +1 −1  examples/mail/MailDetail.py
  132. +2 −2 examples/mail/MailItems.py
  133. +2 −2 examples/mail/MailList.py
  134. +2 −2 examples/mail/Mailboxes.py
  135. +14 −14 examples/maparea/MapAreaDemo.py
  136. +3 −3 examples/media/Media.py
  137. +84 −84 examples/minesweeper/minesweeper.py
  138. +1 −1  examples/misc/djangotasks/todo/views.py
  139. +3 −3 examples/misc/djangowanted/media/Popups.py
  140. +5 −5 examples/misc/djangowanted/media/WebPage.py
  141. +5 −5 examples/misc/djangowanted/media/WebPageEdit.py
  142. +4 −4 examples/misc/djangowanted/testjsonrpc.py
  143. +1 −1  examples/misc/djangowanted/wanted/forms.py
  144. +10 −10 examples/misc/djangowanted/wanted/jsonrpc.py
  145. +1 −1  examples/misc/djangowanted/wanted/views.py
  146. +3 −3 examples/misc/djangoweb/media/Email.py
  147. +3 −3 examples/misc/djangoweb/media/Popups.py
  148. +1 −1  examples/misc/djangoweb/media/WebPage.py
  149. +5 −5 examples/misc/djangoweb/media/WebPageEdit.py
  150. +4 −4 examples/misc/djangoweb/webpages/jsonrpc.py
  151. +1 −1  examples/misc/djangoweb/webpages/views.py
  152. +2 −2 examples/misc/flaskexamples/doc/do_it.py
  153. +11 −11 examples/misc/flaskexamples/flaskcelery/FLASKCELERYExample.py
  154. +1 −1  examples/misc/flaskexamples/flaskcelery/flask_source/celery_tasks.py
  155. +12 −12 examples/misc/flaskexamples/flaskcelery/flask_source/celery_views.py
  156. +2 −2 examples/misc/flaskexamples/flaskcelery/flask_source/celeryconfig.py
  157. +1 −1  examples/misc/flaskexamples/flaskcelery/flask_source/manage_celery.py
  158. +29 −29 examples/misc/flaskexamples/flaskcelery/flask_source/method_views.py
  159. +1 −1  examples/misc/flaskexamples/flaskcelery/public/services/EchoService.py
  160. +43 −43 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/__init__.py
  161. +13 −13 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/apacheServiceHandler.py
  162. +10 −10 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/cgihandler.py
  163. +3 −3 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/errors.py
  164. +2 −3 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/http.py
  165. +9 −9 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/proxy.py
  166. +16 −16 examples/misc/flaskexamples/flaskcelery/public/services/jsonrpc/socketserver.py
  167. +8 −8 examples/misc/flaskexamples/flaskcors/Flask_JSONRPC_CORS.py
  168. +1 −1  examples/misc/flaskexamples/flaskcors/public/services/EchoService.py
  169. +43 −43 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/__init__.py
  170. +13 −13 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/apacheServiceHandler.py
  171. +10 −10 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/cgihandler.py
  172. +3 −3 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/errors.py
  173. +2 −3 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/http.py
  174. +9 −9 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/proxy.py
  175. +16 −16 examples/misc/flaskexamples/flaskcors/public/services/jsonrpc/socketserver.py
  176. +38 −38 examples/misc/flowplayer/fp.py
  177. +12 −12 examples/misc/flowplayer/server.py
  178. +1 −1  examples/misc/gaedjangononrelpuremvcblog/__main__.py
  179. +29 −29 examples/misc/gaedjangononrelpuremvcblog/media/controller.py
  180. +100 −100 examples/misc/gaedjangononrelpuremvcblog/media/model.py
  181. +194 −194 examples/misc/gaedjangononrelpuremvcblog/media/view.py
  182. +28 −28 examples/misc/gaedjangononrelpuremvcblog/media/vo.py
  183. +4 −4 examples/misc/gaedjangononrelpuremvcblog/post/jsonrpc.py
  184. +1 −1  examples/misc/gaedjangononrelpuremvcblog/post/views.py
  185. +6 −6 examples/misc/scoping/Foo.py
  186. +2 −2 examples/misc/simplewiki/Wiki.py
  187. +2 −2 examples/misc/simplewiki/markdown.py
  188. +1 −1  examples/misc/simplewiki/server.py
  189. +12 −13 examples/misc/swfupload/server.py
  190. +24 −25 examples/misc/swfupload/swfu.py
  191. +3 −3 examples/navigate/Navigate.py
  192. +13 −13 examples/navigate/buoy.py
  193. +19 −19 examples/picasaweb/Photos.py
  194. +2 −2 examples/picasaweb/PicasaWeb.py
  195. +26 −26 examples/raphael/events.py
  196. +15 −15 examples/raphael/graffle.py
  197. +13 −13 examples/raphael/raphael_showcase.py
  198. +2 −2 examples/raphael/spinner.py
  199. +7 −7 examples/shell/Popups.py
  200. +3 −3 examples/shell/Screen.py
  201. +1 −1  examples/shell/Shell.py
  202. +2 −2 examples/shell/textconsole.py
  203. +31 −31 examples/showcase/pyColourize.py
  204. +2 −2 examples/showcase/src/demos_panels/formPanel.py
  205. +1 −1  examples/showcase/src/demos_panels/scrollPanel.py
  206. +1 −1  examples/showcase/src/demos_widgets/textArea.py
  207. +1 −1  examples/showcase/src/uiHelpers.py
  208. +5 −5 examples/slideshow/Slide.py
  209. +2 −2 examples/slideshow/Slideshow.py
  210. +45 −45 examples/splitpanel/SplitPanel.py
  211. +1 −1  examples/tabpanelwidget/Tabs.py
  212. +4 −4 examples/timerdemo/timerdemo.py
  213. +1 −1  examples/timesheet/__main__.py
  214. +2 −2 examples/timesheet/model/TimeProxy.py
  215. +1 −1  examples/timesheet/model/vo/TimeVO.py
  216. +1 −1  examples/timesheet/view/DatePickerMediator.py
  217. +1 −1  examples/timesheet/view/MenuMediator.py
  218. +1 −1  examples/timesheet/view/TimeGridMediator.py
  219. +1 −1  examples/timesheet/view/components/Grid.py
  220. +1 −1  examples/timesheet/view/components/Summary.py
  221. +5 −5 examples/timesheet/view/components/TimeGrid.py
  222. +8 −8 examples/toggle/Toggle.py
  223. +1 −1  examples/treeitemcheckbox/TreeItemTest.py
  224. +1 −1  examples/uitest/EventTest.py
  225. +1 −1  examples/uitest/UnitTest.py
  226. +2 −2 examples/uitest/uitest.py
  227. +5 −5 examples/uploader/AsyncUpload.py
  228. +2 −2 examples/uploader/Upload.py
  229. +16 −16 examples/widgets/Widgets.py
  230. +2 −2 examples/xmldoc/XMLload.py
  231. +14 −14 generate_stdlib.py
  232. +2 −2 library/__pyjamas__.py
  233. +9 −9 library/dynamic.py
  234. +3 −3 library/pygwt.browser.py
  235. +6 −6 library/pyjamas/Canvas/CanvasGradientImplDefault.py
  236. +6 −6 library/pyjamas/Canvas/CanvasGradientImplIE6.py
  237. +3 −3 library/pyjamas/Canvas/Color.py
  238. +2 −2 library/pyjamas/Canvas/ColorStop.py
  239. +1 −1  library/pyjamas/Canvas/GWTCanvas.ie6.py
  240. +1 −1  library/pyjamas/Canvas/GWTCanvas.mshtml.py
  241. +95 −95 library/pyjamas/Canvas/GWTCanvas.py
  242. +1 −1  library/pyjamas/Canvas/GWTCanvasImplDefault.hulahop.py
  243. +1 −1  library/pyjamas/Canvas/GWTCanvasImplDefault.py
  244. +1 −1  library/pyjamas/Canvas/GWTCanvasImplIE6.mshtml.py
  245. +7 −7 library/pyjamas/Canvas/GWTCanvasImplIE6.py
  246. +1 −1  library/pyjamas/Canvas/GradientFactoryImplDefault.py
  247. +1 −1  library/pyjamas/Canvas/HTML5Canvas.ie6.py
  248. +29 −29 library/pyjamas/Canvas/HTML5Canvas.py
  249. +18 −18 library/pyjamas/Canvas/HTML5CanvasImplDefault.py
  250. +19 −19 library/pyjamas/Canvas/HTML5CanvasImplIE6.py
  251. +7 −7 library/pyjamas/Canvas/ImageData.py
  252. +23 −23 library/pyjamas/Canvas/ImageLoader.py
  253. +22 −22 library/pyjamas/Canvas/ImageLoaderhulahop.py
  254. +1 −1  library/pyjamas/Canvas/JSOStack.mshtml.py
  255. +1 −1  library/pyjamas/Canvas/JSOStack.py
  256. +2 −2 library/pyjamas/Canvas/LinearGradientImplDefault.py
  257. +5 −5 library/pyjamas/Canvas/PathElement.py
  258. +4 −4 library/pyjamas/Canvas/RadialGradientImplDefault.py
  259. +9 −9 library/pyjamas/Canvas/RadialGradientImplIE6.py
  260. +111 −111 library/pyjamas/Canvas/SVGCanvas.py
  261. +6 −6 library/pyjamas/Canvas2D.browser.py
  262. +12 −12 library/pyjamas/Canvas2D.py
  263. +2 −2 library/pyjamas/Cookies.browser.py
  264. +1 −1  library/pyjamas/Cookies.py
  265. +10 −10 library/pyjamas/DOM.browser.py
  266. +3 −3 library/pyjamas/DOM.ie6.py
  267. +4 −4 library/pyjamas/DOM.mozilla.py
  268. +1 −1  library/pyjamas/DOM.mshtml.py
  269. +1 −1  library/pyjamas/DOM.oldmoz.py
  270. +2 −2 library/pyjamas/DOM.py
  271. +5 −5 library/pyjamas/DOM.pywebkitdfb.py
  272. +5 −5 library/pyjamas/DOM.pywebkitgtk.py
  273. +2 −2 library/pyjamas/DOM.safari.py
  274. +1 −1  library/pyjamas/EventController.py
  275. +1 −1  library/pyjamas/Factory.py
  276. +1 −1  library/pyjamas/HTTPRequest.browser.py
  277. +4 −4 library/pyjamas/HTTPRequest.hulahop.py
  278. +9 −9 library/pyjamas/HTTPRequest.py
  279. +8 −8 library/pyjamas/History.browser.py
  280. +1 −1  library/pyjamas/History.safari.py
  281. +21 −21 library/pyjamas/JSONService.py
  282. +1 −1  library/pyjamas/Location.browser.py
  283. +1 −1  library/pyjamas/Location.opera.py
  284. +19 −19 library/pyjamas/Location.py
  285. +1 −1  library/pyjamas/PyExternalMod.py
  286. +4 −4 library/pyjamas/Timer.mshtml.py
  287. +1 −1  library/pyjamas/Window.py
  288. +3 −3 library/pyjamas/builder/Builder.py
  289. +2 −2 library/pyjamas/builder/XMLFile.py
  290. +85 −85 library/pyjamas/builder/__init__.py
  291. +52 −52 library/pyjamas/chart/Annotation.py
  292. +26 −26 library/pyjamas/chart/AnnotationLocation.py
  293. +11 −11 library/pyjamas/chart/Axis.py
  294. +9 −9 library/pyjamas/chart/GChart.py
  295. +21 −21 library/pyjamas/chart/GChartWidgets.py
  296. +1 −1  library/pyjamas/chart/Point.py
  297. +250 −250 library/pyjamas/chart/Symbol.py
  298. +20 −20 library/pyjamas/chart/SymbolType.py
  299. +4 −4 library/pyjamas/chart/TickLocation.py
  300. +1 −1  library/pyjamas/chart/TouchedPointUpdateOption.py
Sorry, we could not display the entire diff because too many files (485) changed.
View
2  addons/CountryListBox.py
@@ -255,7 +255,7 @@ class CountryListBox(ListBox):
def __init__(self):
ListBox.__init__(self)
self.addCountries()
-
+
def addCountries(self):
for countryItem in self.country_list:
self.addItem(countryItem[0], countryItem[1])
View
18 addons/DeferredHandler.py
@@ -4,17 +4,17 @@
@contact: tobi-weber@gmx.de
"""
-from pyjamas.Timer import Timer
+from pyjamas.Timer import Timer
global deferredHandlers
deferredHandlers = []
global timerIsActive
-timerIsActive = False
-
+timerIsActive = False
+
def add(handler, arguments=[]):
deferredHandlers.append([handler, arguments])
maybeSetDeferredHandlerTimer()
-
+
def flushDeferredHandlers():
for i in range(len(deferredHandlers)):
current = deferredHandlers[0]
@@ -23,17 +23,17 @@ def flushDeferredHandlers():
handler = current[0]
args = current[1]
handler(*args)
-
+
def maybeSetDeferredHandlerTimer():
global timerIsActive
-
+
if (not timerIsActive) and (not len(deferredHandlers)==0):
Timer(1, onTimer)
timerIsActive = True
-
+
def onTimer(t):
global timerIsActive
-
+
flushDeferredHandlers()
timerIsActive = False
- maybeSetDeferredHandlerTimer()
+ maybeSetDeferredHandlerTimer()
View
493 addons/FlowPlayer.py
@@ -30,14 +30,14 @@ def fireEvent(self, *args):
if args[i] != None:
arguments.append(args[i])
wnd().players[args[0]].fireEvent(movieName, eventName, arguments)
-
+
def setInstanceGlobal(movieName, instance):
wnd().players[movieName] = instance
-
+
wnd().players = {}
wnd().flowplayer = PlayerEventCatcher()
-
-
+
+
# Counter for Flash-movies
global movieCount
movieCount = 0
@@ -48,9 +48,9 @@ def getMovieCount():
class Player(FlashPanel):
"""
- Embedding and api handling of Flowplayer
+ Embedding and api handling of Flowplayer
"""
-
+
clip_events = ['onBegin', 'onBeforeBegin', 'onFinish', 'onBeforeFinish', 'onLastSecond',
'onMetaData', 'onPause', 'onBeforePause', 'onResume', 'onBeforeResume',
'onSeek', 'onBeforeSeek', 'onStart', 'onStop', 'onBeforeStop', 'onUpdate',
@@ -63,7 +63,7 @@ def __init__(self, url, config=None):
"""
FlashPanel.__init__(self)
global movieCount
-
+
self.api = None
self.playlist = []
self.plugins = {}
@@ -72,12 +72,12 @@ def __init__(self, url, config=None):
self.common_clip = None
self.playlist = None
self.curClip = None
-
+
self.playerId = 'flowplayer'+str(movieCount)
self.movieName = self.playerId+'_api'
movieCount+=1
setInstanceGlobal(self.movieName, self)
-
+
#self.setObjectClass('flowplayer')
self.setObjectID(self.movieName)
self.setID(self.playerId)
@@ -101,17 +101,17 @@ def __init__(self, url, config=None):
plugin.setPlayer(self)
self.plugins['screen'] = plugin
self.flashvars = self.__createFlashVars(config)
-
+
def loadApi(self):
"""
Load the Flowplayer api
"""
self.api = self.getMovieElement()
-
+
def __getObjectAsString(self, obj):
"""
@param obj: Object
-
+
@return: String
"""
obj_string = '{'
@@ -132,21 +132,21 @@ def __getObjectAsString(self, obj):
i+=1
obj_string += '}'
return obj_string
-
+
def __createFlashVars(self, config):
"""
@param config: Configuration Object
-
+
@return: String
-
+
Build Flashparams from Configuration
"""
# Begin Config
config_string = 'config={'
-
+
# PlayerId
config_string += '"playerId":"%s",' % self.movieName
-
+
# Plugins
if config.plugins:
config_string += '"plugins":{'
@@ -163,8 +163,8 @@ def __createFlashVars(self, config):
if not config.controls and not controls:
config_string += ',"controls":null'
config_string += '},'
-
-
+
+
# Common Clip
config_string += '"clip":'
if config.common_clip:
@@ -172,7 +172,7 @@ def __createFlashVars(self, config):
config_string += ','
else:
config_string += '{},'
-
+
# Playlist
config_string += '"playlist":['
if config.playlist:
@@ -185,11 +185,11 @@ def __createFlashVars(self, config):
else:
config_string += '{}'
config_string += ']'
-
+
# Debug
if config.debug:
config_string += ',"debug":true,"log":{"level":"%s","filter":"%s"}' % (config.logLevel, config.logFilter)
-
+
# End Config
config_string += '}'
config_string = config_string.replace('%', 'pct')
@@ -200,11 +200,11 @@ def __createFlashVars(self, config):
config_string = config_string.replace('\'', '\\\'')
#log.debug(config_string)
return config_string
-
+
def fireEvent(self, movieName, eventName, arguments):
"""
@param args: Arguments given by Flowplayer
-
+
Fire event
"""
#log.debug('FireEvent: %s/%s/%s' % (movieName, eventName, str(arguments)))
@@ -257,23 +257,23 @@ def fireEvent(self, movieName, eventName, arguments):
if hasattr(listener, eventName):
eventMethod = getattr(listener, eventName)
DeferredHandler.add(eventMethod, arguments)
-
+
def addListener(self, listener):
"""
@param listener: Object
-
+
Add a listener
"""
self.listeners.append(listener)
-
+
def removeListener(self, listener):
"""
@param listener: Object
-
- Remove a listener
+
+ Remove a listener
"""
self.listeners.remove(listener)
-
+
def isLoaded(self):
"""
@return: Boolean, if the player is loaded
@@ -282,18 +282,18 @@ def isLoaded(self):
return True
else:
return False
-
+
# Flash ExternalInterface calls
-
+
def addClip(self, clip, index=None):
"""
@param clip: Clip Object
@param index: specifies the position where clip is added in the playlist
-
+
Add's a clip to the playlist. If the clip object contains a position
property then the clip is added to an existing clip as an instream clip.
The player's playlist is extended with the new clip and the onClipAdd event is fired.
- All common clip properties and event listeners are preserved.
+ All common clip properties and event listeners are preserved.
"""
if self.isLoaded():
if index:
@@ -302,25 +302,25 @@ def addClip(self, clip, index=None):
else:
self.playlist.append(clip)
self.callFlash('fp_addClip', [clip.getProperties()])
-
+
def setClip(self, clip):
"""
@param clip: Clip Object
-
+
Replaces the current playlist with a playlist consisting of a single clip.
All common clip properties and events are preserved.
- After this an onPlaylistReplace event fires.
+ After this an onPlaylistReplace event fires.
"""
if self.isLoaded():
self.setPlaylist([clip])
-
+
def getClip(self, index=None):
"""
- @param index: Position in the playlist
-
+ @param index: Position in the playlist
+
@return: clip object from the playlist specified by index.
-
- For example getClip(0) returns the first clip from the playlist.
+
+ For example getClip(0) returns the first clip from the playlist.
If called without an index the current clip will be returned.
"""
if self.isLoaded():
@@ -331,29 +331,29 @@ def getClip(self, index=None):
return self.playlist[index]
else:
return None
-
+
def getCurrentClip(self):
# TODO
return None
-
+
def close(self):
"""
- Closes all connections between the player and the server. This method
+ Closes all connections between the player and the server. This method
is usually automatically called for you but in some cases you may
want to do this yourself.
"""
if self.isLoaded():
self.callFlash('fp_close', [])
-
+
def getTime(self):
"""
- @return: current time, in seconds, of the current clip.
+ @return: current time, in seconds, of the current clip.
"""
if self.isLoaded():
return self.callFlash('fp_getTime', [])
else:
return None
-
+
def getVersion(self):
"""
@return: Flowplayer version
@@ -362,11 +362,11 @@ def getVersion(self):
return self.callFlash('fp_getVersion', [])
else:
return None
-
+
def getPlugin(self, name):
"""
@param name: Plugins name
-
+
@return: plugin with the given name
"""
if self.plugins.has_key(name):
@@ -374,11 +374,11 @@ def getPlugin(self, name):
return plugin
else:
return None
-
+
def loadPlugin(self, plugin):
"""
@param plugin: Plugin object
-
+
Loads a plugin in the player.
"""
if self.isLoaded():
@@ -386,7 +386,7 @@ def loadPlugin(self, plugin):
plugin.setPlayer(self)
self.plugins[plugin.name] = plugin
self.callFlash('fp_loadPlugin', [plugin.name, plugin.url, properties])
-
+
def getState(self):
"""
@return: state of the player. Possible values are:
@@ -402,7 +402,7 @@ def getState(self):
return self.callFlash('fp_getState', [])
else:
return -1
-
+
def getVolume(self):
"""
@return: player's current volume setting as an integer between 0-100.
@@ -412,45 +412,45 @@ def getVolume(self):
return self.callFlash('fp_getVolume', [])
else:
return None
-
+
def setVolume(self, volume):
"""
@param volume: Integer between 0-100
-
- Sets the volume. 0 is totally muted.
+
+ Sets the volume. 0 is totally muted.
"""
if self.isLoaded():
self.callFlash('fp_setVolume', [volume])
-
+
def isFullscreen(self):
"""
- @return: True if the player is in full screen mode and False otherwise.
+ @return: True if the player is in full screen mode and False otherwise.
"""
if self.isLoaded():
return self.callFlash('fp_isFullscreen', [])
else:
return None
-
+
def toggleFullscreen(self):
"""
- Toggles the state between fullscreen and normal mode.
-
+ Toggles the state between fullscreen and normal mode.
+
@return: True if the player is in full screen mode and False otherwise.
"""
if self.isLoaded():
return self.callFlash('fp_toggleFullscreen', [])
else:
return None
-
+
def isPaused(self):
"""
- @return: True if the player is paused and False otherwise.
+ @return: True if the player is paused and False otherwise.
"""
if self.isLoaded():
return self.callFlash('fp_isPaused', [])
else:
return None
-
+
def isPlaying(self):
"""
@return: True if the player is playing and False otherwise.
@@ -459,84 +459,84 @@ def isPlaying(self):
return self.callFlash('fp_isPlaying', [])
else:
return None
-
+
def mute(self):
"""
Mutes the player. The difference between this and setVolume(0) is that the
- original volume level is remembered and resumed when unmute() is called.
+ original volume level is remembered and resumed when unmute() is called.
"""
if self.isLoaded():
self.callFlash('fp_mute', [])
-
+
def unmute(self):
"""
- Resumes the volume level that was set before the player was muted.
+ Resumes the volume level that was set before the player was muted.
"""
if self.isLoaded():
self.callFlash('fp_unmute', [])
-
+
def pause(self):
"""
Pauses the currently playing clip.
"""
if self.isLoaded():
self.callFlash('fp_pause', [])
-
+
def play(self):
"""
- starts playback of the current clip.
+ starts playback of the current clip.
"""
if self.isLoaded():
self.callFlash('fp_play', [])
-
+
def playIndex(self, index):
"""
@param index: the zero-based index of the clip in the Player's playlist array.
-
+
Starts playback of the clip specified by index.
"""
if self.isLoaded():
self.callFlash('fp_play', [index])
-
+
def playClip(self, clip):
"""
- @param clip: Clip object
-
+ @param clip: Clip object
+
Plays the clip. The player's playlist is replaced with a new playlist
consisting of this single clip and the onPlaylistReplace event is fired.
- All common clip properties and event listeners are preserved.
+ All common clip properties and event listeners are preserved.
"""
if self.isLoaded():
self.playlist = [clip]
self.callFlash('fp_play', [clip.getProperties()])
-
+
def playClips(self, clips):
"""
@param clips: List of clips
-
+
Play the playlist specified by a List of clips. The player's playlist
is replaced with a new playlist consisting of these clips and the
onPlaylistReplace event is fired. All common clip properties and event
- listeners are preserved.
+ listeners are preserved.
"""
if self.isLoaded():
self.playlist = clips
self.callFlash('fp_play', [self.playlist])
-
+
def toggle(self):
"""
Toggles the state between play and pause.
"""
if self.isLoaded():
self.callFlash('fp_toggle', [])
-
+
def stop(self):
"""
Stops the current clip.
"""
if self.isLoaded():
self.callFlash('fp_stop', [])
-
+
def reset(self, pluginNames=None, speed=None):
"""
If you have moved your screen or controlbar, this call moves them back to
@@ -551,78 +551,78 @@ def reset(self, pluginNames=None, speed=None):
self.callFlash('fp_reset', [pluginNames])
else: # Reset Controls and Screens
self.callFlash('fp_reset', [])
-
+
def resume(self):
"""
Resumes the currently paused clip.
"""
if self.isLoaded():
self.callFlash('fp_resume', [])
-
+
def seek(self, seconds):
"""
Seeks to the specified time of the current clip, in seconds. If using
- default URL-based streaming provider then the buffer must have loaded
+ default URL-based streaming provider then the buffer must have loaded
to the point of seeking. When using streaming server this is not required.
"""
if self.isLoaded():
self.callFlash('fp_seek', [seconds])
-
+
def startBuffering(self):
"""
- Starts downloading video data from the server.
+ Starts downloading video data from the server.
"""
if self.isLoaded():
self.callFlash('fp_startBuffering', [])
-
+
def stopBuffering(self):
"""
- Stops downloading video data from the server.
+ Stops downloading video data from the server.
"""
if self.isLoaded():
self.callFlash('fp_stopBuffering', [])
-
+
def getPlaylist(self):
"""
- Returns the playlist of the player as a list of Clip objects.
+ Returns the playlist of the player as a list of Clip objects.
"""
return self.playlist
-
+
def setPlaylist(self, clips):
"""
@param clips: List of clips
-
+
Replaces the current playlist with a new one. The playlist is given
as a list of clips. All common clip properties are preserved.
- After this an onPlaylistReplace event fires.
+ After this an onPlaylistReplace event fires.
"""
if self.isLoaded():
self.playlist = clips
self.callFlash('fp_setPlaylist', [self.playlist])
-
+
def updateClip(self, clip):
"""
@param clip: clip object
-
+
Updates a clip, if the clip properties are changed
"""
if self.isLoaded():
index = self.playlist.index(clip)
self.callFlash('fp_updateClip', [clip.getProperties(), index])
-
+
def getScreen(self):
"""
@return: the screen plugin
"""
return self.getPlugin('screen')
-
+
def getControls(self):
"""
@return: the controls plugin
"""
return self.getPlugin('controls')
-
-
+
+
class Configuration:
"""
Defines the Startup Configuration of FlowPlayer
@@ -632,7 +632,7 @@ class Configuration:
@var logFilter: String
"""
def __init__(self):
- self.controls = True
+ self.controls = True
"""Boolean, if controls are enabled. Default: True"""
self.debug = False
"""Boolean, for debugging"""
@@ -640,32 +640,32 @@ def __init__(self):
""" Loglevel """
self.logFilter = '*'
""" Logfilter """
-
+
self.plugins = []
self.common_clip = Clip()
self.playlist = []
-
+
def addPlugin(self, plugin):
"""
@param plugin: Plugin object
"""
self.plugins.append(plugin)
-
+
def setCommonClip(self, clip):
"""
@param clip: Clip object
"""
self.common_clip = clip
-
+
def setPlaylist(self, playlist):
"""
@param playlist: List with Clips
"""
self.playlist = playlist
-
+
def disableControls(self):
self.controls = False
-
+
class Clip:
"""
Clip for the player
@@ -698,66 +698,66 @@ class Clip:
'urlResolver' # String
]
""" Possible Attributes for a Clip; Can be added with setAttr-Method """
-
+
def __init__(self, url=None):
self._player = None
self.listeners = []
if url:
setattr(self, 'url', url)
-
+
def setAttr(self, attr, value):
"""
@param attr: Properties name
@param value: Properties value
-
+
Sets a Property to this Object
"""
if attr in self.attrs:
setattr(self, attr, value)
self.update()
-
+
def setPlayer(self, player):
"""
@param player: Player Instance
"""
self._player = player
-
+
def getPlayer(self):
"""
@return: The player instance
"""
return self._player
-
+
def update(self):
"""
Updates this clip instance, if it is changed on runtime
"""
if self._player:
self._player.updateClip(self)
-
+
def addListener(self, listener):
"""
@param listener: Object
-
+
Add a listener
"""
self.listeners.append(listener)
-
+
def removeListener(self, listener):
"""
@param listener: Object
-
+
Remove a listener
"""
self.listeners.remove(listener)
-
+
def fireEvent(self, eventName, arguments):
for listener in self.listeners:
if hasattr(listener, eventName):
eventMethod = getattr(listener, eventName)
arguments.insert(0, self)
DeferredHandler.add(eventMethod, arguments)
-
+
def getProperties(self):
"""
@return: Dictonary with Properties
@@ -767,12 +767,12 @@ def getProperties(self):
if hasattr(self, attr):
properties[attr] = getattr(self, attr)
return properties
-
+
class Plugin:
"""
Base class for plugins
"""
-
+
attrs = ['url',
'bottom',
'height',
@@ -792,7 +792,7 @@ class Plugin:
'backgroundGradient',
'backgroundImage']
""" Possible Attributes for a Plugin; Can be added with setAttr-Method """
-
+
def __init__(self, url=None, name=None):
if url:
self.url = url
@@ -801,39 +801,39 @@ def __init__(self, url=None, name=None):
self._player = None
self.listeners = []
self.loaded = False
-
+
def setAttr(self, attr, value):
"""
@param attr: Properties name
@param value: Properties value
-
+
Sets a Property to this Object
"""
if attr in self.attrs:
setattr(self, attr, value)
-
+
def setPlayer(self, player):
"""
@param player: Player Instance
"""
self._player = player
-
+
def isLoaded(self):
"""
Returns a Boolean, if the plugin is loaded
"""
return self.loaded
-
+
def animate(self, properties, speed=500):
"""
- @param properties: Dictonary; the plugin's placement,
+ @param properties: Dictonary; the plugin's placement,
size and opacity properties that you want to animate
-
+
@param speed: Integer; specifies the duration of the animation, in milliseconds.
-
- animate() lets you change a plugin's position, size and opacity in an animated way.
+
+ animate() lets you change a plugin's position, size and opacity in an animated way.
This can give very cool effects on your web page.
- You can also do relative animations by prepending a "+=" or "-=" to the property
+ You can also do relative animations by prepending a "+=" or "-=" to the property
value to animate relative to the property's current value.
plugin.animate({width:'80%'})
"""
@@ -841,103 +841,103 @@ def animate(self, properties, speed=500):
if self.name:
callback = 'onAnimate'
self._player.callFlash('fp_animate', [self.name, properties, speed, callback])
-
+
def css(self, properties):
"""
@param properties: Dictonary
-
+
Changes the plugin's style and other properties immediately without animation.
- Change controlbar background color
+ Change controlbar background color
controls.css({backgroundColor:'#cccccc'})
"""
if self.loaded and self._player:
if self.name:
self._player.callFlash('fp_css', [self.name, properties])
-
+
def fadeIn(self, speed=500):
"""
@param speed: Integer; specifies the duration of the animation, in milliseconds.
-
+
Makes the plugin visible in an animated way by adjusting its opacity
- from the initial opacity to 100%. In typical scenarios the initial
- opacity is 0. This call will also set the plugin's display property
+ from the initial opacity to 100%. In typical scenarios the initial
+ opacity is 0. This call will also set the plugin's display property
to "block", making it visible if it was hidden.
"""
if self.loaded and self._player:
callback = 'onAnimate'
if self.name:
self._player.callFlash('fp_fadeIn', [self.name, speed, callback])
-
+
def fadeOut(self, speed=500):
"""
@param speed: Integer; specifies the duration of the animation, in milliseconds.
-
- Hides the plugin in an animated manner by adjusting its opacity from
- the initial opacity to 0%. This call will also set the plugin's display
+
+ Hides the plugin in an animated manner by adjusting its opacity from
+ the initial opacity to 0%. This call will also set the plugin's display
property to "none", removing it completely from the canvas.
"""
if self.loaded and self._player:
callback = 'onAnimate'
if self.name:
self._player.callFlash('fp_fadeOut', [self.name, speed, callback])
-
+
def fadeTo(self, opacity=100, speed=500):
"""
@param opacity: specifies the end opacity of the animation (0 - 100).
-
+
@param speed: Integer; specifies the duration of the animation, in milliseconds.
-
- Makes the plugin hidden in an animated manner by adjusting its opacity
+
+ Makes the plugin hidden in an animated manner by adjusting its opacity
from the initial opacity to the given opacity.
"""
if self.loaded and self._player:
callback = 'onAnimate'
if self.name:
self._player.callFlash('fp_fadeTo', [self.name, opacity, speed, callback])
-
+
def hide(self):
"""
- Immediately hides the plugin and removes it from the canvas.
- This is the same as setting the display property to "none".
- This does not affect the plugin's opacity setting.
+ Immediately hides the plugin and removes it from the canvas.
+ This is the same as setting the display property to "none".
+ This does not affect the plugin's opacity setting.
"""
if self.loaded and self._player:
if self.name:
self._player.callFlash('fp_hidePlugin', [self.name])
-
+
def show(self):
"""
- Makes the plugin immediately visible. This does not affect the plugin's
- opacity setting. This is the same as setting the display property to "block".
+ Makes the plugin immediately visible. This does not affect the plugin's
+ opacity setting. This is the same as setting the display property to "block".
"""
if self.loaded and self._player:
if self.name:
self._player.callFlash('fp_showPlugin', [self.name])
-
+
def toggle(self):
"""
- Toggles between the hidden and visible state.
+ Toggles between the hidden and visible state.
"""
if self.loaded and self._player:
if self.name:
self._player.callFlash('fp_togglePlugin', [self.name])
-
+
def addListener(self, listener):
"""
@param listener: object
-
+
Add a listener object
"""
self.listeners.append(listener)
-
+
def removeListener(self, listener):
"""
@param listener: object
-
+
Remove a listener object
"""
self.listeners.remove(listener)
-
+
def fireEvent(self, eventName):
"""
@param eventName: Name of the event
@@ -947,7 +947,7 @@ def fireEvent(self, eventName):
if hasattr(listener, eventName):
eventMethod = getattr(listener, eventName)
DeferredHandler.add(eventMethod, [self])
-
+
def getProperties(self):
"""
@return: Dictonary with properties of this instance
@@ -958,16 +958,16 @@ def getProperties(self):
if not attr == 'url':
properties[attr] = getattr(self, attr)
return properties
-
-
+
+
class ScreenPlugin(Plugin):
"""
The main screen
"""
-
+
def __init__(self):
Plugin.__init__(self, name='screen')
-
+
class ContentPlugin(Plugin):
@@ -977,16 +977,16 @@ class ContentPlugin(Plugin):
content_attrs = ['html',
'textDecoration',
'stylesheet',
- 'style',
+ 'style',
'closeButton',
'closeImage']
""" Additional Attributes for a ContentPlugin; Can be added with setAttr-Method """
-
+
def __init__(self, url=None, name=None):
Plugin.__init__(self, url, name)
self.attrs += self.content_attrs
""" Possible ContentPlugin Attributes """
-
+
def setHtml(self, html):
"""
@param html: Set the plugin's HTML content to the given string.
@@ -994,7 +994,7 @@ def setHtml(self, html):
if self.loaded:
if self.name:
self._player.callFlash('fp_invoke', [self.name, 'setHtml', html])
-
+
def append(self, html):
"""
@param html: append more HTML content to the end of the existing HTML.
@@ -1002,7 +1002,7 @@ def append(self, html):
if self.loaded:
if self.name:
self._player.callFlash('fp_invoke', [self.name, 'append', html])
-
+
def getHtml(self):
"""
@return: the current HTML content.
@@ -1012,13 +1012,13 @@ def getHtml(self):
if self.name:
html = self._player.callFlash('fp_invoke', [self.name, 'getHtml'])
return html
-
-
+
+
class ControlsPlugin(Plugin):
"""
The controlbar for the player
"""
-
+
control_attrs = ['timeColor',
'durationColor',
'progressColor',
@@ -1048,13 +1048,13 @@ class ControlsPlugin(Plugin):
'fullscreen',
'scrubber']
""" Additional Attributes for a ControlsPlugin; Can be added with setAttr-Method """
-
+
def __init__(self, url=None, name=None):
name = 'controls'
Plugin.__init__(self, url, name)
self.attrs += self.control_attrs
""" Possible ControlsPlugin Attributes """
-
+
def getDefaultProperties(self):
properties = {'autoHide': 'fullscreen', # never, always, fullscreen
'hideDelay': 4000,
@@ -1067,48 +1067,48 @@ def getDefaultProperties(self):
'fullscreen': True,
'scrubber': True
}
-
+
def enable(self, properties):
"""
@param properties: Dictionary
-
+
Enables and/or disables the controlbar widgets. Disabled widgets are greyed out.
- For example, this can be useful when you want to force the user to watch a
- video in the case of an advertisement. A value of all can be used to enable/disable
- all widgets at the same time. For example, enable({all: False}) will disable all widgets.
+ For example, this can be useful when you want to force the user to watch a
+ video in the case of an advertisement. A value of all can be used to enable/disable
+ all widgets at the same time. For example, enable({all: False}) will disable all widgets.
Example: properties = {play: False}
"""
if self.loaded:
if self.name:
self._player.callFlash('fp_invoke', [self.name, 'enable', properties])
-
+
def widgets(self, properties):
"""
@param properties: Dictionary
-
- Shows/hides the controlbar widgets.
- all can be used to enable/disable all widgets at the same time,
- for example, widgets({all: False}).
+
+ Shows/hides the controlbar widgets.
+ all can be used to enable/disable all widgets at the same time,
+ for example, widgets({all: False}).
Example: properties = {scrubber: False}
"""
if self.loaded:
if self.name:
self._player.callFlash('fp_invoke', [self.name, 'widgets', properties])
-
+
def tooltips(self, properties):
"""
@param properties: Dictionary
-
- Enables/disables tooltips. Use buttons:true or buttons:false to enable or disable all
- buttons at the same time, respectively. Specifying the value null disables the tooltip.
+
+ Enables/disables tooltips. Use buttons:true or buttons:false to enable or disable all
+ buttons at the same time, respectively. Specifying the value null disables the tooltip.
If you want to enable the buttons remember to add the buttons: True property as one parameter.
Example: properties = {buttons: True, play: 'Go'}
"""
if self.loaded:
if self.name:
self._player.callFlash('fp_invoke', [self.name, 'tooltips', properties])
-
-
+
+
class PseudostreamingPlugin(Plugin):
"""
Webserver video streaming plugin
@@ -1121,7 +1121,7 @@ def __init__(self, url=None, name=None):
if not url:
url = 'flowplayer.pseudostreaming.swf'
Plugin.__init__(self, url, name)
-
+
class AudioPlugin(Plugin):
"""
Audio plugin
@@ -1133,114 +1133,113 @@ def __init__(self, url=None):
if not url:
url = 'flowplayer.audio.swf'
Plugin.__init__(self, url, name)
-
-
+
+
class PlayerInterface:
"""
Player Events Interface
"""
def onBeforeClick(self): pass
-
+
def onLoaded(self): pass
def onBeforeLoaded(self): pass
-
+
def onUnload(self): pass
-
+
def onBeforeUnload(self): pass
-
+
def onKeypress(self, keycode): pass
-
+
def onBeforeKeypress(self, keycode): pass
-
+
def onVolume(self, volume): pass
-
+
def onBeforeVolume(self, volume): pass
-
+
def onMute(self): pass
-
+
def onBeforeMute(self): pass
-
+
def onUnmute(self): pass
-
+
def onBeforeUnmute(self): pass
-
+
def onFullscreen(self): pass
-
+
def onBeforeFullscreen(self): pass
-
+
def onFullscreenExit(self): pass
-
+
def onClipAdd(self, clip, index): pass
-
+
def onPlaylistReplace(self, clips): pass
-
+
def onError(self, code, message): pass
-
+
def onMouseOver(self): pass
-
+
def onMouseOut(self): pass
-
+
def onFirstPlaylistItem(self): pass
-
+
def onLastPlaylistItem(self): pass
-
-
+
+
class ClipInterface:
"""
Clip Events Interface
"""
def onBegin(self, clip): pass
-
+
def onBeforeBegin(self, clip): pass
-
+
def onFinish(self, clip): pass
-
+
def onBeforeFinish(self, clip): pass
-
+
def onLastSecond(self, clip): pass
-
+
def onMetaData(self, clip): pass
-
+
def onPause(self, clip): pass
-
+
def onBeforePause(self, clip): pass
-
+
def onResume(self, clip): pass
-
+
def onBeforeResume(self, clip): pass
-
+
def onSeek(self, clip, seconds): pass
-
+
def onBeforeSeek(self, clip, seconds): pass
-
+
def onStart(self, clip): pass
-
+
def onStop(self, clip): pass
-
+
def onBeforeStop(self, clip): pass
-
+
def onUpdate(self, clip): pass
-
- def onBufferEmpty(self, clip): pass
-
+
+ def onBufferEmpty(self, clip): pass
+
def onBufferFull(self, clip): pass
-
+
def onBufferStop(self, clip): pass
-
+
def onNetStreamEvent(self, clip): pass
-
-
+
+
class PluginInterface:
"""
Plugin Events Interface
"""
-
+
def onMouseOverPlugin(self, plugin): pass
-
+
def onMouseOutPlugin(self, plugin): pass
-
+
def onAnimatePlugin(self, plugin): pass
-
+
def onClickPlugin(self, plugin): pass
-
View
2  addons/RichTextEditor.py
@@ -32,7 +32,7 @@ def createFCK(name):
class RichTextEditor(Widget):
- def __init__(self, initialValue="", target="", method="POST",
+ def __init__(self, initialValue="", target="", method="POST",
basePath=None, **kwargs):
self.id = "rte" + str(hash(self))
View
342 addons/SWFUpload.py
@@ -16,24 +16,24 @@
class SWFUploadInstances:
-
+
def addInstance(self, movieName, instance):
setattr(self, movieName, instance)
-
+
class SWFUploadEventCatcher:
-
+
def __init__(self):
self.instances = SWFUploadInstances()
-
+
def addInstance(self, movieName, instance):
self.instances.addInstance(movieName, instance)
-
-# Global variable called by Flash External Interface
+
+# Global variable called by Flash External Interface
wnd().SWFUpload = SWFUploadEventCatcher()
-
+
def setInstanceGlobal(movieName, instance):
wnd().SWFUpload.addInstance(movieName, instance)
-
+
# Counter for Flash-movies
global movieCount
movieCount = 0
@@ -46,7 +46,7 @@ class SWFUpload(FlashPanel):
"""
Embedding and api handling of SWFUpload
"""
-
+
QUEUE_ERROR = {
'QUEUE_LIMIT_EXCEEDED' : -100,
'FILE_EXCEEDS_SIZE_LIMIT' : -110,
@@ -86,11 +86,11 @@ class SWFUpload(FlashPanel):
'TRANSPARENT' : "transparent",
'OPAQUE' : "opaque"
}
-
+
def __init__(self):
FlashPanel.__init__(self)
global movieCount
-
+
self.settings = None
self.eventQueue = []
self.setObjectClass('swfupload')
@@ -100,13 +100,13 @@ def __init__(self):
self.setWmode('window')
self.setMenu(False)
setInstanceGlobal(self.movieName, self)
-
+
def getSettings(self):
"""
@return: the settings instance
"""
return self.settings
-
+
def setSettings(self, settings):
"""
@param settings: An instance of Settings
@@ -116,11 +116,11 @@ def setSettings(self, settings):
self.setObjectWidth(self.settings.getButtonWidth())
self.setObjectHeight(self.settings.getButtonHeight())
self.flashvars = self.__createFlashVars()
-
+
def __createFlashVars(self):
httpSuccessString = ','.join(self.settings.http_success)
paramString = self.__buildParamString()
- vars = [
+ vars = [
"movieName=", quote(self.object_id),
"&uploadURL=", quote(self.settings.upload_url),
"&useQueryString=", quote(self.settings.use_query_string),
@@ -147,21 +147,21 @@ def __createFlashVars(self):
"&buttonCursor=", quote(self.settings.button_cursor)
]
return ''.join(vars)
-
+
def __buildParamString(self):
postParams = self.settings.post_params
paramStringPairs = []
for k,v in postParams:
paramStringPairs.append(quote(k) + "=" + quote(v))
return '&'.join(paramStringPairs)
-
+
def callFlash(self, functionName, arguments=[]):
"""
@param functionName: Methodname of ExternalInterface
@param arguments: List with arguments of ExternalInterfaces method
-
+
@return: the return value of ExternalInterfaces method.
-
+
Extended method from FlashPanel.
"""
returnValue = FlashPanel.callFlash(self, functionName, arguments)
@@ -171,11 +171,11 @@ def callFlash(self, functionName, arguments=[]):
except:
pass
return returnValue
-
+
def startUpload(self, file_id=None):
"""
@param file_id: The file id
-
+
startUpload causes the file specified by the file_id parameter to
start the upload process. If the file_id parameter is omitted
then the first file in the queue is uploaded.
@@ -184,102 +184,102 @@ def startUpload(self, file_id=None):
self.callFlash('StartUpload', [file_id])
else:
self.callFlash('StartUpload')
-
+
def cancelUpload(self, file_id, triggerErrorEvent=True):
"""
@param triggerErrorEvent: Boolean, Default: True
-
+
cancelUpload cancels the file specified by the file_id parameter.
The file is then removed from the queue.
"""
self.callFlash('CancelUpload', [file_id, triggerErrorEvent])
-
+
def stopUpload(self):
"""
stopUpload stops and re-queues the file currently being uploaded.
"""
self.callFlash('StopUpload')
-
+
def getFileByIndex(self, index):
"""
@param index: The file index in the queue
-
+
@return: retrieve a File Object from the queue by the file index.
"""
return self.callFlash('GetFileByIndex', [index])
-
+
def getFile(self, file_id):
"""
@param file_id: The file id
-
+
@return: retrieve a File Object from the queue by the file id
"""
return self.callFlash('GetFile', [file_id])
-
+
def addFileParam(self, file_id, name, value):
"""
@param file_id: The file id
@param name: Name of the parameter
@param value: Value of the parameter
-
+
The addFileParam function adds a name/value pair that will be sent in the POST
with the file specified by the file_id parameter.
- The name/value pair will only be sent with the file it is added to.
+ The name/value pair will only be sent with the file it is added to.
"""
self.callFlash('AddFileParam', [file_id, name, value])
-
+
def removeFileParam(self, file_id, name):
"""
@param file_id: The file id
@param name: Name of the parameter
-
+
The removeFileParam function removes a name/value pair from a file upload that
was added using addFileParam.
"""
self.callFlash('RemoveFileParam', [file_id, name])
-
+
def setUploadURL(self, url):
"""
@param url: The upload url
-
+
Dynamically modifies the upload_url setting.
"""
self.callFlash('SetUploadURL', [url])
-
+
def setPostParams(self, paramsDict):
"""
@param paramsDict: Dictonary with parameters
-
+
Dynamically modifies the post_params setting.
- Any previous values are over-written.
+ Any previous values are over-written.
"""
self.callFlash('SetPostParams', [paramsDict])
-
+
def addPostParam(self, name, value):
"""
@param name: Name of the parameter
@param value: Value of the parameter
-
+
The addPostParam function adds a name/value pair that will be
sent in the POST for all files uploaded.
"""
self.settings.addPostParam(name, value)
self.setPostParams(self.settings.post_params)
-
+
def removePostParam(self, name):
"""
@param name: Name of the parameter
-
+
The removePostParam function removes a name/value pair from the
values sent with the POST for file uploads.
"""
self.settings.removePostParam(name)
self.setPostParams(self.settings.post_params)
-
+
def setFileSizeLimit(self, fileSizeLimit):
"""
@param fileSizeLimit: Limit of the size for files
-
+
Dynamically modifies the file_size_limit setting. This applies to
all future files that are queued. The file_size_limit parameter will
accept a unit. Valid units are B, KB, MB, and GB. The default unit is KB.
@@ -288,70 +288,70 @@ def setFileSizeLimit(self, fileSizeLimit):
"""
self.settings.fiel_size_limit = fileSizeLimit
self.callFlash('SetFileSizeLimit', [fileSizeLimit])
-
+
def setFileUploadLimit(self, fileUploadLimit):
"""
@param fileSizeLimit: Limit of the size for a upload
-
- Dynamically modifies the file_upload_limit setting.
+
+ Dynamically modifies the file_upload_limit setting.
The special value zero (0) indicates "no limit".
"""
self.settings.file_upload_limit = fileUploadLimit
self.callFlash('SetFileUploadLimit', [fileUploadLimit])
-
+
def setFileQueueLimit(self, fileQueueLimit):
"""
@param fileSizeLimit: Limit of the size for a queue
-
+
Dynamically modifies the file_queue_limit setting.
The special value zero (0) indicates "no limit".
"""
self.settings.file_queue_limit = fileQueueLimit
self.callFlash("SetFileQueueLimit", [fileQueueLimit])
-
+
def setFilePostName(self, filePostName):
"""
@param filePostName: The file post name
-
+
Dynamically modifies the file_post_name setting.
The Linux Flash Player ignores this setting.
"""
self.settings.file_post_name = filePostName
self.callFlash("SetFilePostName", [filePostName])
-
+
def setButtonDisabled(self, isDisabled):
"""
@param isDisable: Boolean to enable/disable the button
-
+
When 'true' changes the Flash Button state to disabled and ignores any clicks.
"""
self.settings.button_disabled = isDisabled
self.callFlash("SetButtonDisabled", [isDisabled])
-
+
def setButtonAction(self, buttonAction):
"""
@param buttonAction: button action
-
+
Sets the action taken when the Flash button is clicked.
Valid action values are taken from the BUTTON_ACTION dict.
"""
self.settings.button_action = buttonAction
self.callFlash("SetButtonAction", [buttonAction])
-
+
def setButtonCursor(self, cursor):
"""
- @param cursor: mouse cursor
-
+ @param cursor: mouse cursor
+
Sets the mouse cursor shown when hovering over the Flash button.
Valid cursor values are taken from the CURSOR dict.
"""
self.settings.button_cursor = cursor
self.callFlash("SetButtonCursor", [cursor])
-
+
def setButtonText(self, html):
"""
@param html: Html-text for the button
-
+