Kivy file sync program, possibly a demonstrator?

111 views
Skip to first unread message

nick...@gmail.com

unread,
Sep 2, 2014, 12:19:01 PM9/2/14
to kivy-...@googlegroups.com
Hi everybody,   (cross-posting this from kivy-dev as suggested)

In an effort to learn Py4A and Kivy I wrote this (open source) Android-to-SMB file synchronization app called Optimal File Sync(some screen shots here:http://www.optimalbpm.se/wiki/index.php/Optimal_file_sync#Starting_the_app.2Fservice).
When I wrote it, I felt that even if there were some examples, where were no really fully-fledged show case applications where all the common problems had been solved.
And the app is actually quite usable, it has been updating my photos without fault now for a while.

So I was thinking that if I polished it a little, and got some feedback from you people, I could make it into something that could be pretty educational for others.
I would not mind completely make up reasons to use all aspects of the framework. Shake the phone to try and sync right away? Sure. Whatever. :-)

Any of you think that this would be a good idea? A way to present many of Kivy:s(and Py4a:s) features?

In the future I want to port it to IOS, and to Python 3 as soon as that is possible.
Even though many have had questions in that direction it is mostly for my own sake, though, as I am planning to make a completely unrelated and commercial app later*.

Anyway, the features, some which I find quite usable in real life:

  • Only syncs when Wi-Fi is available
  • Only syncs when on the same network as the target server
  • Only syncs when new files have been created
  • SMBFilesystem implementation for FileChooser
  • All actual *work* is done as a background service
  • Status and progress can be monitored from app
  • Disregards temporary video files
  • Saves settings in a separate folder(survives reinstallations)
  • Open source(separate from any financial interest except perhaps the wiki page being on påti)
  • Low system load
  • Written in pure Python/Py4A/Kivy, meant as a show case app for the Kivy framework
  • Currently only Android, but an IOS package is in the works.
  • Not a very beautiful GUI.

I would love to get feedback/ideas/help on/with the following:

* Structure: The service, as it has to be in a service subfolder, cannot use paths relative to the root, like /lib and so forth, forcing me to put the lib folder in the service folder unless I manually add folders to the path. I'd rather not do that as I have had some portability problems with that earlier. Also it forces me to duplicate some code. Can that be solved?

* The GUI: I am currently barely scraping by using the carousel, I have not been successful in using the ScrollView, which causes problems. How *should* these settings be presented, you think?

* Code: Please point out any crappy stuff, I know it is not strictly PEP8 yet, but I will make it that way pretty soon, and that is not the hard part, really. What I am after is if you find any really bad and dangerous coding anywhere, bad design decisions.
Because I know there are some, even though I am a pretty seasoned developer, I am not sure of what is the most pythonic way sometimes. Also the copy_file part in the synctools module seemed to hit some of the ugly-tree branches on commit. And perhaps I didn't put in *years* of polishing to perfection. :-)

* The SMBFilesystem: FileSystemAbstract acts in some very mysterious ways sometimes, which confuses me and hence SMBFilesystem and my "ExpandSelector" class. I would like to have an absolute path mode or something. Or I am doing something wrong.

Availability:
It should soon (google: A couple of hours, been far more now) be possible to find on Google Play. I hope. I can't say I am completely familiar with the developer tools/store listing yet.

Documentation/some screenshots:
http://www.optimalbpm.se/wiki/index.php/Optimal_file_sync#Starting_the_app.2Fservice

Source and a debug-apk is at source forge:
https://sourceforge.net/projects/optimalfilesync/



Kind regards,
Nicklas B

* I named this app Optimal File Sync just so that it would fit in with the rest of my projects, not to capitalize on it, just saying. I don't think there is any way to, anyway. If I made it un-free for some reason it would be easy to fork.

nick...@gmail.com

unread,
Sep 2, 2014, 3:20:28 PM9/2/14
to kivy-...@googlegroups.com
So there is a beta tester program now. We'll see, however, when google decides to get the app up...

