« first day (1 day earlier)      last day (152 days later) » 
07:00 - 11:0013:00 - 00:00

7:11 AM
We need a way to get the list of plugins so that hard-coding can be avoided.
 
7:27 AM
hey
i was thinking we can get a list of children and then get a list of keys in that and reset them all
 
8:20 AM
@jokerdino here
 
heiz
 
Lot of activity. :P :D
 
:P
why no use github?
bitbucket is messy
 
yup. too bad it started out on bitbucket.
should I copy the repo now?
 
nvr mind. let's get the job done
 
8:22 AM
okay.
only one thing remains.
 
testing?
 
get a list of plugins without hardcoding them
@jokerdino testing done, and it works.
 
i told you to grab a list of children and the keys in that.
 
okay
 
8:24 AM
now, I need to get rid of that plugins list.
 
i see.
 
pick it up by scanning whats there, instead of supplying my own list.
 
good idea
 
and I need a dirty trick for that.
 
which would be?
 
8:25 AM
....
 
:D
 
yet to be discovered.
 
let me dig
gsettings list-relocatable-schemas | grep compiz
org.compiz.session
org.compiz.scaleaddon
org.compiz.core
org.compiz.clone
org.compiz.ring
org.compiz.scale
org.compiz.composite
org.compiz.screenshot
org.compiz.mblur
org.compiz.workarounds
org.compiz.animation
org.compiz.shift
org.compiz.winrules
org.compiz.opengl
org.compiz.water
org.compiz.fade
org.compiz.mousepoll
org.compiz.gnomecompat
org.compiz.grid
org.compiz.shelf
org.compiz.unitydialog
org.compiz.opacify
org.compiz.obs
org.compiz.cube
org.compiz.annotate
use that one maybe?
 
I'm thinking on similar lines.
 
okay then.
 
8:28 AM
from gi.repository import Gio

allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
print allSchemas,allRelocatableSchemas
 
it lists the whole package
 
now, we should observer the output, craft a regexp, and bang.. update the script.
 
yep, regex
split allSchemas and allRe..Schemas
then run a regex on the latter and look for compiz
 
print only allSchemas and grep compiz
 
yes that.
 
8:30 AM
@jokerdino regexps can act on lists directly i guess.
 
i wouldn't konw.
 
python implementations, I'll take care of that.
 
alright then.
 
1 min ago, by Mahesh
print only allSchemas and grep compiz
see if we have anything.
and repeat with only allRelocatableSchemas
 
yeah
yes and yes
wait, for allSchemas, it prints everything.
not just unity specific
unity specific comes in com.canonical.Unity
 
8:32 AM
you mean to say, allRelocatableSchemas is a subset of allSchemas?
 
hold on
 
python -c 'from gi.repository import Gio;allSchemas=Gio.Settings.list_schemas();allRelocatableSchemas=Gio.Settings.li‌​st_relocatable_schemas();print allSchemas' |grep compiz | pastebinit
paste that in a terminal and gimme the link
 
@mahesh, it posts every schemas that is not relocatable
 
yup. thats what it should do.
all things compiz are relocatable then?
I need to verify that.
 
but we aren't resetting every setting but only unity specific
@Mahesh except for the profile, yeah
 
8:36 AM
what profile?
 
the settings profile
 
okay.
 
Unity is all under com.canonical.unity
 
yes
 
8:37 AM
and it is being taken care of.
 
okay then.
your snippet errs.
 
all compiz plugins are in org.compiz.pluginname
 
@Mahesh that's right.
 
whats wrong with that snippet?
 
$ python -c 'from gi.repository import Gio;allSchemas=Gio.Settings.list_schemas();allRelocatableSchemas=Gio.Settings.li‌​st_relocatable_schemas();print allSchemas' |grep compiz
  File "<string>", line 1
    from gi.repository import Gio;allSchemas=Gio.Settings.list_schemas();allRelocatableSchemas=Gio.Settings.li‌​st_relocatable_schemas();print allSchemas
                                                                                                              ^
SyntaxError: invalid syntax
 
8:40 AM
that looks very useful. :|
 
the ^ is below list
 
wait.. then you say the original code doesn't work?
 
