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

2:00 PM
@Mahesh unitttest.py, right?
 
git clone it happily. I'm granting you write access
 
jrg
Where.
i'm looking
 
@AmithKK yup.
 
jrg
can't find anything.
 
jrg
2:01 PM
cloning
so what needs testing here.
 
look at unittest.py
there is a method in there. def test_reset_blablabla
 
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
2:05 PM
@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
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
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
2:09 PM
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
 
2:11 PM
people play with fire alarm often here.
 
xD
 
We don't have fire alarms in our school
 
jrg
that command is almost useless @Mahesh :p
 
@AmithKK lucky us
in case of fire, we are safe \o/
 
2:11 PM
what??? :/
okay. remove pastebinit and see what it spits out.
it should spit out a whole bunch of things.
 
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
 
2:13 PM
ok, where are we?
 
looks like lordoftime caused @jokerdino's fire alarm to go off
:P
 
:P
 
hiya!
 
o.O
what brought you here?
 
Me
 
2:14 PM
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
syntax error
 
2:21 PM
wut
 
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
2:24 PM
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
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.
 
hm
 
2:26 PM
@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
whoa
thats a lot ooooooofffff keeeeys.
 
2:29 PM
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
thats your whole compiz config
 
@Mahesh iteritems()
 
2:30 PM
@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
 
2:32 PM
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.
 
2:34 PM
@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?
 
2:36 PM
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
ignoreme
 
2:37 PM
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
with your favorite editor
 
2:38 PM
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
 
2:43 PM
I remember merge conflicts being my nightmares. :P
git pull again to see if its the latest.
 
yess
 
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
 
2:47 PM
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
2:51 PM
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
 
2:52 PM
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
 
2:54 PM
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
 
2:55 PM
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.
 
2:58 PM
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.
 
3:00 PM
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. :/
 
3:05 PM
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.
 
3:06 PM
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.
 
3:09 PM
okay
 
3:21 PM
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.
 
3:28 PM
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
 
3:34 PM
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
 
3:42 PM
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
 
4:01 PM
@jokerdino nope. not needed.
@jokerdino ?
 

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