https://play.google.com/apps/testing/se.optimalbpm.optimal.file.sync.optimal_file_sync

And also there is now a non-debug APK at sourceforge to try directly if you rather want to do that:
https://sourceforge.net/projects/optimalfilesync/files/

Cheers!

nick...@gmail.com

unread,
Sep 2, 2014, 7:18:29 PM9/2/14
to kivy-...@googlegroups.com
Hi,
Got fed up with source forge; moved source to github:
https://github.com/nicklasb/optimal_file_sync

Also, the beta is at last up for easy install:
https://play.google.com/apps/testing/se.optimalbpm.optimal.file.sync.optimal_file_sync

//Nicklas

ZenCODE

unread,
Sep 3, 2014, 9:37:09 PM9/3/14
to kivy-...@googlegroups.com
Hi Nick

Firstly, thanks. It's great to see a working SMB implementation in Kivy, and I look forward to testing it when my device stops spontaneously restarting even 5 minutes (I hope to replace it in the very near future ;-))

In terms of becoming a demonstration app, my 2c here is that the problem is, example apps need to be as simple as possible as generally, they should demonstrate 1 thing clearly. Introducing complex functionality makes the code harder to read, grasp and isolate the issue you are seeking to solve. So, to my mind, real-world apps don't make for good examples. Not sure how other feel here?

That being said, there is some really useful functionality you have here. It would be great to have feature list together with a link to your code, so that Kivy peeps wanting to do the same can see how you did it. Once it's available in the store, I'll  add that it here:

https://github.com/kivy/kivy/wiki/List-of-Kivy-Projects

One thing that does spring to mind is that it sounds like you have a FileSystemAbstract implementation for SMB? That is really cool and might be a very nice addition to the garden? I would like to look into that myself...

https://github.com/kivy-garden

I use SMB a lot (using GhostCommander + SMB plugin, linking to Win+Linux boxes) and although your sync does not suit my needs (I typically just copy arbitrary files to and fro), that could be very useful. Perhaps a small mod to you app could add that? As I mentioned, I have not looked at your app yet, so ignore me if it can do this.

Either way, nice one. Speak soon in the testing channel..;-)

Cheers

nick...@gmail.com

unread,
Sep 5, 2014, 6:13:01 AM9/5/14
to kivy-...@googlegroups.com
Hi,

You're welcome. And I hope it starts working. :-)

Wrt SMBFilesystemAbstract; Yes, I do. 
It works pretty well, but is sometimes confused by the file FileChooserListview sending som interesting paths. 
Actually I sometimes have problems with the normal local filesystem, too, so there are probably some issues there as well.
I am not sure what is wrong, but it should not be impossible to fix it completely.

Yes, example programs are usually specific. 
But I think there need to be examples of full applications as well since making the full thing is a separate challenge in itself. An pose its own kind of problems.
Also, the overall system design of kivy-apps will probably be quite similar, as in most other frameworks. 
I also think it is kind of instructional to have the whole thing, gives you a feel for the scope of writing an app, too.

I just wan't to clean up the code significantly, so that it will work better. And as I indicated, *any* feedback on structure and everything is very welcome.

It is available for beta testing only so far, I want it to be a little bit better, no need to get poor ratings just yet. :-)

Actually, I sometimes just change the source and dest folder when I want to use it like that, but no, not for individual files.
There is an SMB client app for android that works better for that, "AndSMB".

Yep, I could certainly put it in the garden when it feels stable. 

See ya!

//Nicklas

nick...@gmail.com

unread,
Oct 16, 2014, 7:48:56 AM10/16/14
to kivy-...@googlegroups.com
Hi again,

I am thinking about putting the SMB-implementation in the garden, however, I don't seem to be able to find out who the administrator is. Do you know?


//Nicklas

On Thursday, September 4, 2014 3:37:09 AM UTC+2, ZenCODE wrote:
Reply all
Reply to author
Forward
0 new messages