This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import glob | |
| dot_py = glob.glob('*/migrations/*.py', recursive=True) | |
| for filePath in dot_py: | |
| if not os.path.basename(filePath) == '__init__.py': | |
| try: | |
| os.remove(filePath) | |
| except OSError: | |
| print("Error while deleting file") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sms_spliter(msg_text): | |
| sms_lst=[] | |
| if len(msg_text) <= 160: | |
| sms_lst.append(msg_text) | |
| return sms_lst | |
| else: | |
| l_m_text = (msg_text.split()) | |
| if len(max(l_m_text, key=len))> 160: | |
| return sms_lst | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| def u_slugify(txt): | |
| """A custom version of slugify that retains non-ascii characters. The purpose of this | |
| function in the application is to make URLs more readable in a browser, so there are | |
| some added heuristics to retain as much of the title meaning as possible while | |
| excluding characters that are troublesome to read in URLs. For example, question marks | |
| will be seen in the browser URL as %3F and are thereful unreadable. Although non-ascii | |
| characters will also be hex-encoded in the raw URL, most browsers will display them | |
| as human-readable glyphs in the address bar -- those should be kept in the slug.""" | |
| txt = txt.strip() # remove trailing whitespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def int_to_word(num): | |
| d = {0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', | |
| 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', | |
| 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', | |
| 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', | |
| 19: 'nineteen', 20: 'twenty', | |
| 30: 'thirty', 40: 'forty', 50: 'fifty', 60: 'sixty', | |
| 70: 'seventy', 80: 'eighty', 90: 'ninety'} | |
| k = 1000 | |
| l = k * 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ | |
| !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},sl |