Skip to content

Commit

Permalink
version0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
0312birdzhang committed Aug 8, 2015
1 parent e69fb39 commit e604841
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion harbour-python3ftp.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Type=Application
X-Nemo-Application-Type=silica-qt5
Icon=harbour-python3ftp
Exec=harbour-python3ftp
Name=Python FTP
Name=PyFTP

Binary file modified harbour-python3ftp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions harbour-python3ftp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ SOURCES += src/harbour-python3ftp.cpp
OTHER_FILES += qml/harbour-python3ftp.qml \
qml/cover/CoverPage.qml \
qml/pages/FirstPage.qml \
rpm/harbour-python3ftp.changes.in \
rpm/harbour-python3ftp.spec \
rpm/harbour-python3ftp.yaml \
translations/*.ts \
qml/pages/simpleftp.py \
harbour-python3ftp.desktop
harbour-python3ftp.desktop \
rpm/harbour-python3ftp.changes

# to disable building translations every time, comment out the
# following CONFIG line
Expand Down
25 changes: 24 additions & 1 deletion qml/pages/simpleftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import re
import time
import pyotherside
import socket
import random

try:
from io import StringIO
Expand Down Expand Up @@ -88,6 +90,27 @@ def visit(self,url):
if url == opener.geturl():
str = opener.read()
return re.search('(\d+\.){3}\d+',str).group(0)
def scan(port):
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sk.settimeout(3)
flag=False
try:
sk.connect(('127.0.0.1',port))
flag=True
except Exception:
flag=False
sk.close()
return flag

#随机端口号
def randomport():
port=9537
pflag = scan(port)
#如果端口开启,则更换随机端口
while (pflag):
port = random.randint(9000,50000)
pflag = scan(port)
return port

def showTips():
pyotherside.send("")
Expand All @@ -100,7 +123,7 @@ def showTips():
# pyotherside.send('-------->> if you want to use other port, please execute: ')
# pyotherside.send('-------->> python SimpleHTTPServerWithUpload.py port ')
# pyotherside.send("-------->> port is a integer and it's range: 1024 < port < 65535 ")
port = 9537
port = randomport()

if not 1024 < port < 65535: port = 9898
# serveraddr = ('', port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
# * date Author's Name <author's email> version-release
# - Summary of changes

* Sun Apr 13 2014 Jack Tar <[email protected]> 0.0.1-1
- Scrubbed the deck
- Hoisted the sails
* Fri Aug 7 2015 BirdZhang <[email protected]> 0.0.2-1
-add random port if 9537 is used

* Fri Aug 7 2015 BirdZhang <[email protected]> 0.0.1-1
-update icon


2 changes: 1 addition & 1 deletion rpm/harbour-python3ftp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name: harbour-python3ftp
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: A ftp client by python3
Version: 0.1
Version: 0.2
Release: 1
Group: Qt/Qt
License: LICENSE
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-python3ftp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-python3ftp
Summary: A ftp client by python3
Version: 0.1
Version: 0.2
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
Expand Down

0 comments on commit e604841

Please sign in to comment.