← Back to team overview

deja-dup-team team mailing list archive

[Merge] lp:~xnox/deja-dup/drop-u1 into lp:deja-dup

 

Dimitri John Ledkov has proposed merging lp:~xnox/deja-dup/drop-u1 into lp:deja-dup.

Commit message:
Drop U1 backend.

Requested reviews:
  Déjà Dup Developers (deja-dup-hackers)

For more details, see:
https://code.launchpad.net/~xnox/deja-dup/drop-u1/+merge/213866

Drop U1 backend.
-- 
https://code.launchpad.net/~xnox/deja-dup/drop-u1/+merge/213866
Your team Déjà Dup Developers is requested to review the proposed merge of lp:~xnox/deja-dup/drop-u1 into lp:deja-dup.
=== modified file 'data/org.gnome.DejaDup.gschema.xml.in'
--- data/org.gnome.DejaDup.gschema.xml.in	2013-10-15 04:36:06 +0000
+++ data/org.gnome.DejaDup.gschema.xml.in	2014-04-02 15:03:23 +0000
@@ -67,7 +67,6 @@
         <choice value='file'/>
         <choice value='rackspace'/>
         <choice value='s3'/>
-        <choice value='u1'/>
       </choices>
       <default>'auto'</default>
       <_summary>Type of location to store backup</_summary>
@@ -75,7 +74,6 @@
     </key>
     <child name="rackspace" schema="org.gnome.DejaDup.Rackspace"/>
     <child name="s3" schema="org.gnome.DejaDup.S3"/>
-    <child name="u1" schema="org.gnome.DejaDup.U1"/>
     <child name="file" schema="org.gnome.DejaDup.File"/>
   </schema>
   <schema id="org.gnome.DejaDup.S3" path="/org/gnome/deja-dup/s3/">
@@ -107,13 +105,6 @@
       <_description>This is your username for the Rackspace Cloud Files service.</_description>
     </key>
   </schema>
-  <schema id="org.gnome.DejaDup.U1" path="/org/gnome/deja-dup/u1/">
-    <key name="folder" type="s">
-      <default>'/deja-dup/$HOSTNAME'</default>
-      <_summary>The Ubuntu One folder</_summary>
-      <_description>The folder name to store files in.  If ‘$HOSTNAME’, it will default to a folder based on the name of the computer.</_description>
-    </key>
-  </schema>
   <schema id="org.gnome.DejaDup.File" path="/org/gnome/deja-dup/file/">
     <key name="path" type="s">
       <default>''</default>

=== modified file 'deja-dup/deja-dup.appdata.xml.in'
--- deja-dup/deja-dup.appdata.xml.in	2013-11-08 03:25:36 +0000
+++ deja-dup/deja-dup.appdata.xml.in	2014-04-02 15:03:23 +0000
@@ -7,7 +7,7 @@
     <description>
         <_p>Déjà Dup is a simple backup tool. It hides the complexity of backing up the Right Way (encrypted, off-site, and regular) and uses duplicity as the backend.</_p>
         <ul>
-            <_li>Support for local, remote, or cloud backup locations, such as Amazon S3, Rackspace Cloud Files, and Ubuntu One</_li>
+            <_li>Support for local, remote, or cloud backup locations, such as Amazon S3 and Rackspace Cloud Files</_li>
             <_li>Securely encrypts and compresses your data</_li>
             <_li>Incrementally backs up, letting you restore from any particular backup</_li>
             <_li>Schedules regular backups</_li>

=== modified file 'deja-dup/widgets/CMakeLists.txt'
--- deja-dup/widgets/CMakeLists.txt	2014-01-31 08:44:39 +0000
+++ deja-dup/widgets/CMakeLists.txt	2014-04-02 15:03:23 +0000
@@ -36,7 +36,6 @@
                        ConfigLocationSSH.vala
                        ConfigLocationSMB.vala
                        ConfigLocationTable.vala