anyway, i told you allSchemas is not universal set
@Mahesh that did.
 
okay. must be something stupid. lets not worry.
@jokerdino you mean this one ?
@AmithKK join us here.
 
haven't tried it but it has a typo in com.canonical
> parentSchema="com.cnonical.Unity"
 
8:43 AM
yeah, thats right.
 
okay. so what are we solving now?
 
see if that works with the typo fixed.
then, we'll have to hack up a regexp to get the plugins list.
 
nope
okay it did
 
is that a yes or no?
 
$ ./unity-reset.py
Schema org.compiz.core successfully reset
Schema org.compiz.composite successfully reset
Schema org.compiz.opengl successfully reset
Schema org.compiz.decor successfully reset
Schema org.compiz.vpswitch successfully reset
Schema org.compiz.snap successfully reset
Schema org.compiz.mousepoll successfully reset
Schema org.compiz.resize successfully reset
Schema org.compiz.place successfully reset
Schema org.compiz.move successfully reset
Schema org.compiz.wall successfully reset
i guess it did
it didn't reset launchers, etc
which are all in com.canonical.Unity
 
8:47 AM
hmm...
 
they only reset the relocatable ones.
 
I smell something bad.
 
i do too
 
python shell please
from gi.repository import Gio
 
done
 
8:49 AM
unity=Gio.settings(schema="com.canonical.Unity",path=None)
unity1=Gio.settings(schema="com.canonical.Unity")
 
