Giter Site home page Giter Site logo

javaes / sailfish-msg-importer Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 4.0 22 KB

This little script helps to import messages from other mobile OSs to Sailfish OS. The first version only supports Android SMS messages exported by SMS Backup & Restore.

License: Apache License 2.0

Python 100.00%
sailfish-os sms-backup python jolla

sailfish-msg-importer's Introduction

sailfish-msg-importer

This little script helps to import messages from other mobile OSs to Sailfish OS. The first version only supports Android SMS messages exported by SMS Backup & Restore.

Please use with caution, I wrote this script for personal use and the only test case was the import of my old messages from my Android phone.

Usage

Copy both python files to the same directory on your Sailfish OS phone. The XML-File with the messages can be placed in a directory of your choice on your device.

Open a command shell on your device and navigate to the path were you put the script.

To import from a SMS Backup & Restore XML file (backup is created):

[nemo@Jolla]$ python sms_import.py --import [xml-file]

To backup the current messages database:

[nemo@Jolla]$ python sms_import.py --backup

To restore from a backup (replaces everything):

[nemo@Jolla]$ python sms_import.py --restore [backup-db-file]

If no error message is printed the import was successful.

sailfish-msg-importer's People

Contributors

javaes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sailfish-msg-importer's Issues

Reference to invalid character number: line 38, column 137

When attempting to run the script, I get the following output:

[nemo@Sailfish ~]$ python sms_import.py --import sms-20181206090639.xml 
Traceback (most recent call last):
  File "sms_import.py", line 13, in <module>
    sms_list = parser.get_all_sms_in_sf_format()
  File "/home/nemo/sail_sms.py", line 31, in get_all_sms_in_sf_format
    xmldom = minidom.parse(self.xml_file)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
    result = builder.parseFile(fp)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: reference to invalid character number: line 38, column 137

I don't know what xml.parsers.expat.ExpatError is, but I've played with Python before. If you don't want to / don't have time to fix it, could you at least point me in the right direction so I can try?

NameError: name 'backup_tool' is not defined

When trying to import a SMS backup (or just run the script with or without any options), I always get the following error message:

$ python sms_import.py
Traceback (most recent call last):
  File "sms_import.py", line 3, in <module>
    from sail_sms import SMSParser, SMSImporter, SMSBackup
  File "/home/nemo/Downloads/sail_sms.py", line 282, in <module>
    backup_tool.create_backup()
NameError: name 'backup_tool' is not defined

Running on SailfishOS 3.0.0.8 on Sony XPeria X ("Sailfish X").
Same error message, no matter if I use python2 or python3 to run the script.
What requirement is my device missing for the script to work?

An issue while import cyrillic sms into Jolla C phone

Hello!
Unfortunately, while using this script I try to import into Jolla C phone cyrillic sms messages (utf-8 encoding) I receive the following output:
Traceback (most recent call last):
File "sms_import.py", line 13, in
sms_list = parser.get_all_sms_in_sf_format()
File "/home/nemo/Downloads/sailfish-msg-importer/sail_sms.py", line 31, in get_all_sms_in_sf_format
xmldom = minidom.parse(self.xml_file)
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: junk after document element: line 10, column 0

Could you look at this, please?

Best regards,
melis73

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.