~ubuntu-branches/ubuntu/vivid/system-config-printer/vivid-proposed

« back to all changes in this revision

Viewing changes to PhysicalDevice.py

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2014-07-06 09:41:43 UTC
  • mto: (256.1.1 utopic-proposed)
  • mto: This revision was merged to the branch mainline in revision 256.
  • Revision ID: package-import@ubuntu.com-20140706094143-n4gi5juot9ogomct
Tags: upstream-1.4.5+20140706
ImportĀ upstreamĀ versionĀ 1.4.5+20140706

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
 
## Copyright (C) 2008, 2009, 2010, 2012 Red Hat, Inc.
 
3
## Copyright (C) 2008, 2009, 2010, 2012, 2014 Red Hat, Inc.
4
4
## Authors:
5
5
##  Tim Waugh <twaugh@redhat.com>
6
6
 
158
158
                self.dnssd_hostname = dnssdhost;
159
159
 
160
160
        if (hasattr (device, 'address') and self._network_host == None):
161
 
            if device.address:
162
 
                self._network_host = device.address
 
161
            address = device.address
 
162
            if address:
 
163
                if type (address) == unicode:
 
164
                    address = address.encode ('utf-8')
 
165
                self._network_host = address
163
166
        if (hasattr (device, 'hostname') and self.dnssd_hostname == None):
164
 
            if device.hostname:
165
 
                self.dnssd_hostname = device.hostname
 
167
            hostname = device.hostname
 
168
            if hostname:
 
169
                if type (hostname) == unicode:
 
170
                    hostname = hostname.encode ('utf-8')
 
171
                self.dnssd_hostname = hostname
166
172
 
167
173
    def get_devices (self):
168
174
        return self.devices