Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified README.md
100755 → 100644
Empty file.
Empty file modified __init__.py
100755 → 100644
Empty file.
Binary file removed __pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/url_shortener.cpython-36.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
45 changes: 0 additions & 45 deletions data/api-documents/api/index.md

This file was deleted.

47 changes: 0 additions & 47 deletions data/api-documents/api/legend.md

This file was deleted.

1,762 changes: 1,762 additions & 0 deletions data/logs/urlShortener-error.log

Large diffs are not rendered by default.

1,762 changes: 1,762 additions & 0 deletions data/logs/urlShortener.log

Large diffs are not rendered by default.

9,637 changes: 0 additions & 9,637 deletions data/logs/urlshortener-error.log

This file was deleted.

9,637 changes: 0 additions & 9,637 deletions data/logs/urlshortener.log

This file was deleted.

3 changes: 0 additions & 3 deletions gunicorn

This file was deleted.

Binary file added makomodules/__pycache__/index.mak.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1527585204.9788141
_modified_time = 1526721920.9077945
_enable_loop = True
_template_filename = '/home/mohammad/workspace/urlshortener/urlshortener/templates/index.mak'
_template_filename = '/home/mohammad/workspace/projects/urlshortner/templates/index.mak'
_template_uri = 'index.mak'
_source_encoding = 'ascii'
_exports = []
Expand All @@ -18,14 +18,14 @@ def render_body(context,**pageargs):
try:
__M_locals = __M_dict_builtin(pageargs=pageargs)
__M_writer = context.writer()
__M_writer('<html>\n<head><title>Url shortener</title></head>\n<body>\n <div style="background-color:DodgerBlue;color:white;padding:20px;">\n <form method="POST" action="/">\n <strong>Iuput url:</strong>\n <input type="text" name="url" />\n <input type="submit" value="Submit" />\n </form>\n <form method="POST" action="/auth">\n <input type="submit" value="Login" />\n </form>\n </div>\n</body>\n</html>\n')
__M_writer('<html>\n<head><title>Url shortener</title></head>\n<body>\n <div style="background-color:DodgerBlue;color:white;padding:20px;">\n <form method="POST" action="/urlshortener">\n <strong>Iuput url:</strong>\n <input type="text" name="url" />\n <input type="submit" value="Submit" />\n </form>\n </div>\n</body>\n</html>\n')
return ''
finally:
context.caller_stack._pop_frame()


"""
__M_BEGIN_METADATA
{"filename": "/home/mohammad/workspace/urlshortener/urlshortener/templates/index.mak", "uri": "index.mak", "source_encoding": "ascii", "line_map": {"16": 0, "21": 1, "27": 21}}
{"filename": "/home/mohammad/workspace/projects/urlshortner/templates/index.mak", "uri": "index.mak", "source_encoding": "ascii", "line_map": {"16": 0, "21": 1, "27": 21}}
__M_END_METADATA
"""
31 changes: 31 additions & 0 deletions makomodules/notfoundpage.html.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
STOP_RENDERING = runtime.STOP_RENDERING
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1526721980.4338439
_enable_loop = True
_template_filename = '/home/mohammad/workspace/projects/urlshortner/templates/notfoundpage.html'
_template_uri = 'notfoundpage.html'
_source_encoding = 'ascii'
_exports = []


def render_body(context,**pageargs):
__M_caller = context.caller_stack._push_frame()
try:
__M_locals = __M_dict_builtin(pageargs=pageargs)
__M_writer = context.writer()
__M_writer('<html>\n<head><title>Url shortener</title></head>\n<body style="padding:80px;">\n <div style="background-color:Gray;color:white;padding:20px;">\n <h1 style="text-align:center;">Can not found page</h1>\n </div>\n</body>\n</html>\n')
return ''
finally:
context.caller_stack._pop_frame()


"""
__M_BEGIN_METADATA
{"filename": "/home/mohammad/workspace/projects/urlshortner/templates/notfoundpage.html", "uri": "notfoundpage.html", "source_encoding": "ascii", "line_map": {"16": 0, "21": 1, "27": 21}}
__M_END_METADATA
"""
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1527584278.3637245
_modified_time = 1526736931.5179572
_enable_loop = True
_template_filename = '/home/mohammad/workspace/urlshortener/urlshortener/templates/successfully.mak'
_template_filename = '/home/mohammad/workspace/urlshortener/templates/successfully.mak'
_template_uri = 'successfully.mak'
_source_encoding = 'ascii'
_exports = []
Expand All @@ -19,18 +19,16 @@ def render_body(context,**pageargs):
__M_locals = __M_dict_builtin(pageargs=pageargs)
hash_id = context.get('hash_id', UNDEFINED)
__M_writer = context.writer()
__M_writer('<html>\n<head><title>Url shortener</title></head>\n<body>\n <div style="background-color:MediumSeaGreen;color:white;padding:20px;">\n <h2 style="text-align:center;">Successfully</h2>\n <p style="text-align:center; color:black"><strong>Shortener\n <a href="http://localhost:8080/urls/')
__M_writer('<html>\n<head><title>Url shortener</title></head>\n<body>\n <div style="background-color:MediumSeaGreen;color:white;padding:20px;">\n <h2 style="text-align:center;">Successfully</h2>\n <p style="text-align:center; color:black"><strong>Shortener url: http://localhost:8080/')
__M_writer(str(hash_id))
__M_writer('">\n http://localhost:8080/urls/')
__M_writer(str(hash_id))
__M_writer('</a>\n </strong></p>\n </div>\n \n</body>\n</html>\n')
__M_writer('</strong></p>\n </div>\n \n</body>\n</html>\n')
return ''
finally:
context.caller_stack._pop_frame()