unity=Gio.settings(schema="com.canonical.Unity",path=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 269, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 115, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gio' object has no attribute 'settings'
is it gsettings?
 
oops.. capital S
 
alright. works
 
unity.list_keys()
and unity1.list_keys()
do they differ?
 
no
but they don't list the keys in the children.
 
8:51 AM
thats fine.
 
there are other schemas in com.canonical.Unity.launcher etc
 
unity.list_children()
unity1.list_children()
 
none
 
do they match?
 
they both return null
that is, []
 
8:52 AM
great. thats our problem.
@jokerdino thats an empty list. python has no null. it has None.
so, lets battle this first.
 
So, none then.
get going?
 
it should actually list all children.
:|
gsettings list-children com.canonical.Unity in terminal
 
none
 
yesterday, by jokerdino
gsettings list-children com.canonical.Unity
com.canonical.Unity                   com.canonical.Unity.Launcher
com.canonical.Unity.ApplicationsLens  com.canonical.Unity.Lenses
com.canonical.Unity.Dash              com.canonical.Unity.Panel
com.canonical.Unity.Devices           com.canonical.Unity.Runner
com.canonical.Unity.FilesLens
 
see what i said after that.
 
8:56 AM
What is that ^ then?
 
i can no longer reproduce that output.
 
forget that. we'll battle our way with regexps.
 
and that is?
 
@AmithKK if you are around, we can use your help.
let me finish skimming through python re module.
 
he is dating someone.
@Mahesh okay. i'll check the gio api
you pang Jorge somewhere? i see your name in the mailing list.
 
8:58 AM
yup. this morning at 3 am..
 
okay.
 
@Mahesh ok
I'm back
So
whats up?
 
you are getting killed, child.
 
@jokerdino ?
@jokerdino Wait
what's with me dating someone?
 
@AmithKK i am talking about list_children().
 
9:02 AM
@jokerdino yup that.
 
@AmithKK i thought you said that yesterday?
 
@jokerdino wat
 
never mind.
 
@Mahesh so yeah
 
@AmithKK you mean, Wat ?
 
9:04 AM
@Mahesh lol no
 
:P
there's a cool chrome extension that just says Wat
 
ok cut the jazz
 
What should I do?
 
and i am still not sure about list_children.
@AmithKK dig stuff about list_children
 
@jokerdino What do you want to do?
 
9:08 AM
:/
 
if gsettings list-children abc doesn't work, then Gio.Settings("abc").list_children() will also not work.
they are the same.
 
$ gsettings list-children  org.gnome.brasero
config    org.gnome.brasero.config
display   org.gnome.brasero.display
filter    org.gnome.brasero.filter
/me sighs
 
And what do you get for python?
 
none
 
what did you do in python?
 
9:12 AM
it might work on someone's else computer?
@Mahesh the script.
 
from gi.repository import Gio
Gio.Settings("org.gnome.brasero").list_children()
try this. you'll get the same output.
 
yep
 
so no problem with my code.
 
i guess so
 
its gsettings thats screwed up.
 
9:13 AM
it's just Unity then?
 
it's actually gsettings
 
gsetting
 
looks like I gt something.
just a minute
 
okay.
 
Yep
confirming that it works
 
9:16 AM
what?
i am going to reinstall quantaal then
 
>>> settings=Gio.Settings.new("com.canonical.Unity")
>>> settings.list_keys()
['form-factor', 'home-expanded']
 
Hurray!! got the regexp.
 
@Mahesh \o/
 
@AmithKK not keys but children
 
settings.list_children() please....
 
9:17 AM
lol
nothing here
 
thats the irony.
 
you on 12.10?
 
No
 
hm
 
Unity2D breaks python
lol
 
9:22 AM
looks like some mess there --^
 
@jokerdino mess?
 
read the thing?
 
yeah
c documentation
 
then why ask mess?
 
looks normalish
 
9:25 AM
read the link dummy
 
I did
 
> For GSettings objects that are lists, this value can change at any time and you should connect to the "children-changed" signal to watch for those changes. Note that there is a race condition here: you may request a child after listing it only for it to have been destroyed in the meantime
 
explodes
@Mahesh what say we write documentation for this after we're done with this?
 
import re
from gi.repository import Gio
unity=re.compile(r'com.canonical.Unity')
pluginRe=re.compile(r'?Porg.compiz.<plugin>')
allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
for schema in allSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.group('plugin')
for schema in allRelocatableSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.group('plugin')
dump the output buddy.
 
import re?
 
9:29 AM
yup.
regexpression module for python.
 
Traceback (most recent call last):
  File "file.py", line 4, in <module>
    pluginRe=re.compile(r'?Porg.compiz.<plugin>')
  File "/usr/lib/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
sre_constants.error: nothing to repeat
 
@jokerdino regexp
 
it replaced RegExp.
 
Wait
 
ok
 
9:29 AM
there is no RegExp now?
 
@AmithKK removed totally in 2.5 I guess
re entered in 1.5
 
Damn I'm outdated
 
YDS (=You don't say)
 
RegExp dies in 2.5
 
@jokerdino You sound trollish today ;D
 
9:31 AM
import re
from gi.repository import Gio
unity=re.compile(r'com.canonical.Unity')
pluginRe=re.compile(r'(?Porg.compiz.<plugin>)')
allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
for schema in allSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.group('plugin')
for schema in allRelocatableSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.group('plugin')
try again.
 
hehe. last school day over :P
 
Last day of school,right?
 
yeah
Traceback (most recent call last):
  File "file.py", line 4, in <module>
    pluginRe=re.compile(r'(?Porg.compiz.<plugin>)')
  File "/usr/lib/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
sre_constants.error: unknown specifier: ?Po
 
Traceback (most recent call last):
  File "unity-reset.py", line 4, in <module>
    pluginRe=re.compile(r'(?Porg.compiz.<plugin>)')
  File "/usr/lib/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
sre_constants.error: unknown specifier: ?Po
 
aaarrrrgggghhh
let me get named regexp groups right.
import re
from gi.repository import Gio
unity=re.compile(r'com.canonical.Unity')
pluginRe=re.compile(r'(?P<plugin>org.compiz.)')
allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
for schema in allSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.sub(r'{\g<plugin>}','')
for schema in allRelocatableSchemas:
    match=pluginRe.match(schema)
    if match:
        print match.sub(r'{\g<plugin>}','')
 
9:37 AM
Traceback (most recent call last):
  File "file.py", line 10, in <module>
    print match.sub(r'{\g<plugin>}','')
AttributeError: '_sre.SRE_Match' object has no attribute 'sub'
 
@Mahesh moar debugging
 
import re
from gi.repository import Gio
unity=re.compile(r'com.canonical.Unity')
pluginRe=re.compile(r'(?P<plugin>org.compiz.)')
allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
for schema in allSchemas:
    match=pluginRe.match(schema)
    if match:
        print pluginRe.sub(r'{\g<plugin>}','')
for schema in allRelocatableSchemas:
    match=pluginRe.match(schema)
    if match:
        print pluginRe.sub(r'{\g<plugin>}','')
my bad, it should be the regexp object. not match object.
 
it's a huge blank screen
 
umm... wait..
yup. just realised.
import re
from gi.repository import Gio
unity=re.compile(r'com.canonical.Unity')
pluginRe=re.compile(r'(?P<plugin>org.compiz.)')
allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()
for schema in allSchemas:
    match=pluginRe.match(schema)
    if match:
        print pluginRe.sub('',schema)
for schema in allRelocatableSchemas:
    match=pluginRe.match(schema)
    if match:
        print pluginRe.sub('',schema)
 
ok good
list of all plugins
 
9:42 AM
\o/
 
great.
wait a minute.
 
say wha?
 
gotta drop a friend.
 
okay.
 
i'll be back later, in may be 3 hrs.
 
9:45 AM
o.O
 
see if amith can get it going from here
 
okayish
 
or, we'', i'll do it once i'm back.
 
i'll check it out
 
@Mahesh take care
cya
@jokerdino So, we want to reset all the keys that comes out?
 
9:47 AM
something like that.
 
What's the exact output?
 
mag
put
ezoom
wall
showrepaint
imgjpeg
notification
bench
networkarearegion
workspacenames
fadedesktop
so, you make this into a dict.
 
@jokerdino so, we need to wipe the keys inside those?
 
uhm yeah
 
@jokerdino wait what? all those are compiz plugins??
 
9:49 AM
they all are org.compiz... stuff
 
okay.
/me going now.
BBL
 
cya
 
@jokerdino we just need to list_keys() and then reset() right?
 
get the script from bit bucket.
 
k
 
9:50 AM
then, replace the plugin dict with this.
 
@jokerdino reset-gio.py ?
 
what??
you should make a dict out of the regex script and feed it in place of plugin dict in the other script
 
ok
 
is that what you were asking?
 
yeah
 
9:58 AM
okay then.
 
import subprocess
from gi.repository import Gio


allSchemas=Gio.Settings.list_schemas()
allRelocatableSchemas=Gio.Settings.list_relocatable_schemas()

def resetrecursive(schema,path=None):
    if (schema not in allSchemas) and (schema not in allRelocatableSchemas):
        print "Ignoring missing Schema %s"%schema
        return
    gsettings=Gio.Settings(schema=schema,path=path)
    for key in gsettings.list_keys():
        gsettings.reset(key)
    gsettings.apply()
    print "Schema %s successfully reset"%schema
Like this, correct? @jokerdino
 
not sure.
let me see you generate a dict from the regex match?
 
Yeah
 
thx
 
and that is fed into the plugins thing
 
10:08 AM
it would replace the hardcoded plugin dict
 
yep
done that
 
yeah, just give me that code :P
 
now.. we need to stop using subprocess
I pushed it
 
oh it is in git
@amith, bring import re to top
 
ok
 
10:30 AM
@jokerdino test if it works
 
ok.
one bug in print
$ python gio-reset.py
  File "gio-reset.py", line 60
    plugins.append(print pluginRe.sub('',schema))
                       ^
SyntaxError: invalid syntax
jokerdino@jokerdino-laptop:~$ python gio-reset.py
  File "gio-reset.py", line 61
    for plugin in plugins:
                         ^
IndentationError: unindent does not match any outer indentation level
 
grr
Geany!
 
use vim :P
 
lol
there is not supposed to be a print tere
 
yep, i removed the first one. fix the second ind.. error
(process:13135): GLib-GIO-ERROR **: settings object created with schema 'org.compiz.gwd' and path '/org/compiz/profiles/unity/plugins/gwd/', but path '/org/compiz/gwd/' is specified by schema
Trace/breakpoint trap (core dumped)
@amith, i fixed the spaces but need to fix this --^
 
10:41 AM
@jokerdino hmm
 
i found a bug
org.compiz.gwd is not relocatable
ok fixed
it works now :)
 
\o/
pushed
 
now just need to fix what??
the list-children only
 
07:00 - 11:0013:00 - 00:00

« first day (1 day earlier)      last day (152 days later) »