Re: ASynk configuration

57 views
Skip to first unread message

Sriram Karra

unread,
May 7, 2015, 8:27:06 AM5/7/15
to Adrian Lanz, as...@googlegroups.com

I am copying the ASynK users mailing list so this answer is archived and available for others in a similar position. My answers inline in Blue.


On Tue, May 5, 2015 at 11:36 AM, Adrian Lanz <la...@wsl.ch> wrote:
Hi Sriram

I try to get the ASynk running on Debian Sid with a local owncloud onthe
machine (laptop) and Asynk retrieved from GitHub.

Some things are working, others are a bit hidden for a complete Python
novize (and I am not planning to become a Python programmer fro now).

- I try to make some changes in the way my BBBD is read (notes_map,
  phones_map, postal_map,...), but have no idea where to put such an
  adapted private config.json or how to write the config.py.

You need to edit config.py and add lines like this to the customize_config function:

config['bb']['notes_map'] = { 'phone_home' : 'Home', ... }

 

  - Just putting the new config.json file together with the config.py in
    my use directory does not help 

  - copy-paste the contents of an adapted config.json into the config.py
    file gives a syntax error

Can you send your config.py over? I can edit and send you the corrected version.

 

  - I write, that the structure of your example config.json files shoudl
    be taken and put into config.py.

That is a good suggestion. I can add some additional comments and examples to config.py to make it easier to change other config options.
 

    - But what would be the syntax?

    - Can I change just small piece? I would like to change, say
      postal_map for bb. What would I have to write into the config.py?
      In JSON syntax, or in PY(?) syntax? And how would this syntax look
      like for such a small change?

Yes, you can change any part of the config json. Does the above example work for you? The way to think about this is that your configuration customization is applied after an object called 'config' is created and initialized to a default version that ships with the asynk source (asynk_root/config directory). Once it is intialised the config object is a dictionary and you can edit it just like any other python object.  Does that make sense?
 

- I did realize that the postal addresses in my BBDB are not put into
  the owncloud addressbook (CardDAV), and I think you are mentioning
  that CardDAV is not configured for postal addresses.

  - The problem is, that postal addresses are lost from BBDB after
    syncing. Is there any work-around? I was expecting that ASynk would
    leave these BBDB fields alone (no sync on these fields, but just
    leave them in the BBDB database/file) - any easy possibility to
    achieve that?

Fair enough; unfortunately that is the way this works. The only workaround is to just use the sync one way - from BBDB -> CardDAV. If you never do a two way sync then your BBDB entires will not be overwritten.
 


- on creation-date and timestamp in BBDB: I like these fields for
  personal documentation use (some of my entries/items are more than 20
  years old). It seems, these fields are all "taken" by ASynk. Any
  possibility to avoid this? By some re-naming of fields, e.g. ASynk not
  taking ove creation-date and timestam, but using additional fields
  creation-date-async and timestamp-async for its purposes? And leaving
  the BBDB fields silently in the synced BBDB file. Again, is this
  something that can be easiliy achieved through configuration options?


Yes, it can be achieved by editing the notes_map field in config.py. However please note that you will also need to configure BBDB to update that alternate field as and when you change those entires in BBDB, otherwise the updates will not get synched.
 


Many thanks for the software.

You're welcome. Glad you like it.
 

Best, Adrian.

Sriram Karra

unread,
May 15, 2015, 6:20:31 AM5/15/15
to adr...@lanz.name, as...@googlegroups.com

Adrian, the syntax for updating the Python dictionary is not correct. Can you try the following and see if works better?

def customize_config (config):
    config['bb']['email_domains'] = {
        'home'  : ['lanz.name', 'haberlin.name'],
        'work'  : ['wsl.ch', 'ethz.ch', 'bafu.admin.ch'],
        'other' : []
        }

    config['bb']['postal_map'] = {
        'home'  : 'Home',
        'work'  : 'Office',
        'other' : []
        }

    config['bb']['phones_map'] = {
        'phone_home' : 'Home',
        'phone_work' : 'Office',
        'phone_mob'  : 'Mobile',
        'fax_home'   : 'HomeFax',
        'fax_work'   : 'OfficeFax',
        'fax_other'  : 'OtherFax',
        'phone_other' : []
        }

    config['bb']['notes_map'] = {
        'fileas'     : 'versand',
        'midle_name' : 'tex-name',
        'notes'      : 'gnokii',
        'anniv'      : 'anniversary',
        'itemid'     : 'bbdb-id',
        'dept'       : 'mail-alias',
        'title'      : 'buch'
        }


On Sat, May 9, 2015 at 2:58 PM, <adr...@lanz.name> wrote:
Many thanks Sriram

This entry does not work. I get no error, but the phone and email types
are not recognised in owncloud. I do:

$ ./asynk.py --op=create-profile --name gaga --user-dir=~/.asynk/ --db bb cd --folder default /owncloud/remote.php/carddav/addressbooks/gaga/contacts/ --store "/home/gaga/.bbdb/.bbdb-2015-05-05" "http://localhost/owncloud/remote.php/carddav/addressbooks/gaga/contacts"

$ ./asynk.py --op=sync --name gaga --user-dir=~/.asynk/

and the config.py entries are:

    config['bb']['email_domains'] = {'home'  : 'lanz.name', 'haberlin.name',}
    config['bb']['email_domains'] = {'work'  : 'wsl.ch', 'ethz.ch', 'bafu.admin.ch',}
    config['bb']['email_domains'] = {'other' : '.* '}

    config['bb']['postal_map'] = { 'home' : 'Home'}
    config['bb']['postal_map'] = { 'work' : 'Office'}
    config['bb']['postal_map'] = { 'other' : '.*'}

    config['bb']['phones_map'] = { 'phone_home' : 'Home'}
    config['bb']['phones_map'] = { 'phone_work' : 'Office'}
    config['bb']['phones_map'] = { 'phone_mob' : 'Mobile'}
    config['bb']['phones_map'] = { 'fax_home' : 'HomeFax'}
    config['bb']['phones_map'] = { 'fax_work' : 'OfficeFax'}
    config['bb']['phones_map'] = { 'fax_other' : 'OtherFax'}
    config['bb']['phones_map'] = { 'phone_other' : '.*'}

    config['bb']['notes_map'] = { 'fileas' : 'versand'}
    config['bb']['notes_map'] = { 'midle_name' : 'tex-name'}
    config['bb']['notes_map'] = { 'notes' : 'gnokii'}
    config['bb']['notes_map'] = { 'anniv' : 'anniversary'}
    config['bb']['notes_map'] = { 'itemid' : 'bbdb-id'}
    config['bb']['notes_map'] = { 'dept' : 'mail-alias'}
    config['bb']['notes_map'] = { 'title' : 'buch'}


- name, organization, birthday, and all phone numbers and
  email addresses are there, also the bbdb AKA field as owncloud
  nickname field

- but the phone and email types are not assigned to work, home, ...

- and the intended associations under notes_map do not work (except
  anniversary)

Any idea?

Best, Adrian.
Reply all
Reply to author
Forward
0 new messages