-                       ConfigLocationU1.vala
                        ConfigLocationVolume.vala
                        ConfigPeriod.vala
                        ConfigRelPath.vala

=== modified file 'deja-dup/widgets/ConfigLabelLocation.vala'
--- deja-dup/widgets/ConfigLabelLocation.vala	2013-01-27 20:30:52 +0000
+++ deja-dup/widgets/ConfigLabelLocation.vala	2014-04-02 15:03:23 +0000
@@ -26,7 +26,6 @@
   Gtk.Image img;
   FilteredSettings file_root;
   FilteredSettings s3_root;
-  FilteredSettings u1_root;
   FilteredSettings rackspace_root;
 
   public ConfigLabelLocation()
@@ -40,7 +39,6 @@
     watch_key(BACKEND_KEY);
     watch_key(null, (file_root = DejaDup.get_settings(FILE_ROOT)));
     watch_key(null, (s3_root = DejaDup.get_settings(S3_ROOT)));
-    watch_key(null, (u1_root = DejaDup.get_settings(U1_ROOT)));
     watch_key(null, (rackspace_root = DejaDup.get_settings(RACKSPACE_ROOT)));
     set_from_config.begin();
   }

=== modified file 'deja-dup/widgets/ConfigLocation.vala'
--- deja-dup/widgets/ConfigLocation.vala	2013-10-19 17:43:57 +0000
+++ deja-dup/widgets/ConfigLocation.vala	2014-04-02 15:03:23 +0000
@@ -62,7 +62,6 @@
   int index_dav;
   int index_s3 = -2;
   int index_rackspace = -2;
-  int index_u1 = -2;
   int index_cloud_sep = -2;
   int index_ssh;
   int index_smb;
@@ -109,7 +108,6 @@
     extras.show();
 
     // Insert cloud providers
-    insert_u1();
     insert_s3();
     insert_rackspace();
 
@@ -178,16 +176,6 @@
                               ref index_s3, insert_s3);
   }
 
