Skip to content

Instantly share code, notes, and snippets.

View valera-rozuvan's full-sized avatar
💻
coding

Valera Rozuvan valera-rozuvan

💻
coding
View GitHub Profile
-*- mode: grep; default-directory: "~/devstack8/edx-platform/" -*-
Grep started at Wed Apr 2 17:53:26
grep -i -r "ngettext" .
./cms/static/xmodule_js/common_static/coffee/src/discussion/views/discussion_content_view.coffee: ngettext(
./cms/static/xmodule_js/common_static/coffee/src/discussion/views/discussion_content_view.coffee: ngettext(
./cms/static/xmodule_js/common_static/coffee/src/discussion/views/discussion_thread_list_view.coffee: ngettext('%(unread_count)s new comment', '%(unread_count)s new comments', unreadCount),
./cms/static/xmodule_js/common_static/coffee/src/discussion/views/discussion_thread_view.coffee: ngettext(
./cms/static/xmodule_js/common_static/coffee/src/discussion/views/discussion_thread_view.coffee: ngettext(
./cms/static/xmodule_js/common_static/js/src/jquery.timeago.locale.js: minutes: function(value) { return ngettext("%d minute", "%d minutes", value)},
@valera-rozuvan
valera-rozuvan / gist:9936587
Created April 2, 2014 15:36
addAjaxPrefix
-*- mode: grep; default-directory: "~/devstack8/edx-platform/" -*-
Grep started at Wed Apr 2 18:35:17
grep -i -r "addAjaxPrefix" .
./cms/static/coffee/src/main.coffee: AjaxPrefix.addAjaxPrefix jQuery, ->
./cms/static/xmodule_js/common_static/coffee/src/ajax_prefix.coffee: addAjaxPrefix: (jQuery, prefix) ->
./cms/static/xmodule_js/common_static/js/test/add_ajax_prefix.js:// Tests require that addAjaxPrefix is called
./cms/static/xmodule_js/common_static/js/test/add_ajax_prefix.js:AjaxPrefix.addAjaxPrefix($, function () {
./common/lib/xmodule/xmodule/js/common_static/coffee/src/ajax_prefix.coffee: addAjaxPrefix: (jQuery, prefix) ->
./common/lib/xmodule/xmodule/js/common_static/js/test/add_ajax_prefix.js:// Tests require that addAjaxPrefix is called
@valera-rozuvan
valera-rozuvan / gist:9950409
Created April 3, 2014 08:15
Error for screenshot_number variable when trying to save a screenshot
<Step: "And I select the "2.0" speed on video "B"">
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/src/lettuce/lettuce/core.py", line 144, in __call__
ret = self.function(self.step, *args, **kw)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/features/video.py", line 336, in change_video_speed_on_video
change_video_speed(speed)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/features/video.py", line 207, in inner
world.browser.driver.save_screenshot("{0:03d}".format(screenshot_number) + "__" + func.func_name + "__BEFORE.png")
UnboundLocalError: local variable 'screenshot_number' referenced before assignment
@valera-rozuvan
valera-rozuvan / gist:9975087
Created April 4, 2014 13:49
Error when I run specific test
Doing a:
rake test:acceptance:lms["lms/djangoapps/courseware/features/video.feature -s 9"]
passes the test, but there are errors in the Python console:
2014-04-04 09:44:22,744 ERROR [edx.discussion] Could not create comments service user with id 1
Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/common/djangoapps/student/models.py", line 878, in create_comments_service_user
cc_user.save()
@valera-rozuvan
valera-rozuvan / gist:10017776
Created April 7, 2014 10:16
How git cleans files upon rake test:acceptance ...
When you run
rake test:acceptance ...
then the following shell command is executed
git clean -fqdx test_root/logs test_root/data test_root/staticfiles test_root/uploads
@valera-rozuvan
valera-rozuvan / gist:10018448
Created April 7, 2014 11:13
How to add a decorator so that screenshots are taken before and after a function
def print_jpg(func):
def inner(*args, **kwargs):
world.browser.driver.save_screenshot(func.func_name + '.jpg')
return func(*args, **kwargs)
return inner
@print_jpg
def change_video_speed(speed):
world.browser.execute_script("$('.speeds').addClass('open')")
@valera-rozuvan
valera-rozuvan / gist:10105375
Created April 8, 2014 09:50
Error when running rake test:acceptance:lms["lms/djangoapps/courseware/features/video.feature -s 26"]
./manage.py lms --settings acceptance migrate --traceback --noinput
Traceback (most recent call last):
File "./manage.py", line 91, in <module>
startup.run()
File "/edx/app/edxapp/edx-platform/lms/startup.py", line 21, in run
autostartup()
File "/edx/app/edxapp/edx-platform/common/lib/django_startup.py", line 15, in autostartup
mod = import_module(app + '.startup')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
@valera-rozuvan
valera-rozuvan / gist:10111639
Created April 8, 2014 11:25
Error while trying to bring up local dev Vagrant
$ cd devstack9/
$ curl https://raw.github.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2746 100 2746 0 0 5011 0 --:--:-- --:--:-- --:--:-- 6035
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'himbasha-devstack' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
@valera-rozuvan
valera-rozuvan / gist:10283848
Created April 9, 2014 15:35
Error when running acceptance tests
$ rake test:acceptance:lms["lms/djangoapps/courseware/features/video.feature"]
...
<Step: "And I see duration "1:00"">
Traceback (most recent call last):
File "/edx/app/edxapp/venvs/edxapp/src/lettuce/lettuce/core.py", line 144, in __call__
ret = self.function(self.step, *args, **kw)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/features/video.py", line 531, in i_see_duration
assert duration() == parse_time_str(position)
For video http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 I try to upload transcript file (see below) and I get the following errors in Python console:
[11/Apr/2014 10:05:24] "GET /xblock/private.01.2014_T1/branch/draft/block/video055/studio_view HTTP/1.1" 200 39411
[11/Apr/2014 10:05:24] "GET /static/c0110c2/js/views/video/transcripts/editor.js HTTP/1.1" 200 9048
[11/Apr/2014 10:05:24] "GET /transcripts/check?data=%7B%22locator%22%3A%22private.01.2014_T1%2Fbranch%2Fdraft%2Fblock%2Fvideo055%22%2C%22videos%22%3A%5B%7B%22mode%22%3A%22html5%22%2C%22video%22%3A%22big_buck_bunny%22%2C%22type%22%3A%22mp4%22%7D%5D%7D HTTP/1.1" 200 244
[11/Apr/2014 10:05:32] "POST /transcripts/upload HTTP/1.1" 400 32
And the following in JavaScript console:
http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4