##// END OF EJS Templates
setup actualizado para no necesitar numpy previamente
José Chávez -
r1026:cfaa3fd99bda
parent child
Show More
@@ -104,5 +104,5 ENV/
104 104 *.png
105 105 *.pyc
106 106 schainpy/scripts
107
107 .vscode
108 108 schaingui/node_modules No newline at end of file
@@ -32,9 +32,7 class Remote(Thread):
32 32 None
33 33
34 34 Written by:
35
36 "Miguel Urco":mailto:miguel.urco@jro.igp.gob.pe Jun. 03, 2015
37
35 "Miguel Urco":mailto:miguel.urco@jro.igp.gob.pe Jun. 03, 2015
38 36 """
39 37
40 38 server = None
@@ -168,13 +166,13 class Remote(Thread):
168 166 return 0
169 167
170 168 self.mutex.acquire()
171 # init = time.time()
172 #
173 # while(self.bussy):
174 # sleep(0.1)
175 # if time.time() - init > 2*self.period:
176 # return 0
177
169 # init = time.time()
170 #
171 # while(self.bussy):
172 # sleep(0.1)
173 # if time.time() - init > 2*self.period:
174 # return 0
175
178 176 self.fileList = fileList
179 177 self.mutex.release()
180 178 return 1
@@ -198,7 +196,7 class Remote(Thread):
198 196 if self.stopFlag:
199 197 break
200 198
201 # self.bussy = True
199 # self.bussy = True
202 200 self.mutex.acquire()
203 201
204 202 print "[Remote Server] Opening %s" %self.__server
@@ -400,21 +398,21 class SSHClient(Remote):
400 398 def open(self, server, username, password, remotefolder, port=22):
401 399
402 400 """
403 This method is used to set SSH parameters and establish a connection to a remote server
404
405 Inputs:
406 server - remote server IP Address
401 This method is used to set SSH parameters and establish a connection to a remote server
407 402
408 username - remote server Username
403 Inputs:
404 server - remote server IP Address
405
406 username - remote server Username
407
408 password - remote server password
409
410 remotefolder - remote server current working directory
409 411
410 password - remote server password
412 Return: void
411 413
412 remotefolder - remote server current working directory
413
414 Return: void
415
416 Affects:
417 self.status - in case of error or fail connection this parameter is set to 0 else 1
414 Affects:
415 self.status - in case of error or fail connection this parameter is set to 0 else 1
418 416
419 417 """
420 418 import socket
@@ -440,7 +438,7 class SSHClient(Remote):
440 438 try:
441 439 sshClientObj.connect(server, username=username, password=password, port=port)
442 440 except paramiko.AuthenticationException, e:
443 # print "SSH username or password are incorrect: %s"
441 # print "SSH username or password are incorrect: %s"
444 442 print "[SSH Server]:", e
445 443 return 0
446 444 except SSHException, e:
@@ -474,7 +472,7 class SSHClient(Remote):
474 472
475 473 def close(self):
476 474 """
477 Close connection to remote server
475 Close connection to remote server
478 476 """
479 477 if not self.status:
480 478 return 0
@@ -484,13 +482,13 class SSHClient(Remote):
484 482
485 483 def __execute(self, command):
486 484 """
487 __execute a command on remote server
488
489 Input:
490 command - Exmaple 'ls -l'
491
492 Return:
493 0 in error case else 1
485 __execute a command on remote server
486
487 Input:
488 command - Exmaple 'ls -l'
489
490 Return:
491 0 in error case else 1
494 492 """
495 493 if not self.status:
496 494 return 0
@@ -509,13 +507,13 class SSHClient(Remote):
509 507
510 508 def mkdir(self, remotefolder):
511 509 """
512 mkdir is used to make a new directory in remote server
513
514 Input:
515 remotefolder - directory name
516
517 Return:
518 0 in error case else 1
510 mkdir is used to make a new directory in remote server
511
512 Input:
513 remotefolder - directory name
514
515 Return:
516 0 in error case else 1
519 517 """
520 518
521 519 command = 'mkdir %s' %remotefolder
@@ -530,16 +528,16 class SSHClient(Remote):
530 528
531 529 def cd(self, remotefolder):
532 530 """
533 cd is used to change remote working directory on server
534
535 Input:
536 remotefolder - current working directory
531 cd is used to change remote working directory on server
537 532
538 Affects:
539 self.remotefolder
540
541 Return:
542 0 in case of error else 1
533 Input:
534 remotefolder - current working directory
535
536 Affects:
537 self.remotefolder
538
539 Return:
540 0 in case of error else 1
543 541 """
544 542 if not self.status:
545 543 return 0
@@ -582,9 +580,7 class SendToServer(ProcessingUnit):
582 580 ProcessingUnit.__init__(self)
583 581
584 582 self.isConfig = False
585 self.clientObj = None
586
587
583 self.clientObj = None
588 584
589 585 def setup(self, server, username, password, remotefolder, localfolder, ext='.png', period=60, protocol='ftp', **kwargs):
590 586
@@ -710,7 +706,7 class FTP(object):
710 706 self.ftp = ftplib.FTP(self.server)
711 707 self.ftp.login(self.username,self.password)
712 708 self.ftp.cwd(self.remotefolder)
713 # print 'Connect to FTP Server: Successfully'
709 # print 'Connect to FTP Server: Successfully'
714 710
715 711 except ftplib.all_errors:
716 712 print 'Error FTP Service'
@@ -742,7 +738,7 class FTP(object):
742 738 name, ext = os.path.splitext(f)
743 739 if ext != '':
744 740 self.fileList.append(f)
745 # print 'filename: %s - size: %d'%(f,self.ftp.size(f))
741 # print 'filename: %s - size: %d'%(f,self.ftp.size(f))
746 742
747 743 def parmsByDefault(self):
748 744 server = 'jro-app.igp.gob.pe'
@@ -3,10 +3,19 Created on Jul 16, 2014
3 3
4 4 @author: Miguel Urco
5 5 '''
6 import numpy
7 6 from setuptools import setup, Extension
7 from setuptools.command.build_ext import build_ext as _build_ext
8 8 from schainpy import __version__
9 9
10 class build_ext(_build_ext):
11 def finalize_options(self):
12 _build_ext.finalize_options(self)
13 # Prevent numpy from thinking it is still in its setup process:
14 __builtins__.__NUMPY_SETUP__ = False
15 import numpy
16 self.include_dirs.append(numpy.get_include())
17
18
10 19 setup(name="schainpy",
11 20 version=__version__,
12 21 description="Python tools to read, write and process Jicamarca data",
@@ -34,14 +43,16 setup(name="schainpy",
34 43 include_package_data=False,
35 44 scripts =['schainpy/gui/schainGUI',
36 45 'schainpy/scripts/schain'],
37 ext_modules=[Extension("cSchain", ["schainpy/model/proc/extensions.c"], include_dirs=[numpy.get_include()])],
46 ext_modules=[
47 Extension("cSchain", ["schainpy/model/proc/extensions.c"]
48 )],
49 cmdclass={'build_ext':build_ext},
50 setup_requires=["numpy >= 1.11.2"],
38 51 install_requires=[
39 52 "scipy >= 0.14.0",
40 53 "h5py >= 2.2.1",
41 54 "matplotlib >= 1.4.2",
42 55 "pyfits >= 3.4",
43 "numpy >= 1.11.2",
44 "paramiko >= 2.1.2",
45 56 "paho-mqtt >= 1.2",
46 57 "zmq",
47 58 ],
General Comments 0
You need to be logged in to leave comments. Login now