« first day (3 days earlier)      last day (150 days later) » 

14:00
@Mahesh unitttest.py, right?
git clone it happily. I'm granting you write access
jrg
jrg
Where.
i'm looking
@AmithKK yup.
jrg
jrg
can't find anything.
jrg
jrg
14:01
cloning
so what needs testing here.
look at unittest.py
there is a method in there. def test_reset_blablabla
jrg
jrg
gotcha
test_reset_display_recent_apps
write as many as you can on similar lines.
add more methods.
all should start with test_something
@jrg can you list all the schemas under com.canonical.Unity
/me not on 12.10. :/
jrg
jrg
14:05
@AmithKK what is the command for that?
gsettings list-schemas com.canonical.Unity
or try list-children
or try gsettings list-schemas |grep com.canonical.Unity
jrg
jrg
com.canonical.Unity.Dash
com.canonical.Unity
com.canonical.Unity.FilesLens
com.canonical.Unity.Runner
com.canonical.Unity.Devices
com.canonical.Unity.ApplicationsLens
com.canonical.Unity.Panel
com.canonical.Unity.Launcher
com.canonical.Unity.Lenses
and then we need the keys. :P
jrg
jrg
gsettings list-keys com.canonical.Unity
form-factor
home-expanded
minimize-count
minimize-fast-duration
minimize-slow-duration
minimize-speed-threshold
gsettings list-keys com.canonical.Unity.ApplicationsLens
display-available-apps
display-recent-apps
gsettings list-keys com.canonical.Unity.Dash
home-lens-ordering
@jrg python -c 'import unityreset;print unityreset.UnityReset.snapshotCompizPlugins();print unityreset.UnityReset.snapshotUnityChildren()' |pastebinit
jrg
jrg
14:09
gsettings list-keys com.canonical.Unity.Devices
blacklist
stupid people playing with fire alarm
safe from fire @jokerdino?
there is no darn fire
I know that feeling. :P
DO THEY NOT UNDERSTAND THAT THEY ARE MESSING WITH IMPORTANT UNITY CODE?
2
14:11
people play with fire alarm often here.
We don't have fire alarms in our school
jrg
jrg
that command is almost useless @Mahesh :p
@AmithKK lucky us
in case of fire, we are safe \o/
14:11
what??? :/
okay. remove pastebinit and see what it spits out.
it should spit out a whole bunch of things.
jrg
jrg
{'org.compiz.firepaint': {'clear-button': Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py", line 182, in __repr__
return "GLib.Variant('%s', %s)" % (self.format_string, self.print_(True))
AttributeError: 'Variant' object has no attribute 'format_string'
aaaarrrrggggghhhhhh
Ah
its a bug
someone write a loop to explicitly print all stuff in there.
We had that
14:13
ok, where are we?
looks like lordoftime caused @jokerdino's fire alarm to go off
:P
o.O
what brought you here?
14:14
an invite by Amith
in Ask Ubuntu General Room, 11 mins ago, by Lord of Time
THE BANNER ON THE SITE IS WRONG AND MUST BE BURNED WITH FIRE
sorry, had to.
this is a secret dark templar knights' chat room
#!/usr/bin/python
import unityreset

compizPlugins=unityreset.UnityReset.snapshotCompizPlugins()
unityChildren=unityreset.UnityReset.snapshotUnityChildren()

for schema,keydict in compizPlugins:
    print "---",schema,"---"
    for key,value in keydict:
    print key," : ",value
for schema,keydict in unityChildren:
    print "---",schema,"---"
    for key,value in keydict:
    print key," : ",value
@jokerdino @jrg ^^ try that and if you get some output, pastebinit
on it
jrg
jrg
syntax error
14:21
wut
jrg
jrg
Traceback (most recent call last):
File "./getgsettings.py", line 7, in <module>
for schema,keydict in compizPlugins:
ValueError: too many values to unpack
@jokerdino just tab that and line 14
yeah, just fixed it
too many values? :/
2
Q: Python ValueError: too many values to unpack

NikI am getting that exception from this code: class Transaction: def __init__ (self): self.materials = {} def add_material (self, m): self.materials[m.type + m.purity] = m def serialize (self): ser_str = 'transaction_start\n' for k, m in self.material...

try that :D
.iteritems() then
at end of each for
jrg
jrg
14:24
i'm lost.
#!/usr/bin/python
import unityreset

compizPlugins=unityreset.UnityReset.snapshotCompizPlugins()
unityChildren=unityreset.UnityReset.snapshotUnityChildren()

for schema,keydict in compizPlugins.iteritems():
    print "---",schema,"---"
    for key,value in keydict.iteritems():
        print key," : ",value
for schema,keydict in unityChildren.iteritems():
    print "---",schema,"---"
    for key,value in keydict.iteritems():
        print key," : ",value
jrg
jrg
ah yes, firepaint. :D
@jokerdino That, is the list of all keys we reset.
along with their default values if you haven't changed them.
14:26
@AmithKK happy?
:D
Oh my god
though some formatting would have helped. :P
We need one test per key?
hahahah. nope.
pick a few at random and test.
may be 10.
one test per key would be both awesome and insane.
jrg
jrg
whoa
thats a lot ooooooofffff keeeeys.
14:29
and I'm resetting all of them, buddy. :D
oh buddy
wait...,. 1198 lines of output ????? o.O
@Mahesh or we can write a program to write a test for every key?
jrg
jrg
thats your whole compiz config
@Mahesh iteritems()
14:30
@AmithKK lol good. :D :P
@jokerdino ?
'twas a joke
actually, we need to set a nondefault value and reset and then compare against default.
so, scripting is not possible buddy. :P
good job buddy
write a bunch of tests, now, everyone.
okay sir
now fix whatever i wrote earlier
14:32
what did you write earlier?
or not
def test_staticschema(self):
        gsettings=Gio.Settings("com.canonical.Unity.ApplicationsLens")
        if "display-recent-apps" in gsettings.list_keys():
            if gsettings.get_boolean("display-recent-apps") is True:
            #print "Unsetted default"
                gsettings.set_boolean("display-recent-apps",False)
        unityreset.UnityReset()
        key=gsettings.get_boolean("display-recent-apps")
        self.assertTrue(key==True)
I guess I fixed and provided a template.
git pull origin master and see whats inside.
fix conflicts blah
For what should I write tests for
@AmithKK pick a couple keys at random, and write methods for them.
14:34
@Mahesh what's inside?
i can't find a unittest.py
you merged?
Power is down
bbl
cya
dont know
@jokerdino when you git pulled, it automerged or gave you conflict?
14:36
conflict
did you resolve them?
dont think so
git status
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 7 commits.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	faketest.py
#	file.py
#	unityreset.pyc
nothing added to commit but untracked files present (use "git add" to track)
jrg
jrg
ignoreme
14:37
okay. open each one in turn.
up to date
you'll have conflict markers in them
edit, save, and commit and push
open how?
vim or gedit or however you do
jrg
jrg
with your favorite editor
14:38
and rm that pyc file.
jeez
i am starting all over
ok done. what next?
git pull again please.
I've fixed the mess.
i threw away my git :P
git clone then :P
all done
14:43
I remember merge conflicts being my nightmares. :P
git pull again to see if its the latest.
now openup unityunittests.py
$ python unityunittests.py
E
======================================================================
ERROR: test_reset_display_recent_apps (__main__.TestUnityReset)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "unityunittests.py", line 18, in test_reset_display_recent_apps
    default=unityChildren[schema][key]
NameError: global name 'unityChildren' is not defined

----------------------------------------------------------------------
i fixed a couple of indentation
pushed?
ok pushed
14:47
back
git pull everyone.
and @jokerdino test again. if it passes, we'll proceed.
ok pass
great.
now you have a template to work with.
populate more methds.
yippie
ok give me more methods
@AmithKK git pull before you proceed please..
@jokerdino write them.
jrg
jrg
14:51
nice one
@Mahesh i mean, stuff other than boolean how?
look at the source.
source of your unit test?
yup
hm, tell me how to for string array
14:52
the only place you care about the type is when setting.
that's what i am talking about
so use the appropriate set_xyz method there. rest all is same.
> gsettings.set_boolean(key,False)
it won't work for string array
but i'll try for ya
are we resetting the launcher items too?
or is that another call?
strv
okay then
14:54
set_strv(key,['abc','def'])
try that
ok thanks
@jrg you can jump in now. :D
@AmithKK you there?
i am doing for runner
I'll go have my dinner.
@Mahesh yes
14:55
ok cya
@AmithKK I committed couple fixes. git pull and get to writing methods.
all tests go as methods in the same class, same format.
@Mahesh Ok, now for org.compiz.scale and key opacity I have to use what?
set_int
  def test_reset_display_recent_apps(self):
        schema="org.compiz.scale"
        key="opacity"
        default=self.unityChildren[schema][key]
        gsettings=Gio.Settings(schema)
        gsettings.set_int(key,200)
        unityreset.UnityReset(False)
        current=gsettings.get_value(key)
        self.assertTrue(current==default)
like that?
boolset_boolean(key, value)

boolset_double(key, value)

boolset_enum(key, value)

boolset_flags(key, value)

boolset_int(key, value)

boolset_string(key, value)

boolset_strv(key, value)

boolset_uint(key, value)

boolset_value(key, value)
@AmithKK yup. just change the method name. :P
and I guess opacity goes from 0 to 100.
14:58
ok wrote for runner and pass
keep on adding methods and testing them. If you dont change same lines, git pull should intelligently merge.
.
======================================================================
FAIL: test_reset_display_recent_apps (__main__.TestUnityReset)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "unityunittests.py", line 23, in test_reset_display_recent_apps
    self.assertTrue(current==default)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 2 tests in 0.544s

FAILED (failures=1)
hm
@jokerdino using the updated one?
what?
use get_value always.
15:00
you updated when?
not after you last pulled.
it is failing for your code
see if its get_boolean or get_value in that.
def test_reset_display_recent_apps(self):
        schema="com.canonical.Unity.ApplicationsLens"
        key="display-recent-apps"
        default=self.unityChildren[schema][key]
        gsettings=Gio.Settings(schema)
        gsettings.set_boolean(key,False)
        unityreset.UnityReset(False)
        current=gsettings.get_value(key)
        self.assertTrue(current==default)
this is whats in the file, right?
def test_reset_display_recent_apps(self):
        schema="com.canonical.Unity.ApplicationsLens"
        key="display-recent-apps"
        default=self.unityChildren[schema][key]
        gsettings=Gio.Settings(schema)
        gsettings.set_boolean(key,False)
        unityreset.UnityReset(False)
        current=gsettings.get_value(key)
        self.assertTrue(current==default)

    def test_runner(self):
        schema="com.canonical.Unity.Runner"
        key="history"
        default=self.unityChildren[schema][key]
:/
that should pass, and you said earlier it passed. :/
15:05
it didn't actually.
standalone, yes.
standalone as in?
only the first def
you go for dinner. i'll debug
Do I see a def inside a def?
yuck
yes
all tests go as methods directly inside the class.
use 4 spaces to indent. No tabs please.. they screw up things like anything.
15:06
i am not sure. it looks fine here
@Mahesh i set tab to 4 spaces here
as in replace tabs with 4 spaces or show tabs as equivalent to 4 spaces? :P
okay. try debugging. I need food.
replace tab with 4 space in vim
/me running
Traceback (most recent call last):
  File "unityunittests.py", line 33, in test_runner
    self.assertTrue(current==default)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 1 test in 0.316s

FAILED (failures=1)
ok bug with my code :)
do a reset, run listall.py and see whats the default.
then change.
15:09
okay
15:21
i have gotten an okay
the tests are not relilable.
i got a double okay, and then false as well
how can that be?
no idea
if i complete reset and then test, i get a double okay. if i proceed then onwards, i don't get a clean okay
you have to start with a default config.
why is that?
oh auto test
thats how tests are done.
15:28
okay.
and if you want unity to pick up the changes and reload, change unityreset.UnityReset(False) to True
but then you cant see the tests output easily since unity produces lots of output while reloading
i don't mind a false rset
so, if i want a full okay, i should reset everytime?
So, is it dev time yet?
@jokerdino yup.
which is by running unityreset.py
15:34
yup.
zzz okay
actually, wait...
it should still be giving you the proper output.
okay at all times.
exactly
because in unittest, we do reset.
okay. change that False to True and see if that affects things?
should i wait long time for it to apply the changes?
we should be using .sync () :(
we keep failing
15:42
try using .sync()
trying
fail
i am guessing bug with my part of the code
should i remove that .pyc everytime?
ok found the problem
calling the python too soon errs out
16:01
@jokerdino nope. not needed.
@jokerdino ?

« first day (3 days earlier)      last day (150 days later) »