-  void insert_u1() {
-    insert_cloud_if_available("u1", BackendU1.get_checker(),
-                              new ThemedIcon.from_names({"ubuntuone",
-                                                         "ubuntuone-installer",
-                                                         "deja-dup-cloud"}),
-                              _("Ubuntu One"),
-                              new ConfigLocationU1(label_sizes),
-                              ref index_u1, insert_u1);
-  }
-
   void insert_rackspace() {
     insert_cloud_if_available("rackspace", BackendRackspace.get_checker(),
                               new ThemedIcon("deja-dup-cloud"),
@@ -414,8 +402,6 @@
       index = index_s3;
     else if (backend == "rackspace")
       index = index_rackspace;
-    else if (backend == "u1")
-      index = index_u1;
     else if (backend == "file") {
       var fsettings = DejaDup.get_settings(FILE_ROOT);
 
@@ -504,8 +490,6 @@
       settings.set_string(BACKEND_KEY, "s3");
     else if (index == index_rackspace)
       settings.set_string(BACKEND_KEY, "rackspace");
-    else if (index == index_u1)
-      settings.set_string(BACKEND_KEY, "u1");
     else if (index == index_ssh)
       yield set_remote_info("sftp");
     else if (index == index_ftp)

=== removed file 'deja-dup/widgets/ConfigLocationU1.vala'
--- deja-dup/widgets/ConfigLocationU1.vala	2012-03-17 04:02:46 +0000
+++ deja-dup/widgets/ConfigLocationU1.vala	1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
-/*
-    This file is part of Déjà Dup.
-    For copyright information, see AUTHORS.
-
-    Déjà Dup is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    Déjà Dup is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-using GLib;
-
-namespace DejaDup {
-
-public class ConfigLocationU1 : ConfigLocationTable
-{
-  public ConfigLocationU1(Gtk.SizeGroup sg) {
-    Object(label_sizes: sg);
-  }
-
-  construct {
-    var entry = new ConfigFolder(DejaDup.U1_FOLDER_KEY, DejaDup.U1_ROOT);
-    entry.set_accessible_name("U1Folder");
-    add_widget(_("_Folder"), entry);
-  }
-}
-
-}
-

=== modified file 'libdeja/Backend.vala'
--- libdeja/Backend.vala	2012-04-30 00:18:18 +0000
+++ libdeja/Backend.vala	2014-04-02 15:03:23 +0000
@@ -58,7 +58,6 @@
     if (backend != "auto" &&
         backend != "s3" &&
         backend != "rackspace" &&
-        backend != "u1" &&
         backend != "file")
       backend = "auto"; // default to auto if string is not known
 
@@ -70,8 +69,6 @@
     var backend_name = get_default_type();
     if (backend_name == "s3")
       return new BackendS3();
-    else if (backend_name == "u1")
-      return new BackendU1();
     else if (backend_name == "rackspace")
       return new BackendRackspace();
     else if (backend_name == "file")

=== modified file 'libdeja/BackendAuto.vala'
--- libdeja/BackendAuto.vala	2012-03-21 03:01:36 +0000
+++ libdeja/BackendAuto.vala	2014-04-02 15:03:23 +0000
@@ -50,7 +50,6 @@
 
   static bool started = false;
   static bool done = false;
-  Checker u1checker;
   Checker s3checker;
   construct {
     if (!started) {
@@ -59,10 +58,7 @@
       started = true;
       ref(); // Give us time to finish
 
-      // List is (in order): u1, s3, file
-      u1checker = BackendU1.get_checker();
-      u1checker.notify["complete"].connect(examine_checkers);
-
+      // List is (in order): s3, file
       s3checker = BackendS3.get_checker();
       s3checker.notify["complete"].connect(examine_checkers);
 
@@ -75,17 +71,12 @@
     if (done)
       return;
 
-    if (u1checker.complete) {
-      if (u1checker.available) {
-        finish("u1");
-      }
-      else if (s3checker.complete) {
+    if (s3checker.complete) {
         if (s3checker.available)
           finish("s3");
         else
           finish("file");
       }
-    }
   }
 
   void finish(string mode)

=== removed file 'libdeja/BackendU1.vala'
--- libdeja/BackendU1.vala	2012-11-05 15:17:28 +0000
+++ libdeja/BackendU1.vala	1970-01-01 00:00:00 +0000
@@ -1,317 +0,0 @@
-/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
-/*
-    This file is part of Déjà Dup.
-    For copyright information, see AUTHORS.
-
-    Déjà Dup is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    Déjà Dup is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-using GLib;
-
-namespace DejaDup {
-
-public const string U1_ROOT = "U1";
-public const string U1_FOLDER_KEY = "folder";
-
-class Listener : Object
-{
-  public delegate void Handler(string name, Variant args);
-  public DBusProxy proxy {get; construct;}
-  public string method {get; construct;}
-  public Variant args {get; construct;}
-  public unowned Handler handler {get; set;}
-
-  public Listener(DBusProxy proxy, string method, Variant? args, Handler handler)
-  {
-    Object(proxy: proxy, method: method, args: args);
-    this.handler = handler;
-  }
-
-  MainLoop loop;
-  construct {
-    loop = new MainLoop(null, false);
-  }
-
-  public void run()
-  {
-    Idle.add(() => {
-      call_but_quit_on_fail.begin();
-      return false;
-    });
-    proxy.g_signal.connect(handle_dbus_signal);
-    loop.run();
-    proxy.g_signal.disconnect(handle_dbus_signal);
-  }
-
-  async void call_but_quit_on_fail()
-  {
-    try {
-      yield proxy.call(method, args, DBusCallFlags.NONE, -1, null);
-    }
-    catch (Error e) {
-      warning("%s\n", e.message);
-      loop.quit();
-    }
-  }
-
-  void handle_dbus_signal(DBusProxy obj, string? sender, string name, Variant args)
-  {
-    // Stop on first signal
-    handler(name, args);
-    loop.quit();
-  }
-}
-
-class U1Checker : Checker
-{
-  PythonChecker pyu1;
-  construct {
-    try {
-      var proxy = BackendU1.get_creds_proxy();
-      if (proxy.get_name_owner() == null) {
-        available = false;
-        complete = true;
-      }
-    }
-    catch (Error e) {
-      warning("%s\n", e.message);
-      available = false;
-      complete = true;
-    }
-
-    if (!complete) {
-      // A bit of abstraction leakage here; we have to keep these imports in
-      // line with what duplicity uses.  Maybe we should add to duplicity a way
-      // to ask 'can I use this backend?'
-      pyu1 = PythonChecker.get_checker("oauthlib, httplib2");
-      if (pyu1.complete) {
-        available = pyu1.available;
-        complete = pyu1.complete;
-      }
-      else {
-        pyu1.notify["complete"].connect(() => {
-          available = pyu1.available;
-          complete = pyu1.complete;
-          pyu1 = null;
-        });
-      }
-    }
-  }
-}
-
-public class BackendU1 : Backend
-{
-  ulong button_handler = 0;
-
-  static Checker checker_instance = null;
-  public static Checker get_checker()
-  {
-    if (checker_instance == null)
-      checker_instance = new U1Checker();
-    return checker_instance;
-  }
-
-  public override Backend clone() {
-    return new BackendU1();
-  }
-
-  ~BackendU1()
-  {
-    if (button_handler > 0) {
-      mount_op.disconnect(button_handler);
-      button_handler = 0;
-    }
-  }
-
-  public override bool is_native() {
-    return false;
-  }
-
-  public override bool space_can_be_infinite() {
-    return false;
-  }
-
-  public override Icon? get_icon() {
-    return new ThemedIcon.from_names({"ubuntuone", "ubuntuone-installer", "deja-dup-cloud"});
-  }
-
-  public override async bool is_ready(out string when) {
-    when = _("Backup will begin when a network connection becomes available.");
-    return yield Network.get().can_reach ("https://one.ubuntu.com/";);
-  }
-
-  public override string get_location(ref bool as_root)
-  {
-    // The UI backend for duplicity needs to talk to our session dbus, but it
-    // can't as root.
-    as_root = false;
-
-    var settings = get_settings(U1_ROOT);
-    var folder = get_folder_key(settings, U1_FOLDER_KEY);
-    return "u1+http://%s".printf(folder);
-  }
-
-  public override string get_location_pretty()
-  {
-    var settings = get_settings(U1_ROOT);
-    var folder = get_folder_key(settings, U1_FOLDER_KEY);
-    if (folder == "")
-      return _("Ubuntu One");
-    else
-      // Translators: %s is a folder.
-      return _("%s on Ubuntu One").printf(folder);
-  }
-
-  public override async uint64 get_space(bool free = true)
-  {
-    DBusProxy obj = null;
-    try {
-      obj = get_prefs_proxy();
-    }
-    catch (Error e) {
-      warning("%s\n", e.message);
-      return INFINITE_SPACE;
-    }
-
-    if (obj.get_name_owner() == null)
-      return INFINITE_SPACE;
-
-    uint64 total = INFINITE_SPACE;
-    uint64 used = 0;
-    var listener = new Listener(obj, "account_info", null, (name, args) => {
-      if (name == "AccountInfoReady") {
-        VariantIter iter;
-        args.get("(a{ss})", out iter);
-        string key, val;
-        while (iter.next("{ss}", out key, out val)) {
-          if (key == "quota_total")
-            total = uint64.parse(val);
-          else if (key == "quota_used")
-            used = uint64.parse(val);
-        }
-      }
-    });
-    listener.run();
-
-    if (free)
-      return (total > used) ? (total - used) : 0;
-    else
-      return total;
-  }
-
-  public override async void get_envp() throws Error
-  {
-    var obj = get_creds_proxy();
-    if (obj.get_name_owner() == null) {
-      ask_password();
-      return;
-    }
-
-    var found = false;
-    var envp = new List<string>();
-    var listener = new Listener(obj, "find_credentials", null, (name, args) => {
-      if (name == "CredentialsFound") {
-        VariantIter iter;
-        args.get("(a{ss})", out iter);
-        string key, val;
-        string consumer_key = null, consumer_secret = null, token = null, token_secret = null;
-        while (iter.next("{ss}", out key, out val)) {
-          if (key == "consumer_key")
-            consumer_key = val;
-          else if (key == "consumer_secret")
-            consumer_secret = val;
-          else if (key == "token")
-            token = val;
-          else if (key == "token_secret")
-            token_secret = val;
-        }
-        if (consumer_key != null && consumer_secret != null && token != null && token_secret != null) {
-          envp.append("FTP_PASSWORD=%s:%s:%s:%s".printf(consumer_key, consumer_secret, token, token_secret));
-          found = true;
-        }
-      }
-    });
-    listener.run();
-
-    if (found)
-      envp_ready(true, envp);
-    else
-      ask_password();
-  }
-
-  void button_clicked()
-  {
-    sign_in.begin();
-  }
-
-  void ask_password() {
-    mount_op.set("label_title", _("Connect to Ubuntu One"));
-    mount_op.set("label_button", _("Sign into Ubuntu One…"));
-    if (button_handler == 0)
-      button_handler = Signal.connect_swapped(mount_op, "button-clicked",
-                                              (Callback)button_clicked, this);
-    mount_op.ask_password("", "", "", 0);
-  }
-
-  async void sign_in()
-  {
-    try {
-      var obj = get_creds_proxy();
-      if (obj.get_name_owner() == null) {
-        envp_ready(false, null);
-        return;
-      }
-
-      var listener = new Listener(obj, "login", new Variant("(a{ss})", null),
-                                  (name, args) => {
-        if (name == "CredentialsFound") {
-          mount_op.set("go_forward", true);
-          envp_ready(true, null);
-        }
-      });
-      listener.run();
-    }
-    catch (Error e) {
-      warning("%s\n", e.message);
-      envp_ready(false, null);
-    }
-  }
-
-  public static DBusProxy get_creds_proxy() throws Error
-  {
-    DBusProxy creds_proxy;
-    creds_proxy = new DBusProxy.for_bus_sync(BusType.SESSION,
-                                             DBusProxyFlags.NONE, null, 
-                                             "com.ubuntuone.Credentials",
-                                             "/credentials",
-                                             "com.ubuntuone.CredentialsManagement",
-                                             null);
-    return creds_proxy;
-  }
-
-  public static DBusProxy get_prefs_proxy() throws Error
-  {
-    DBusProxy prefs_proxy;
-    prefs_proxy = new DBusProxy.for_bus_sync(BusType.SESSION,
-                                             DBusProxyFlags.NONE, null, 
-                                             "com.ubuntuone.controlpanel",
-                                             "/preferences",
-                                             "com.ubuntuone.controlpanel.Preferences",
-                                             null);
-    return prefs_proxy;
-  }
-}
-
-} // end namespace
-

=== modified file 'libdeja/CMakeLists.txt'
--- libdeja/CMakeLists.txt	2013-10-14 22:22:07 +0000
+++ libdeja/CMakeLists.txt	2014-04-02 15:03:23 +0000
@@ -22,7 +22,6 @@
                        BackendFile.vala
                        BackendRackspace.vala
                        BackendS3.vala
-                       BackendU1.vala
                        Checker.vala
                        CommonUtils.vala
                        DirHandling.vala


References