"""
__M_BEGIN_METADATA
{"filename": "/home/mohammad/workspace/urlshortener/urlshortener/templates/successfully.mak", "uri": "successfully.mak", "source_encoding": "ascii", "line_map": {"16": 0, "22": 1, "23": 7, "24": 7, "25": 8, "26": 8, "32": 26}}
{"filename": "/home/mohammad/workspace/urlshortener/templates/successfully.mak", "uri": "successfully.mak", "source_encoding": "ascii", "line_map": {"16": 0, "22": 1, "23": 6, "24": 6, "30": 24}}
__M_END_METADATA
"""
32 changes: 19 additions & 13 deletions setup.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@

import re
from os.path import join, dirname
from setuptools import setup, find_packages


# reading package version (same way the sqlalchemy does)
with open(join(dirname(__file__), 'urlshortener', '__init__.py')) as v_file:
package_version = re.compile('.*__version__ = \'(.*?)\'', re.S).match(v_file.read()).group(1)
with open(join(dirname(__file__), 'urlShortener', '__init__.py')) as v_file:
package_version = re.compile(r".*__version__ = '(.*?)'", re.S).match(v_file.read()).group(1)


dependencies = [
'restfulpy >= 0.41.3',
'hashids',
'ujson',
'aiohttp',
'pymongo',
'mako',
'nanohttp',
'oauth2client',
'bddrest',

# Deployment
'gunicorn',

# testing
'requests',
'webtest',
'nose',
'bddrest'
'nose'
]


setup(
name='urlshortener',
name="urlShortener",
version=package_version,
author='Mohammad',
author_email='mohammadsheikhian70@gmail.com',
author="Shayan",
author_email="shayn.rokrok@gmail.com",
install_requires=dependencies,
packages=find_packages(),
test_suite='urlshortener.tests',
test_suite="urlShortener.tests",
entry_points={
'console_scripts': [
'urlshortener = urlshortener:urlshortener.cli_main'
'urlShortener = urlShortener:urlShortener.cli_main'
]
}
},
message_extractors={'urlShortener': [
('**.py', 'python', None),
]},
)

File renamed without changes.
Binary file added templates/.successfully.mak.swp
Binary file not shown.
5 changes: 1 addition & 4 deletions urlshortener/templates/index.mak → templates/index.mak
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
<head><title>Url shortener</title></head>
<body>
<div style="background-color:DodgerBlue;color:white;padding:20px;">
<form method="POST" action="/">
<form method="POST" action="/urlshortener">
<strong>Iuput url:</strong>
<input type="text" name="url" />
<input type="submit" value="Submit" />
</form>
<form method="POST" action="/auth">
<input type="submit" value="Login" />
</form>
</div>
</body>
</html>
5 changes: 1 addition & 4 deletions urlshortener/templates/successfully.mak → templates/successfully.mak
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
<body>
<div style="background-color:MediumSeaGreen;color:white;padding:20px;">
<h2 style="text-align:center;">Successfully</h2>
<p style="text-align:center; color:black"><strong>Shortener
<a href="http://localhost:8080/urls/${hash_id}">
http://localhost:8080/urls/${hash_id}</a>
</strong></p>
<p style="text-align:center; color:black"><strong>Shortener url: http://localhost:8080/${hash_id}</strong></p>
</div>

</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Metadata-Version: 1.0
Name: urlshortener
Version: 0.1.0-planning.0
Name: urlShortener
Version: 1.16.2
Summary: UNKNOWN
Home-page: UNKNOWN
Author: Mohammad
Author-email: mohammadsheikhian70@gmail.com
Author: Shayan
Author-email: shayn.rokrok@gmail.com
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
20 changes: 20 additions & 0 deletions urlShortener.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
urlShortener/__init__.py
urlShortener.egg-info/PKG-INFO
urlShortener.egg-info/SOURCES.txt
urlShortener.egg-info/dependency_links.txt
urlShortener.egg-info/entry_points.txt
urlShortener.egg-info/requires.txt
urlShortener.egg-info/top_level.txt
urlShortener/controllers/__init__.py
urlShortener/controllers/helper.py
urlShortener/controllers/root.py
urlShortener/controllers/urls.py
urlShortener/models/__init__.py
urlShortener/models/speciality.py
urlShortener/models/urls.py
urlShortener/tests/__init__.py
urlShortener/tests/helpers.py
urlShortener/tests/sample.py
urlShortener/tests/test_authentication.py
urlShortener/tests/test_root.py
urlShortener/tests/test_root2.py
3 changes: 3 additions & 0 deletions urlShortener.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[console_scripts]
urlShortener = urlShortener:urlShortener.cli_main

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
restfulpy>=0.41.3
hashids
ujson
aiohttp
pymongo
mako
nanohttp
oauth2client
bddrest
gunicorn
requests
webtest
nose
bddrest
1 change: 1 addition & 0 deletions urlShortener.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
urlShortener
35 changes: 35 additions & 0 deletions urlShortener/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from os.path import dirname, join

from restfulpy import Application as BaseApplication
from restfulpy.orm import DBSession


from urlShortener.controllers import Root
from urlShortener import models
from urlShortener.models.urls import Url

__version__ = '1.16.2'


class Application(BaseApplication):
def __init__(self):
super().__init__(
'urlShortener',
root=Root(),
root_path=join(dirname(__file__), '..'),
version=__version__,
)

# noinspection PyArgumentList
def insert_basedata(self): # pragma: no cover
# basedata.insert()
DBSession.commit()

# noinspection PyArgumentList
def insert_mockup(self):
url = Url(url='www.google.com')
DBSession.add(url)
DBSession.commit


urlShortener = Application()
Binary file added urlShortener/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions urlShortener/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from urlShortener.controllers.root import Root
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading