- Timestamp:
- Aug 24, 2018, 12:18:19 PM (2 years ago)
- Location:
- syncer/trunk/fuentes
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
syncer/trunk/fuentes/debian/changelog
r4451 r7985 1 syncer (1.4) unreleased; urgency=medium 2 3 * New desktop, plank, file plugins 4 5 -- M.Angel Juan <m.angel.juan@gmail.com> Fri, 24 Aug 2018 12:13:13 +0200 6 1 7 syncer (1.3) xenial; urgency=medium 2 8 -
syncer/trunk/fuentes/syncer.install/usr/lib/syncer/plugins/dconf.py
r4039 r7985 9 9 10 10 def process(self,*args,**kwargs): 11 params = self.get_params(*args, **kwargs) 12 exit_code=check_call(['dconf','write',params['key'],'\''+params['value']+'\'']) 11 #params = self.get_params(*args, **kwargs) 12 params = kwargs['params'] 13 #exit_code=subprocess.call(['dconf','write',params['key'],"\"'"+params['value']+"'\""]) 14 exit_code = check_call(['dconf','write',params['key'],"'"+params['value']+"'"]) 13 15 if (exit_code == 0): 14 16 status=True 15 17 else: 16 18 status=False 17 output="Executed dconf write {} '{}'".format(params['key'],params['value'])19 output="Executed dconf {} {}".format(params['key'],params['value']) 18 20 return status,output -
syncer/trunk/fuentes/syncer.install/usr/lib/syncer/plugins/files.py
r4039 r7985 1 1 from lib.SyncerTypes import * 2 import os 2 3 import base64 4 import tempfile 3 5 4 6 class handler_file(IPlugin): … … 6 8 def init_plugin(self): 7 9 self.typeplug = 'file' 8 self.params = ['orig_path', 'dest_path'] 9 #def process(self): 10 self.params = ['action', 'filename', 'content'] 11 def process(self,*args,**kwargs): 12 dir=tempfile.mkdtemp() 13 filename=dir+'/'+os.path.basename(kwargs['params']['filename']) 14 with open(filename,'wb') as fp: 15 fp.write(base64.b64decode(kwargs['params']['content'])) 16 return True, filename -
syncer/trunk/fuentes/syncer.install/usr/lib/syncer/plugins/plank.py
r4451 r7985 4 4 import os 5 5 import re 6 import shutil 6 7 from shutil import copyfile 7 8 … … 41 42 else: 42 43 filelist.append(os.path.join(root,file)) 43 if filelist == []:44 return None45 else:46 44 return filelist 47 45 … … 64 62 def process(self,*args,**kwargs): 65 63 params = kwargs['params'] 66 if params['action']== 'add': 64 if params['action'] == 'addcontent': 65 item = params['option'] 66 basename_item = os.path.basename(item) 67 if not os.path.exists(item): 68 return False,str(item) 69 folder = os.path.expanduser('~')+'/.config/syncer-plank' 70 if not os.path.exists(folder): 71 os.mkdir(folder) 72 newitem = folder+'/'+basename_item+'.desktop' 73 shutil.move(item,newitem) 74 os.chmod(newitem,0o0755) 75 # create element 76 entry=['[PlankDockItemPreferences]','Launcher=file://'+newitem] 77 entry=map(lambda x: x+'\n',entry) 78 with open(os.path.expanduser('~')+'/.config/plank/dock1/launchers/'+basename_item+'.dockitem','w') as f: 79 f.writelines(entry) 80 return True,'Added {}'.format(item) 81 82 elif params['action']== 'add': 67 83 try: 68 84 where='applications'
Note: See TracChangeset
for help on using the changeset viewer.