call site 0 for path.local.lstat
misc/testing/test_update_website.py - line 19
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
   def test_rsync():
       temp = py.test.ensuretemp('update_website_rsync')
       pkgpath = temp.join('pkg')
       apipath = temp.join('apigen')
       pkgpath.ensure('foo/bar.txt', file=True).write('baz')
       pkgpath.ensure('spam/eggs.txt', file=True).write('spam')
       apipath.ensure('api/foo.html', file=True).write('<html />')
       apipath.ensure('source/spam.html', file=True).write('<html />')
   
       rsyncpath = temp.join('rsync')
       assert not rsyncpath.check()
       gateway = py.execnet.PopenGateway()
->     update_website.rsync(pkgpath, apipath, gateway, rsyncpath.strpath)
       assert rsyncpath.check(dir=True)
       assert rsyncpath.join('pkg').check(dir=True)
       assert rsyncpath.join('pkg/spam/eggs.txt').read() == 'spam'
       assert rsyncpath.join('apigen').check(dir=True)
       assert rsyncpath.join('apigen/api/foo.html').read() == '<html />'
bin/_update_website.py - line 18
12
13
14
15
16
17
18
19
20
21
22
23
   def rsync(pkgpath, apidocspath, gateway, remotepath):
       """ copy the code and docs to the remote host """
       # copy to a temp dir first, even though both paths (normally) share the
       # same parent dir, that may contain other stuff that we don't want to
       # copy...
       tempdir = py.test.ensuretemp('update_website_rsync_temp')
->     pkgpath.copy(tempdir.ensure(pkgpath.basename, dir=True))
       apidocspath.copy(tempdir.ensure(apidocspath.basename, dir=True))
   
       rs = py.execnet.RSync(tempdir)
       rs.add_target(gateway, remotepath, delete=True)
       rs.send()
path/local/local.py - line 248
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
   def copy(self, target, archive=False):
       """ copy path to target."""
       assert not archive, "XXX archive-mode not supported"
       if self.check(file=1):
           if target.check(dir=1):
               target = target.join(self.basename)
           assert self!=target
           copychunked(self, target)
       else:
           target.ensure(dir=1)
           def rec(p):
               return p.check(link=0)
           for x in self.visit(rec=rec):
               relpath = x.relto(self)
               newx = target.join(relpath)
->             if x.check(link=1):
                   newx.mksymlinkto(x.readlink())
               elif x.check(file=1):
                   copychunked(x, newx)
               elif x.check(dir=1):
                   newx.ensure(dir=1)
path/common.py - line 114
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
   def check(self, **kw):
       """ check a path for existence, or query its properties
   
               without arguments, this returns True if the path exists (on the
               filesystem), False if not
   
               with (keyword only) arguments, the object compares the value
               of the argument with the value of a property with the same name
               (if it has one, else it raises a TypeError)
   
               when for example the keyword argument 'ext' is '.py', this will
               return True if self.ext == '.py', False otherwise
           """
       if kw:
           kw = kw.copy()
           if not checktype(self, kw):
               return False
       else:
           kw = {'exists' : 1}
->     return self.Checkers(self)._evaluate(kw)
path/common.py - line 75
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
   def _evaluate(self, kw):
       for name, value in kw.items():
           invert = False
           meth = None
           try:
               meth = getattr(self, name)
           except AttributeError:
               if name[:3] == 'not':
                   invert = True
                   try:
                       meth = getattr(self, name[3:])
                   except AttributeError:
                       pass
           if meth is None:
               raise TypeError, "no %r checker available for %r" % (name, self.path)
           try:
               if meth.im_func.func_code.co_argcount > 1:
                   if (not meth(value)) ^ invert:
                       return False
               else:
->                 if bool(value) ^ bool(meth()) ^ invert:
                       return False
           except (py.error.ENOENT, py.error.ENOTDIR):
               for name in self._depend_on_existence:
                   if name in kw:
                       if kw.get(name):
                           return False
                   name = 'not' + name
                   if name in kw:
                       if not kw.get(name):
                           return False
       return True
path/local/local.py - line 48
47
48
49
   def link(self):
->     st = self.path.lstat()
       return stat.S_ISLNK(st.mode)